Wikia

How To Wiki

How to install FreeDOS in QEMU

Talk0
1,842pages on
this wiki

By using the QEMU emulator, you can run FreeDOS inside a window on a host operating system. QEMU will emulate a typical x86 PC so that FreeDOS can run. FreeDOS is mostly compatible with MS-DOS, so you will be able to use FreeDOS and QEMU to run some old MS-DOS programs. You could even put FreeDOS and QEMU on your Apple Macintosh.

This howto will guide you through the process of installing FreeDOS within QEMU.

Preconditions Edit

  • Your computer can run QEMU.
    • There are ports of QEMU to both Microsoft Windows and Mac OS X.
    • You can also run QEMU on Unix (including BSD and Linux) but only if QEMU supports your processor architecture. QEMU can run on x86, x86_64 (also known as AMD64), and PowerPC machines, and possibly others; check the status page.
  • You have installed QEMU.
  • You know how to use the command line (or if you have it, a QEMU graphical user interface) on your computer.

Download FreeDOS Edit

First obtain a copy of FreeDOS.

  1. Visit http://www.freedos.org/freedos/files/
  2. Follow the instructions and download fdbootcd.iso
    • Make sure to obtain the newest version (as of this writing, Beta9 Service Release 2).
  1. Put fdbootcd.iso in an empty folder with plenty of disk space. You do not need to burn it to CD!

What a pleasure to find soeomne who thinks through the issues What a pleasure to find soeomne who thinks through the issues

Boot from CD, run FDISK Edit

Now use QEMU to boot the CD for installing FreeDOS onto drive C. (We ignore our drive A for now.)

$ qemu -hda c.hd -cdrom fdbootcd.iso -boot d

QEMU FreeDOS 1

Just press ENTER or choose option 1 to start booting the CD.

QEMU FreeDOS 2

Just press ENTER or choose option 1 (again) to pick the "Load XMSdriver" option and continue booting.

QEMU FreeDOS 3

Now our new "c.hd" has no data on it, so FreeDOS correctly suspects that you need to format the disk. Choose option 1 to start FDISK. (You must use FDISK to create a partition for drive C before you can create a filesystem.)

Do you want to use large disk (FAT32) support (Y/N).[Y]?

The default option of "Y" is okay here.

QEMU FreeDOS 4

Choose option 1 to create a partition.

QEMU FreeDOS 5

Choose option 1 for the "Primary DOS Partition". (FDISK supports up to four primary partitions. If you want more, then you would create three primary partitions and one extended partition, then add logical drives to the extended partition.)

QEMU FreeDOS 6

The easiest thing to do now is to say "Y" to make one large partition. (The partition that you install FreeDOS onto must be active so that it boots.)

QEMU FreeDOS 7

Now that your disk has a partition for drive C, press Escape twice to exit FDISK. The system will reboot.

Boot from CD, run SETUP Edit

As before, choose option 1 (twice) to boot FreeDOS Setup and Load XMSDriver.

QEMU FreeDOS 8

Now that drive C has a partition, you must still format the disk, which creates a FAT filesystem on it. Answer YES.

At this point, FreeDOS formats drive C. (One can put files in C:\ now.) The installer now begins. If you choose option 0 or wait 5 seconds, the installer will proceed to install FreeDOS from the CD.

QEMU FreeDOS 9

From the menu, choose option 1 to "Configure FreeDOS installation settings".

QEMU FreeDOS 10

Then choose option 1, "Start installation of FreeDOS beta9". (Optionally, you could adjust the other settings.)

QEMU FreeDOS 11

Eventually you will reach the "DETAILED INSTALLATION INSTRUCTIONS". They are outdated. You can ignore them. Just press Escape.

QEMU FreeDOS 12

For the install location, enter C:\FDOS so that the screen looks like this:

QEMU FreeDOS 13

Now allow the FreeDOS installer to proceed. If it stops at an error like the following:

QEMU FreeDOS 14

Just say "Yes" to continue installing. This error involving MODE.COM does not prevent your FreeDOS install from working.

Allow the installation and the post-installation steps to finish.

Boot the hard disk Edit

After the installation, the installer will reboot your computer. However, in this QEMU configuration, any attempt to boot the hard disk will stop at the following screen:

QEMU FreeDOS 15

This is a unique problem caused by running FreeDOS in an emulator instead of a hard disk. The FreeDOS kernel sees that there are no disks before C and moves drive C to drive A. (The FreeDOS installer uses drive A for something else, which is why you had to install onto drive C.) Then it stupidly fails to find the system on drive C; the Command Interpreter is at A:\COMMAND.COM now.

The best way to fix this is to close QEMU. Now start QEMU again, but this time put the disk image a.fd into drive A while leaving out the CD:

$ qemu -fda a.fd -hda c.hd

Unfortunately, now if you boot the system, AUTOEXEC.BAT might crash the QEMU emulator on a MODE command.

Fixing AUTOEXEC.BAT Edit

You can bypass AUTOEXEC.BAT by choosing "3 - Load FreeDOS without drivers" from the boot menu. If necessary, close QEMU and restart it again (with qemu -fda a.fd -hda c.hd), then choose option 3 when booting. You will reach the FreeDOS shell:

C:\>

Since it loaded no drivers, you might as well load the mouse driver. QEMU emulates a PS/2 mouse. To load the driver:

C:\>mouse

CuteMouse v1.9.1 alpha 1 [FreeDOS]
Installed at PS/2 port

Now edit the C:\AUTOEXEC.BAT file. (DOS is case insensitive and the current directory is already C:\ so autoexec.bat is the same file.)

C:\>edit autoexec.bat

This opens the editor. (You might notice that the clock in the lower-right is running in UTC time.)

QEMU FreeDOS 16

Scroll down to "MODE CON..." line and comment it by prepending "REM ", like this:

QEMU FreeDOS 17

Now save the file and exit the editor. (You should be able to use the mouse with the File menu; you may need to first click the window for QEMU to grab the mouse and move the DOS mouse cursor.)

C:\>

Back at the prompt, you can safely close your QEMU window. (This is the equivalent of flipping the power switch on a real DOS computer. DOS does not require you to sync the disks, unmount the filesystems, or use a command to halt the system.) Use qemu -fda a.fd -hda c.hd again to restart the system.

If option 1 "with maximum RAM free, using EMM386" does not work, you should now be able to boot FreeDOS with option 2 "including HIMEM XMS-memory driver". Using option 1 or 2 will automatically load all of the normal drivers, including the mouse driver.

Booting your system for normal use Edit

To boot your installed FreeDOS system for normal use:

cd to the directory with a.fd and c.hd
$ qemu -fda a.fd -hda c.hd
choose option 2, "including HIMEM XMS-memory driver"

Links Edit

From time to time, you might want to copy files between FreeDOS and the host system. To do this, you might want to mount a raw disk image:

From HowTo Wiki, a Wikia wiki.

Around Wikia's network

Random Wiki