OSDARVMB - RUNNING REAL DOS UNDER OS/2 (CREATING A VIRTUAL MACHINE BOOT) 07/11/96 ======================================================================= Running Real DOS Under OS/2 (Creating a Virtual Machine Boot) ====================================================================== Please Read Entire Document for Full Explanation of Procedures -------------------------------------------------------------- DESCRIPTION Some older DOS applications fail to run under OS/2's DOS emulation. Errors appear such as "Buffers are currently set to 0, this program needs 30 or more", even when buffers there are enough; or "Out of memory " or "Incorrect DOS version", even when DOS settings have been adjusted to correct such errors. Often these errors occur because the applications are using undocumented DOS function calls that are not supported by OS/2's DOS emulator. RESOLUTION OS/2 has the ability to actually run real DOS in a special DOS session called a Virtual Machine Boot (VMB). Once set up, a VMB will function as a standard DOS session. This document discusses limitations of the different methods used to create a VMB. It explains the purpose of the different device drivers and TSRs that are used, and the differences between a VMB and a standard DOS session. It includes step-by-step instructions for creating a VMB. Notes: 1. Make sure you have a backup of any file you intend to change. 2. This document describes the procedure to create a VMB using DOS version 6.0 or higher. Methods Used to Create a VMB ---------------------------- Method A --------- Changing to the A: drive in a VMB created by Method A gives you the image file. If you do a dir while on drive A you will see all the files that were on the original diskette that the VMB was created from. The CONFIG.SYS and AUTOEXEC.BAT used by the VMB are on this A drive and can be edited to change the behavior of the VMB. The A diskette can be accessed as another drive letter. (M is used by default in these instructions.) Method B: --------- Changing to the A drive will give you the actual diskette drive. However, it makes it more difficult to change the CONFIG.SYS and AUTOEXEC.BAT of the VMB once it's created. To edit the CONFIG.SYS and AUTOEXEC.BAT with this method, the VMB.BAT must be renamed before the VMB is started. You can then start the VMB and change to the A drive to edit the files. Method C: --------- This method requires Boot Manager, and uses DOS from the C drive. A VMB created by this method will function like a standard DOS session, except for the differences noted below. Differences from Standard DOS Sessions -------------------------------------- 1. The EXIT command will not work from a VMB. There is a program in the \OS2\MDOS directory called EXIT_VDM, that can be run instead to exit a VMB from the command line. 2. The following DOS settings will not affect VMBs: DOS_FILES DOS_HIGH DOS_UMB DOS_AUTOEXEC DOS_DEVICE DOS_LAST_DRIVE DOS_SHELL All of these settings must be changed in the CONFIG.SYS of the VMB. Creating a DOS Startup Diskette ------------------------------- Both Method A and B require a DOS startup diskette. This section is include for users who are unfamiliar with the process of creating a DOS startup diskette. Note: If you already have a DOS startup diskette, it is best to start up with that diskette and then create another one from it. During the process of creating a VMB, the diskette will be modified. You should not modify an emergency DOS startup diskette. DOS startup diskettes can only be created from a real DOS system. Creating a DOS Startup Diskette from a Native DOS System -------------------------------------------------------- 1. Start the computer. 2. Insert a blank formatted diskette in drive A. 3. At the command prompt of the DOS root directory, type SYS A: and press Enter. COMMAND.COM is now on the diskette. Creating a DOS Startup Diskette from Another DOS Startup Diskette 1. Insert a DOS startup diskette in drive A that includes the FORMAT.COM file from native DOS. 2. Turn on the computer, or press Ctrl+Alt+Del if it is already on. 3. Type FORMAT A: /S and press Enter. When you see the "Press any key" message, insert a blank diskette for the VMB in drive A, and press Enter. COMMAND.COM is now on this diskette. Creating a VMB From a DOS Startup Diskette, Method A ----------------------------------------------------- You can read and write to a drive other than drive A; for example, drive M. You can change the AUTOEXEC.BAT and CONFIG.SYS files, and add files directly to the VMB image file on the hard disk. 1. Start the system to the OS/2 Desktop. 2. Insert the DOS startup diskette in drive A. 3. Open the OS/2 System folder. 4. Open the Command Prompts folder. 5. Double-click on the OS/2 Window icon. 6. Type the following commands and press Enter after each: cd \os2\mdos copy ansi.sys a: copy fsfilter.sys a: copy fsaccess.exe a: copy emm386.sys a: copy himem.sys a: copy lptdd.sys a: copy mouse.com a: a: e config.sys This copies the needed files to the DOS diskette, switches to the A drive, and opens the VMB's CONFIG.SYS file in the editor. 7. Edit the CONFIG.SYS file (it could be blank) so that it contains only the following lines: DEVICE=HIMEM.SYS DEVICE=EMM386.SYS DOS=HIGH,UMB DEVICE=FSFILTER.SYS DEVICE=ANSI.SYS DEVICE=LPTDD.SYS FILES=40 BUFFERS=30 LASTDRIVE=Z 8. Click on File; then Save. 9. Click on Type. 10. Select Plain Text; then click on Set. 11. Click on File; then Open. 12. In the Open filename: box, type AUTOEXEC.BAT. 13. Click on Open. 14. You are now in the VMB's AUTOEXEC.BAT. Edit the file so that it contains the following lines: ECHO OFF PROMPT $P$G MOUSE.COM PATH C:\;C:\VMB FSACCESS M=A C: CD\VMB Note: The M represents the drive you want to access the A drive as. With this method, changing to the A drive will always give you the image file, so FSACCESS is used to give the diskette drive another letter. 15. Click on File; then Save. 16. Click on Type. 17. Select Plain Text; then click on Set. 18. Close the editor by double-clicking on the upper-right corner. 19. You are now back at the command line. Type the following, pressing Enter after each: X: mkdir VMB cd \VMB VMDISK A: DOS.IMG Note: The X: represents the drive you want the VMB files stored on. The files can require as much as 1.44 MB. This will create the directory for the image file and the image file itself. 20. Remove the diskette from drive A. 21. Type EXIT at the command line. 22. Create a VMB Desktop icon to launch the VMB, following the instructions in the section "Creating a VMB Desktop Icon for Method A or B." Creating a VMB From a DOS Startup Diskette, Method B. ----------------------------------------------------- You can read or write to drive A, but you cannot change the AUTOEXEC.BAT or CONFIG.SYS file, or add files directly to the VMB image file on the hard disk. 1. Start the system to the OS/2 Desktop. 2. Insert the DOS startup diskette into drive A. 3. Open the OS/2 System folder. 4. Open the Command Prompts folder. 5. Double-click on the OS/2 Window icon. 6. Type the following commands, pressing Enter after each: cd \os2\mdos copy ansi.sys a: copy fsfilter.sys a: copy fsaccess.exe a: copy emm386.sys a: copy himem.sys a: copy lptdd.sys a: copy mouse.com a: a: e config.sys This copies the needed files to the DOS diskette, switches to the A drive, and opens the VMB's CONFIG.SYS file in the editor. 7. Edit the CONFIG.SYS file (it might be blank) so that it contains only the following lines. DEVICE=HIMEM.SYS DEVICE=EMM386.SYS DOS=HIGH,UMB DEVICE=FSFILTER.SYS DEVICE=ANSI.SYS DEVICE=LPTDD.SYS FILES=40 BUFFERS=30 LASTDRIVE=Z 8. Click on File; then Save. 9. Click on Type. 10. Select Plain Text; then click on Set. 11. Click on File; then Open. 12. In the Open filename: box, type AUTOEXEC.BAT. 13. Click on Open. 14. You are now in the VMB's AUTOEXEC.BAT file. Edit the file so that it contains the following lines: ECHO OFF PROMPT $P$G SET COMSPEC=C:\VMB\COMMAND.COM MOUSE.COM PATH C:\;C:\VMB C: CD\VMB VMB.BAT 15. Click on File; then Save. 16. Click on Type. 17. Select Plain Text; then click on Set. 18. Close the editor by double-clicking on the upper-right corner. 19. At the command line. Type the following commands, pressing Enter after each: X: mkdir VMB cd \VMB copy a:\command.com e VMB.BAT Note: The X: represents the drive you want the VMB files stored on. The files can require as much as 1.44 MB. This switches to your hard drive, creates a directory for the VMB files, copies COMMAND.COM to that directory, creates a file called VMB.BAT, and opens it in the editor. 20. Edit the VMB.BAT file by adding the following lines: C:\OS2\MDOS\FSACCESS A: CD\ 21. Click on File; then Save. 22. Click on Type. 23. Select Plain Text; then click on Set. 24. Close the editor by double-clicking on the upper-right corner. 25. At the command line, type the following and press Enter: VMDISK A: DOS.IMG This creates the image file on the hard drive. 26. Remove the diskette from drive A. 27. Type EXIT at the command line. 28. Create a VMB Desktop icon to launch the VMB, following the instructions in the section "Creating a VMB Desktop Icon for Method A or B." Creating a VMB Desktop Icon for Method A or B ---------------------------------------------- 1. Move the mouse pointer to the DOS Full Screen icon. Press and hold Ctrl+MB2 (mouse button 2) and drag the icon to the Desktop; then release Ctrl+MB2. 2. Single click on newly created icon with the right mouse button. This will display its pop-up menu. 3. Select Settings to open the Settings notebook. 4. Select Session. 5. Select DOS Settings. 6. Select OK to select all DOS settings. 7. Find and highlight DOS_STARTUP_DRIVE. 8. Change the value box to X:\VMB\DOS.IMG. Where X is the drive you put the VMB directory on. 9. Select Save. 10. Select General and change the Title field to VMB or the name you want to call your Desktop icon. 11. Close the window. Multi-Start VMB General Guidelines, Method C -------------------------------------------- Creating Multi-Start VMB CONFIG.SYS and AUTOEXEC.BAT Files ---------------------------------------------------------- The multi-start VMB is for systems with the Boot Manager setup: DOS Version 6.0 or later in the C partition and OS/2 in a different partition. Create the following AUTOEXEC.BAT and CONFIG.SYS files in the root directory of the C (DOS) partition. Note: Use a text editor to create the files. Replace the < > symbols around "Menu," "Normal," and "OS2" with brackets [ ]. These characters are misinterpreted because of the way the files are stored on the IBM LAN. Note: Use the following instructions to create the VMB. Make sure it is running before you add other files, drivers, and statements for your specific applications, networks, and so on. AUTOEXEC.BAT File: @ECHO OFF PROMPT $p$g GOTO %CONFIG% :NORMAL C:\DOS\SMARTDRV.EXE PATH C:\DOS SET TEMP=C:\DOS LH C:\DOS\MOUSE.COM LH C:\DOS\DOSKEY GOTO END :OS2 SET COMSPEC=C:\DOS\COMMAND.COM PATH C:\;C:\DOS; LH DOSKEY LH D:\OS2\MDOS\MOUSE.COM GOTO END :END CONFIG.SYS File: MENUITEM=OS2,BOOT FOR OS/2 VMB MENUITEM=NORMAL,BOOT FOR NATIVE DOS DEVICE=C:\DOS\HIMEM.SYS DEVICE=C:\DOS\EMM386.EXE NOEMS DOS=HIGH,UMB FILES=30 BUFFERS=15 SHELL=C:\DOS\COMMAND.COM C:\DOS\ /P DEVICEHIGH=C:\DOS\ANSI.SYS STACKS=9,256 DEVICE=D:\OS2\MDOS\FSFILTER.SYS DEVICE=D:\OS2\MDOS\HIMEM.SYS DEVICE=D:\OS2\MDOS\EMM386.SYS DEVICEHIGH=D:\OS2\MDOS\ANSI.SYS DEVICEHIGH=D:\OS2\MDOS\LPTDD.SYS DOS=HIGH,UMB FILES=30 BUFFERS=20 SHELL=C:\DOS\COMMAND.COM C:\DOS /P Creating a VMB Desktop Icon for Method C ----------------------------------------- 1. Open the OS/2 System folder. 2. Select Command Prompts. 3. Move the mouse pointer to the DOS Full Screen icon. Press and hold Ctrl+MB2 (mouse button 2) and drag the icon to the Desktop; then release Ctrl+MB2. 4. Close Command Prompts and OS/2 System. 5. Change the DOS settings for the VMB icon: a. Select the icon created above. b. Press mouse button 2 to display the menu. c. Select Settings to open the Settings notebook. d. Select Session. e. Select DOS Settings. f. Change the following settings: DOS_UMB to: ON DOS_HIGH to: ON DOS_STARTUP_DRIVE to: C:\ XMS_MEMORY_LIMIT to: (default is 2048--minimum) g. Use the following settings for applications that use DOS Protected Mode Interface (DPMI): DPMI_MEMORY_LIMIT to: 4 (Minimum requirement) DPMI_DOS_API to: ENABLE Note: Do not do change any other setting until the VMB is running. 6. Select Save. 7. Select General and change the Title field to VMB or the name you want to call your Desktop icon. 8. Close the window. 9. Select the new DOS VMB Desktop icon. The following appears: PC-DOS 6.3 Startup Menu 1. BOOT FOR OS/2 VMB (highlighted) 2. BOOT FOR NATIVE DOS 10. Select 1. Note: If you select 2, you receive an error message. This selection is for starting native DOS from the Boot Manager partition. 11. To exit the VMB, create the batch file, X.BAT (containing the following line), in the C:\ directory: @ECHO OFF D:\OS2\MDOS\EXIT_VDM 12. Type X at the command prompt. ______________________________________________________________________ IBM disclaims all warranties, whether express or implied, including without limitation, warranties of fitness and merchantability with respect to the information in this document. By furnishing this document, IBM grants no licenses to any related patents or copyrights. Copyright (c) 1994, 1995 IBM Corporation. Any trademarks and product or brand names referenced in this document are the property of their respective owners. Consult your product manuals for complete trademark information.