TheBlackzone Logo

MS-DOS 6.22 in QEMU

Posted on Sunday, May 13, 2018 by TheBlackzone

MS DOS Icon In a previous post, I had installed MS-DOS 3.30 in the QEMU emulation system, what turned out to be quite simple. Doing the same with Version 6.22 of MS-DOS is even easier. In this post I will show you how to install MS-DOS 6.22 in QEMU under Linux and add CDROM support.

Prerequisites

What you need is

Installation and basic usage of QEMU as well as the creation of floppy disk images is beyond the scope of this post. Instead I will go straight to the MS-DOS installation process.

Installation

First, we need a blank harddisk image to install MS-DOS on:

qemu-img create msdos.disk -f qcow2 512M 

Then we boot from first floppy image (I have named my MS-DOS floppy disk image dos622_1.dd, dos622_2.dd and dos622_3.dd:

qemu-system-i386 -L . -hda msdos.disk -fda dos622_1.dd -boot a 

The MS-DOS installation wizard will automatically start up and guide you through the installation process, which reduces to just switching the floppy disks when prompted.

In order to change floppy disk images press CTRL+ALT 2 in QEMU to switch to the QEMU console. There, issue the command

change floppy0 [FILENAME-OF-FLOPPY-IMAGE] 

and then press CTRL+ALT 1 to go back to the emulation. Repeat this when prompted for the third diskette. At the end of the installation process you are prompted to remove the floppy disk from the drive. To do so, change to the QEMU console again and type

eject floppy0 

switch back and confirm the installation dialog.

To exit the emulation either just close the QEMU window or switch to the QEMU console and type quit.

For subsequent starts of the VM without booting from Diskette use

qemu-system-i386 -L . -hda msdos.disk 

Presto! You have a working MS-DOS 6.22 environment.

CDROM support

For CDROM support in MS-DOS 6.22 you need two components. First the program mscdex.exe which already comes with MS-DOS 6.22 (you'll find it in the C:\DOS directory). Second a CDROM driver. I found oakcdrom.sys to be working in the emulation and got a copy of it from another disk I had around. If you don't have oakcdrom.sys at hand, do a quick search on the web, the file should be widely available.

Now the question is: How do we get the CDROM driver in our MS-DOS environment? One way would be to connect the hard disk image we created with qemu-nbd as block device and then mount it. The other way is to create a blank floppy image, put the file into it and then use the image in qemu. I will show you the latter way, since it is quite handy on other occasions to know how to create "virtual diskettes" for your emulation.

So, first create a blank floppy image (1.44 MB):

mkfs.msdos -C blank.dd 1440 

Then, mount it (I'm using the directory mnt in my home directory here):

sudo mount -t msdos -o loop,rw,uid=1000,gid=1000 blank.dd ~/mnt 

The uid (user id) and gid (group id) options must be set in order to be able to write to the mounted directory. Simply type id to show our IDs.

You can now copy the driver file to the directory where your image is mounted. After that, dismount the image

sudo umount ~/mnt 

And start the emulation, with the floppy image attached:

qemu-system-i386 -L . -hda msdos.disk -fda blank.dd 

The driver file can now be copied to the disk image. Inside the MS-DOS emulation, perform the following steps:

Copy the driver file to the C:\DOS directory:

copy a:\oakcdrom.sys c:\dos 

Next edit c:\config.sys and append the following line

DEVICEHIGH=C:\DOS\OAKCDROM.SYS /D:MSCD001 

after that, edit c:\autoexec.bat and append

LOADHIGH C:\DOS\MSCDEX.EXE /D:MSCD001 

Then restart the VM, without the floppy image attached:

qemu-system-i386 -L . -hda msdos.disk 

You should now see the output of the OAKCDROM driver and MSCDEX on startup.

You can now use CD ISO images and access it from you MS-DOS emulation. To connect an ISO image, switch to the QEMU console and use

change ide1-cd0 win311.iso 

Bonus: Install Windows 3.11 for Workgroups

I still have an installation CD for Windows 3.11 for Workgroups which runs atop MS-DOS. And, hey, just for fun, I made a test installation...

I started the emulation, as usual with:

qemu-system-i386 -L . -hda msdos.disk 

After MS-DOS is running, I switched to the QEMU console by pressing CTRL+ALT 2 and issued the command

change ide1-cd0 win311.iso 

Then I returned to the emulation by pressing CTRL+ALT 1 and started the installation process.

d: cd win311 setup.exe 

Following the steps of the installation programm, Windows is installed in under 1 Minute (yes, good old times, the installation files for Windows 3.11 are only 26 MB in total).

_figure(msdos622-in-qemu-01.png, `Windows 3.11 for Workgroups')

A note on Windows 3.11 network support

Windows 3.11 does only support the network protocolls NetBUI and IPX, not TCP. So it is virtually useless nowadays. If for whatever reason you want to add network support to Windows 3.11, you can do it with the following command. But be aware that Windows 3.11 will tend to 'hang' if there is no working network connection

Start the emulation with

qemu-system-i386 -L . -hda msdos.disk -netdev user,id=mynet0 -device ne2k_isa,netdev=mynet0 

Afterwards a network can be installed in the Windows Setup with an NE2000 Compatible driver. Make sure the Windows CD image is mounted as the setup will try loading files from the CD.

Tags: ancient, msdos, howto

Button PreviousMusic: TheBlackzone - Alphatron

Installing MS-DOS in QEMUButton Next