Setting Up DOSemu
Setting up DOSemu is not hard, but it does require a few steps to get a fully functioning DOS session up and running.Because the software is being actively developed and improved, I strongly recommend that you get the latest versionavailable from the DOSemu Web site at http://www.dosemu.org.After downloading the RPMfile for DOSemu, issue this command while logged in as root:
rpm -i dosemu-0.98.6-1.i386.rpmConfiguring DOSemu
The package is now installed, but we need to tweak the DOSemu configuration file before using it. Edit the/etc/dosemu.conf file and modify the $_hdimage entry so that it reads as follows:
$_hdimage = "hdimage.test /dev/hda1"
The hdimage.test file resides in your/var/lib/dosemu directory and is a hard disk image--a special Linux filethat contains a complete DOS system. The line you just modifed tells DOSemu to treat thehdimage.test file as the C drivewhen DOSemu is started. This C drive is not your beloved DOS partition; it's a simulatedbootable hard-disk partition containing theFreeDOS operating system?a freeware clone ofMS-DOS. The /dev/hda1 portion of the modified line tells DOSemu to treatyour real DOS partition as the next drive letter, or the D drive. (You can boot DOSemudirectly from your real DOS partition, butwe'll address that later.)
Starting a DOSemu Session
Before starting a DOSemu session, which will be accessing /dev/hda1(your MS-DOS partition), it's very important to unmountthe partition. Otherwise, the DOS virtual machine and your Linux system might be tryingto write to the disk simultaneously, withpotentially disastrous results. To unmount the partition, issue this command:
umount /dev/hda1
Now we're ready to fire up DOSemu. Issue the command shown here fromyour Linux command prompt:
dos
In a few seconds, you should see a DOS session start, and the familiarC:> prompt will appear. Voila--you're running DOS underLinux! Issue the dir command and have a look at the results. Don't panicif the listing of files is unfamiliar. Remember--what youhave here is a special C drive with the FreeDOS files that DOSemu will use to boot up.
FreeDOS in a DOSemu session.
You can switch to your D drive (your DOS partition) by issuing the D:command and then change directories, view files, executeprograms, and so on. Because we booted from the C drive with FreeDOS, the config.sys andautoexec.bat files from your DOSpartition were not executed. This means that your normal DOS PATH variable will not be set,so you may have to use cd to get tothe appropriate directory before running a program.
Exiting from DOSemu
You can exit the DOSemu session by entering the following command at your C: prompt (notethat it won't work if you are at the D:prompt):
exitemu
If that doesn't work, or if your DOSemu session is frozen, log in from another virtual console and then use the ps and killcommands to find and terminate the DOSemu task. (See Chapter 3, "Living in a Shell," for details on killing an active task.)
The command "killall dosemu" will also work without having to do a ps.SmoogeIt's a good idea to copy the exitemu.com filefrom the C drive to the D drive so you can exit from DOSemu cleanly if you later decide to run DOSemu directly from your "real"DOS partition. To do so, enter this command from the C: prompt:
copy C:\exitemu D:\
Starting DOSemu with "Real" DOS
If any of your DOS programs don't run correctly as a result of finding themselves on a D drive instead of a C drive, you can start aDOSemu session by booting your "real" DOS partition. To do so, edit the /etc/dosemu.conf file and modify the$_hdimage entry so that it reads like this:
$_hdimage = "/dev/hda1"
This tells DOSemu to treat your DOS partition as the C drive and to boot the MS-DOS operating system instead of FreeDOS. Uponrestarting DOSemu, MS-DOS will try to start Windows 95/98, if you have it installed. This will surely lock up your machine,because DOSemu does not support Microsoft Windows. To avoid this problem, press the F8 key as soon as the message "StartingMS-DOS" appears and then select option 6, Command Prompt Only, to boot MS-DOS without starting Windows.
Additional DOSemu Configuration
By default, DOSemu starts with text-only video support and no support for serial ports. So if you want to run any graphics programsor use the mouse or modem, exit DOSemu and continue.
To enable support for graphics or the mouse or modem, edit the /etc/dosemu.conf file as described here. I recommend thatyou configure only the features you really need. Take these steps one at a time and test each new feature separately by startingDOSemu. That way, if a problem arises, you'll know which feature caused it, and you can go back to the /etc/dosemu.conffile and disable it or try an alternative.
Setting Up VGA Graphics
Look for the $_graphics and $_videoportaccess entries and change them to read as follows:
$_graphics = (1)
$_videoportaccess = (1)
Start DOSemu and test your graphics program. If it doesn't work, see the copious comments in the /etc/dosemu.conf file orat the DOSemu Web site for other things to try.
Setting Up Mouse Support
Look for the $_com1, $mouse, and $mouse_dev entries and change them as follows:
$_com1 = "/dev/mouse"
$_mouse = "microsoft"
$_mouse_dev = "/dev/mouse"
If your mouse is not on COM1, select the $comX entry corresponding to your mouse port. Set the $_mouse value accordingto the type of mouse you have. Most systems use a Microsoft mouse, but this value can be microsoft, mousesystems, logitech,mmseries, mouseman, hitachi, busmouse, or ps2. Start DOSemu and test your mouse application. Again, if you have problemsgetting the mouse to work, refer to the /etc/dosemu.conf file or the DOSemu Website?http://www.dosemu.org/.
Setting Up Modem Support
Look for the $_com2 entry and change it to read as follows:
$_com2 = "/dev/modem"
If your modem is not on COM2, select the $comX entry corresponding to your modem port. Start DOSemu and test your modemapplication.
Previous Lesson: Accesing DOS Partitions
Next Lesson: Updating Your Linux System
Comments - most recent first |
联系客服