Using Linux and DOS Together

Installing Linux on a machine for the first time is often a painful experience. There are a number of useful programs and techniques for running Linux on machines which run both DOS and Linux, some of which appeared in DOS 5. Understanding and using these techniques makes it possible to use them under DOSEMU whenever relevant.
Booting from the Installed DOS System and Win95

Extending the above scenario further, we can actually boot from a DOS hard disk using

disk { wholedisk "/dev/hda" readonly }

This has a number of advantages—primarily the virtual hard disk does not have to be created and maintained (note the virtual hard disk is only readable within DOSEMU, making maintenance cumbersome). DOSEMU allows you to select the extension for the system files (config.sys and autoexec.bat) either in the configuration file (using EmuSys or EmuBat) or from the environment (using AUTOEXEC and CONFIG). This boot disk isn't writable, so switch to a writable C: drive with lredir.

I typically have a config.sys file for DOSEMU called config.emu. In it I just change the C: drive (from the virtual hard disk) to a ~/dos directory, and have an autoexec.bat file there. I also have links to commonly used DOS programs (i.e.

Win95 throws some curves into this scheme. I've been using Win95 since the official release and am favorably impressed with it (anything could improve on Windows 3.1 problems). Win95 uses the file MSDOS.SYS to control the boot process as another ASCII configuration file. In order to activate a config.sys menu to either boot DOS or Linux, the following works in MSDOS.SYS:


In this case, after you run Linux, booting DOSEMU will allow you to run DOS Version 7.

You can also run an older DOS (if this was an upgrade) if you press F4 when it starts booting. But in this case, if you boot Linux and then start up DOSEMU off the DOS hard disk, the boot loader gets hopelessly confused, since it shuffles files like msdos.sys, config.sys, and autoexec.bat between Win95 and an older DOS system, putting the appropriate file in the appropriate place for the appropriate DOS (Win95 config files end in .w40, and older DOS files end in .dos). Obviously, you aren't expected to run DOSEMU under Linux!


I use DOS occasionally, but do a lot of work in MS-DOS since I'm working on DOSEMU and an alpha djgpp. I have found that you can do very flexible things with your partitions through extended partitions, and that Linux treats DOS filesystems quite nicely (especially UMSDOS).

I've found cross-development of MS-DOS applications to be ideal for DOS software development, you can write portable software and try it on Linux—then use Linux compilers to generate .EXE djgpp files and run the djgpp binaries in DOSEMU.

Marty Leisner ( is a professional programmer for Xerox Corporation who was first exposed to Unix on a PDP 11 running V7.


White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState