DOS programs with dosemu¶
Installing DOS emulation¶
Install dosemu at a console, Accessories ‣ Terminal, with the commands:
sudo aptitude install dosemu xauth
sudo sysctl -w vm.mmap_min_addr=0
sudo bash < <(echo 'echo "vm.mmap_min_addr=0" >> /etc/sysctl.conf')
The DOS system can be started from Applications ‣ System Tools ‣ DOS emulator.
Note
xauth is required for remote X11 execution over ssh. Some versions of Ubuntu (8.04, for example) omit this package.
Configuring Dosemu¶
Change dosemu configuration with commands to edit either the global configuration file sudoedit /etc/dosemu/dosemu.conf or user file nano ~/.dosemurc.
Video settings¶
Emulate the DOS 640X480 EGA/VGA display with the command:
echo '$_X_font = vga12x30' >> ~/.dosemurc
The following command would change this setting globally for all users:
sudo sed -ie "/$_X_font/c\$_X_font = vga12x30" /etc/dosemu/dosemu.conf
Note
DOS video configurations include:
vga, vga8x19, vga11x19, vga10x24, vga12x30, vga-cp866, and vga10x20-cp866
.
Printing¶
In System Settings, check the queue names of installed printers. Then set devices lpt1, lpt2, and :guilabel:`lpt3 to use these printer queues with commands such as
echo '$_lpt1 = "lpr -l -P HP_LaserJet"' >> ~/.dosemurc
echo '$_lpt2 = "lpr -l -P HP_ColorJet"' >> ~/.dosemurc
or for global settings,
sudo sed -ie "/$_lpt1/c\$_lpt1 = 'lpr -l -P HP_LaserJet'" /etc/dosemu/dosemu.conf
sudo sed -ie "/$_lpt2/c\$_lpt2 = 'lpr -l -P HP_ColorJet'" /etc/dosemu/dosemu.conf
where HP_LaserJet and HP_ColorJet are local queue names.
Performance¶
To make dosemu run faster for the current user, add a command:
echo '$_hogthreshold = (xx)' >> ~/.dosemurc
where xx is the percentage of CPU time to devote to dosemu, which defaults to 1 percent.
Managing Dosemu Sessions¶
To start an interactive DOSemu session, type dosemu at the console or select Applications ‣ System ‣ DOS emulator from the system menu.
Exit the command line of an interactive session by typing exitemu
or by pressing Control-Alt-PgDn
.
Keyboard Capture¶
Press <Shift-Ctrl-Alt-K>
to switch into and out of keygrab mode in
DOSEMU. The <Shift>
is required in KDE, optional in Gnome and maybe
other desktops.
DOS program sessions¶
A DOS program may be executed from the Linux command line by calling dosemu followed by the name of the DOS program (.bat, .exe, .com) to execute. When the called program exits in DOSemu, the DOSemu session will close.
Scripted DOSemu sessions¶
If other commands are required in the context of the DOS program, then a
shell script may perform the complete task. For example, suppose program
WARES would change shared file permissions from public to private when
executed by a user not in group __USERS__. Issuing a chmod
command after executing WARES would fix permissions. A script wares.sh
for this purpose could be created with command nano ~/wares.sh:
dosemu C:\WARES.BAT
sudo chmod -R 777 /home/samba/shares/wares/*
Make the shell script executable with command chmod +x ~/wares.sh. Finally, run the DOS session by typing ~/wares.sh at the console.