More Fun with VMWare

I know, I know. Damn that Perlow. Can‘t he come up with an “On the Desktop” column that doesn’t involve VMWare (http://vmware.com) or some kind of emulation of some kind or another? Well, yes, I could, but then you wouldn’t learn all the cool stuff I’m about to lay on you.
Now that VMware Server and VMware Player are completely free programs, either of those two packages should be an essential part of your Linux desktop suite. With VMWare, you can run other Linux distros, virtual Linux clusters, and even Windows. This particular article, though, is going to go down a road less traveled. No, we’re not gonna run Solaris or Vista in VMWare. We’re gonna run DOS!

The Joys of DOS

If you’re under 30, you probably don’t remember the joys of old DOS games and applications. What we do today with gigahertzes of CPU power, hundreds of gigabytes, of storage and gigabytes of RAM used to be performed with systems with a small fraction of those resources. A typical PC circa-1992 was based on the Intel 80386 or 80486, clocking out at 33 MHz with a 100 MB hard disk, and 4-8 MB of RAM. A powerhouse-machine, relegated to CAD engineers and Wall Street stock traders might have been a 66 MHz or 100 MHz box (perhaps an original Pentium) with a 200 MB disk and 16-32 MB of RAM, and there were very few applications that could even utilize that much mojo back then.
The PC of the 1980s and 1990s might sound puny, but we didn’t have big, honking GUIs, multitasking, true-color, super-high-resolution graphics, full motion video, and CD-quality digitized stereo sound to worry about, either. We didn’t have broadband Internet; we had CompuServe and Prodigy and FidoNET boards, accessed via 9,600-baud modems using POTS lines. (And we liked it!) It was a rough and tumble time when geeks were geeks, when you had to know your command-line, and when spam and phishing were nothing more than a food and an old-fashioned pastime. No spyware. Yeah, there were viruses, but you could only get” infected” by actually swapping physical floppy disks or downloading an infected file. Even then, viruses were easy to isolate and eliminate.
The big applications of the day were character-mode programs, like Lotus 1-2-3, dBase, Harvard Graphics, and WordPerfect 5.0. Even Windows 3.x, which everyone considered to be a major resource hog even back then, ran just peachy in 8 MB of RAM with plain VGA graphics in about 10 MB of hard disk space.
A lot of legacy DOS programs can be downloaded off the Internet, particularly the games, as” abandonware,” or in other words, software that’s no longer supported by the original companies that wrote them, by virtue of the companies going out of business or no longer claiming rights to sell or distribute them anymore. A search on Google for” abandonware” lists a large number of sites where you can download lots of golden oldies, all still very playable and enjoyable today, particularly if you like strategy, RPG, or adventure stuff, as the very best people in the business, those who started the entire computer gaming industry, were directly involved on the development teams that produced these old games. Frankly, it amazes me that even with all the technology we have today, we can’t create anywhere near the amount of quality games as they did back then.

Getting DOSed

The first thing you’re going to need is a copy of DOS that you can run on your PC, either virtually or on the metal. While DOS can run even on today’s x86 hardware, I strongly recommend you go the virtualization route, simply because installation is easier, and because you won’t have to worry about device driver compatibility issues. Moreover, if you crash DOS (which will happen), you just hit the virtual power button and reboot in a matter of seconds.
In an earlier column in January 2006, I went into detail on how to install the free VMWare Player and the evaluation version of VMWare Workstation (http://www.linux-mag.com/2006-01/desktop.html). Since then, VMWare also released VMWare Server e.x.p. for free as well. The installation procedure is nearly identical, and the software isn’t really any more resource intensive. The only difference is that VMWare Server has a client component that can be run on any PC (Linux or Windows) to connect to a virtual machine over the network, or to the server running on the local machine. The procedures outlined in this article will work with both VMWare Server and VMWare workstation, and the DOS Virtual Machine we’ll be creating will run just fine on VMWare Player (for both Linux and Windows) as well.
Here’s where the irony comes in.
As it turns out, you can download perfectly legal, free copies of DOS. However, you can’t get it from Microsoft. Even if you have an MSDN account, Microsoft only offers the upgrade version of MS-DOS 6.22 for download, so you would need the original installation media for MS-DOS 5 or MS-DOS 6, which, if you ever purchased it legally, is probably sitting in a landfill or has been recycled into pillow stuffing by now. No, if you want to install DOS on a computer today, it has to be Caldera OpenDOS.
Caldera? Isn’t that SCO? The company that’s suing IBM and is trying to wipe Linux from the earth?
Well, sorta. In the mid-1990s, years before being bought by SCO, Caldera purchased the assets of Digital Research (DRI), a company that produced a DOS-compatible operating system that was a virtual clone of MS-DOS. If you remember your computer history, it started out as an operating system called CP/M-86, which IBM almost picked as the system to ship with the IBM PC. Instead, Bill Gates bought a quasi-legal CP/M-86 clone from Seattle Computer Products for $10,000 and offered it up for a cut-rate price to IBM. The rest is history.
Unable to make actual money from DR-DOS as a PC operating system, Caldera renamed it OpenDOS, attempted to market it as an embedded development system, and then released the PC version for free and under an Open Source license. While Caldera eventually sold off DR-DOS, you can still download it off the Internet from http://www.drdos.net.
Get the five 1.44M B floppy images for OpenDOS 7.03 and store them in your home directory. Additionally, download the bootable ISO image for MS-DOS 6.22 from http://www.allbootdisks.com; it contains some essential drivers that you’re going to need later.

Installing DR-DOS

Next, launch VMWare Workstation or the VMWare Server Console, and click on the “Create a new virtual machine” icon. When prompted, choose “Typical” for the Virtual Machine configuration, then “Microsoft Windows” and “Windows 3.1” for the software version. Assign it a name like DR-DOS, choose “Bridged Networking,” and then choose a disk size from 100 MB to 2 GB. Truthfully, anywhere from 200-500 MB is a huge amount of space for DOS (including a fully-blown Windows 3.11 setup) and 2 GB is the maximum amount of disk DOS can traditionally handle without extenders.
By default, VMware assigns 16 MB of RAM to the VM. I recommend you boost it to 32 MB, pull the virtual Ethernet controller (unless you want to used networked Windows 3.11 or DOS application), and omit the virtual USB controller. If you want to hear sound in DOS games, add the virtual sound adapter to the configuration.
Next, assign the virtual floppy to the Caldera OpenDOS boot floppy image. In your new VM home screen, double-click on “Floppy 1”. When the “Settings” screen opens, click on “Connect at power on,” then “Use a floppy image.” Click on “Browse” and then browse to the directory that contains your OpenDOS floppy images. Choose the disk01.img file, and then click the “OK” button with the green check mark to close out the dialog.
Next, hit the green power-on button. Caldera DR-DOS boots, and you’ll see a message that says that the installer can’t find drive C:. It then prompts you to enter the FDISK program. When prompted to initialize the disk, answer Y. Next, select option 1, to create a partition. The program then prompts you to use all of the cylinders on the disk. Again, answer Y. When prompted to verify, answer N. You’ll then be prompted for a disk label. It can be any name you want up to 11 characters. I picked OPENDOS. After entering the volume label, hit the ESC key. At the prompt to restart, choose “Send CTRL+ ALT+ DEL” from the VMWare menu.
On the next boot, Caldera OpenDOS boots into the installation program. In the first screen, hit Enter to get to the license acceptance screen, and hit Enter again at the registration info screen. Type in your name and organization, hit the Tab key at the “Serial Number” field, and hit Enter when the “Next” button is highlighted.
At the “Networking” screen, press the Tab key until “Networking System” is highlighted. Hit Space so that the check mark turns off. Then hit the Tab key until the “Next” button is highlighted and press Enter. At the next screen, the one containing the configuration options, simply hit Enter. You will then be prompted to copy the files. Press Enter, and when prompted for the next disk (s), type Control-Alt at the same time to release control of the mouse and keyboard to Linux. Next, move your mouse pointer over the floppy icon at the bottom right of the VMWare window, and click on it. At the “Use Floppy Image” dialog, switch it to disk02.img as you did originally for the first disk image, and press the green “OK” button. You can then click back into the VM window and hit the Enter key to continue loading files. When prompted, repeat the same process for disk 3 and disk 5. Disk 4 isn’t used.
When the installation is complete, click on the red power off button to shut down the VM.
Next, click into the floppy configuration screen again and un-check “Connect at power on” and then click on the green OK button. You’re going to want to boot from the virtual CD-ROM drive next, so the virtual Floppy drive must be disabled.
Next, from the home VM screen, click on “CD-ROM 1”. At the settings screen, for “Connection,” click on “Use ISO Image.” Click on the “Browse” button, and choose the DOS6.22.ISO file you downloaded from the allbootdisks.com site earlier. Click on “OK” to return to the home VM screen.
Here’s where it might take a few tries to get right, especially if you haven’t had your coffee yet. Hit the green power button to begin the boot process again and quickly click into the VM display. As the BIOS boot sequence comes up, hit the Escape key to go into the BIOS boot device selection screen. Once it comes up, hit the down-arrow button twice to get to Option 3, CD-ROM, and then hit Enter. MS-DOS boots, and you’ll be presented with an A:\> drive prompt.
Next, issue the following commands in sequence:
copy cd1.sys c: 
copy mscdex.exe c:
copy mouse.sys c:
Once these files are copied over, you can hit the red “Power off” button and then reboot the virtual DOS system into DR-DOS, where you should be presented with a C:> drive prompt.

DOS Memory Management and Device Drivers

Now, here’s where the fun stuff really begins. Unlike modern operating systems where we take memory management and device driver configuration for granted, everything in DOS needs to be set up manually. So you’re going to need to make some modifications to the startup files before you can get things like the CD-ROM, the mouse driver, and memory above 640 K working in the virtual machine.
From the C:> prompt, enter the command:
EDIT C:\CONFIG.SYS
Edit CONFIG.SUS file to look like this:
DEVICE=C:\DRDOS\EMM386.EXE NOEMS I=B000-B7FF  
DEVICEHIGH=C:\CD1.SYS /D:CDROM1
DEVICEHIGH=C:\MOUSE.SYS
SHELL=C:\COMMAND.COM C:\ /E:512 /P
BUFFERS=15
FILES=30
FCBS=4,4
LASTDRIVE=Z
HISTORY=ON,512,ON
DOS=HIGH,UMB
The first line activates the high memory region above 640K, frees up the unused monochrome graphics memory region, and then activates the 32-bit protected-mode extended memory manager and maps everything out as” extended” memory (versus” expanded” memory). The second and third lines load the CD-ROM driver and the mouse driver. The last line loads the DOS kernel itself into the high memory area and activates the upper memory block.
What the hell does all of this mean and why should you care? Well, back in the day, DOS was originally designed to only use up to 640 KB of memory. Eventually, when later Intel processors were released, such as the 286 and 386 chips, which could access larger amounts of memory, applications were finally released that could utilize more than 640 K, such as Lotus 1-2-3, AutoCAD, and later, Microsoft Windows. However, even though you could finally use larger amounts of memory, it wasn’t contiguous or “flat” like modern operating systems. Back then, you needed memory managers, like EMM386, to provide access to the stuff above 640 KB, and you still needed to optimize your 640 KB region in order to free up as much “conventional” memory as possible, because DOS programs still needed to fit into that area before accessing the “extended” or “expanded” memory. Hence, the sample CONFIG.SYS has the DEVICEHIGH statements in CONFIG.SYS and the LOADHIGH statements in the AUTOEXEC.BAT file (discussed next).
Needless to say, this was a mess, because to get the most out of the hardware, software companies (like some of the game vendors such as Origin and companies like Lotus and Quarterdeck) wrote their own memory managers and created their own DOS memory standards. Thus, it was not inconceivable to have different DOS boot floppies in order to load different memory management configurations. Some games and applications, for example, required “expanded” memory whereas other programs like Windows 3.x used “extended” memory.
If you use my CONFIG.SYS file as above, you get a pretty plain DOS memory configuration for extended memory, with about 625 KB of conventional memory free, which should be fine for just about everything. Make the changes, hit Alt-V to save, and then Alt-X to quit.
Similarily, open AUTOEXEC.BAT with C:\> EDIT AUTOEXEC.BAT. Here’s what my file looks like:
@ECHO OFF
PATH C:\DRDOS;C:\;C:\UTILS;
VERIFY OFF
PROMPT [DR-DOS] $P$G
SET DRDOSCFG=C:\DRDOS
LOADHIGH MSCDEX.EXE /D:CDROM1 /V
REM NWCACHE 7670 1024 /LEND=ON /DELAY=OFF
The second line sets the search path for commands. If you want to add additional search directories, simply add a ; (semicolon) to the previous directory, and then add C: \DIRECTORYNAME for each search directory. The second-to-last line adds support for the Microsoft CD-ROM extensions and loads the driver into high memory.
The final line, which is commented out with REM, adds support for the disk cache, which is useful for running Windows 3.11 (which you can still download, if you have an MSDN subscription). I elected turn it off, because it eats up too much memory and doesn’t really accelerate conventional DOS programs.
Now, you may find that various DOS abandonware programs don’t not have enough conventional memory available, or you might need” expanded” memory — this is why VMWare is an excellent solution. Once you’ve got your DOS game copied into your virtual machine, you can REM out the CD-ROM drivers and mouse drivers (some DOS games use their own mouse driver) in CONFIG.SYS and AUTOEXEC.BAT to free additional memory. Since most games only take up a few megabytes, you can install DOS and your game in a whole, what, 50 MB or less? With VMWare, You can have dozens of virtual DOS systems configured as needed.
Make sure you keep backup copies of your VM in case you screw something up or want to make a quick clone. In VMWare Workstation and Player, the vmware directory beneath your home directory contains the VM directories, which you can copy and rename and burn to a CD or DVD. On VMware Server, the directories are located in /var/lib/vmware/Virtual Machines/.

Jason Perlow’s abandonware collection is only eclipsed by his collection of 8-track tapes. You can reach Jason via that newfangled technology called email at class="emailaddress">jperlow@linux-mag.com.

Fatal error: Call to undefined function aa_author_bios() in /opt/apache/dms/b2b/linux-mag.com/site/www/htdocs/wp-content/themes/linuxmag/single.php on line 62