DOS(1)

NAME
dos - run MS-DOS and MS-DOS programs under Linux

SYNOPSIS
dos [ -ABCfckbVtspgxK ] [ -D flags ] [ -m SIZE ] [ -P FILE ] [ -H|F #disks ] 2> dosdbg

DESCRIPTION
dos invokes the Linux dos emulator, also known as dosemu.
dosdbg is the file into which all debugging output will be redirected.

Although this program is known as the DOS emulator, it is actually a virtual machine for MS-DOS, allowing DOS and programs written for DOS to operate in an environment similar to a standard IBM PC/AT or compatible with an Intel 80x86 processor in real mode. dosemu provides such services as BIOS video, disk, keyboard, and printer; CMOS memory for configuration information; a real time clock; extended memory allocation through the XMS specification, and most of EMS 4.0.

Because dosemu is not really an emulator, a copy of MS-DOS 3.3-6.2 is required. (Future versions of MS-DOS may run, but have of course not been verified. DR-DOS 6.0 has also been reported to work.)

See the files QuickStart, ChangeLog, doc/announce0.50, and the Makefile contained in the source distribution for information on how to configure, compile, and boot dosemu.

KERNEL PATCHES - WARNING!!
At present, you will need the 0.99pl14 or newer Linux kernel with Krishna Balasubramanian's ipcdelta patches compiled in. These patches add the System V InterProcess Communication facilities to Linux. Of these, dosemu currently only uses shared memory. Kernels from 0.99pl12 and above already have IPC in the Make config and libc.so.4.4.2 already include the IPC lib (don't use -lipc if you have a libc from this point on).

OPTIONS

-A  boot from floppy disk A (may not be a real floppy disk, see below)
-C  boot from hard disk C (may not be a real hard disk, see below)
-f  Flip the definitions for the A: and B: floppies
-c  use direct Console video (must be at the console, requires that dos is suid root)
-V  use VGA specific video optimizations
-k  use RAW console Keyboard (must be at the console)
-H  specify the number of Hard disks to be recognized
-F  specify the number of Floppy disks to be recognized
-D  specify which Debugging messages to allow/suppress
-x  enable XMS extended memory allocation
-m  set base memory to SIZE Kilobytes
-P  copy debugging output to FILE
-2,3,4
    choose 286, 386, or 486 processor (BE CAREFUL! dosemu is not yet 32-bit clean, so if your program detects a 386 or 486 processor and uses 32-bit registers, it might be confused by BIOS functions. If you think this is happening, use -2 to force dosemu into 286-mode.)

HARD DISKS
dosemu supports three methods of supplying DOS with hard disks:

1.  a virtual disk file residing on a Linux filesystem which emulates a hard drive

2.  direct access to an MS-DOS partition through a raw disk device (i.e. /dev/hda, /dev/hdb, /dev/sdX).

3.  access to a Linux filesystem as a "network" drive using the program LINUX.EXE supplied with dosemu on the hdimage virtual disk file.

This is explained more thoroughly in README.first.

Configuration of dosemu's hard disk resources is done by editing the Makefile and the source file disks.c before compiling dosemu.

FLOPPY DISKS
dosemu supports two methods of supplying DOS with floppy disks:

1.  a virtual disk file residing on a Linux filesystem which emulates a floppy drive

2.  direct access to a physical floppy through a raw disk device (i.e. /dev/fd0, /dev/fd1).

This is explained more thoroughly in README.first.

Configuration of dosemu's floppy disk resources is done by editing the Makefile before compiling dosemu.

VIDEO
dosemu may be run on any tty device. However, increased performance and functionality may be had by taking advantage of special features of the Linux console. Those running dosemu on the console may wish to investigate the -c, -k, and -V switches, explained more thoroughly in README.first.

In brief, proper use of the console device and the corresponding switches allows the user to view a DOS program in its original color and font, with none of the periodic screen update problems with the generic tty output code.

KEYBOARD
Those using dosemu on the Linux console may also wish to use the RAW keyboard support. This mode of operation, selected by the -k switch, provides the user with access to the entire keyboard accessible under DOS. Any combination of ALT, CTRL, and SHIFT keys may be used to generate the odd keycodes expected by many DOS programs.

PRINTING
The BIOS printer services are emulated through standard UNIX file I/O to a set of files, dosemulpt1, dosemulpt2, and dosemulpt3, corresponding to the DOS printer devices LPT1, LPT2, and LPT3. All characters sent to LPTx will be redirected to the file dosemulptx in the current directory.

WARNING! dosemu does not keep the file buffers flushed; therefore, the state of these files is undefined until you actually exit the DOS emulator. Please excuse the inconvenience.

DEBUGGING MESSAGES
You may specify which classes of messages you wish dos to allow. The syntax of this is Dosemu takes an option "-D FLAGS", where FLAGS is a string of letters which specify which options to print or suppress. Dosemu parses this string from left to right.
   + turns the following options on (initial state)
   - turns the following options off
   a turns all the options on/off, depending on flag
   0 turns all options off
   1 turns all options on
   # where # is a letter from the valid class list,
       turns that option off/on depending on the
       +/- state. Message Classes:
 d disk v video R disk Reads
 k keyboard i port I/O W disk Writes
 s serial p printer h hardware
 w warnings g general x XMS
 I IPC Any debugging classes following a + character, up to a - character, will be turned on (non-suppressed). Any after a - character, up to a + character, will be suppressed. The character a acts like a string of all possible debugging classes, so +a turns on all debugging messages, and -a turns off all debugging messages. The characters 0 and 1 are also special: 0 turns off all debugging messages, and 1 turns on all debugging messages. There is an assumed + at the beginning of the FLAGS string. Some classes, such as error, can not be turned off. You must tolerate these; you could always redirect stdout to /dev/null if you REALLY don't want them. Some examples:
  "-D+a-v" or "-D1-v" : all messages but video
  "-D+kd" : default + keyboard and disk
  "-D0+RW" : only disk READ and WRITE Any option letter can occur in any place. Even pointless combinations, such as -D01-a-1+0, will be parsed without error, so be careful. Some options are set by default, some are clear. This is subject to my whim, and will probably change between releases. You can ensure which are set by always explicitly specifying them.

SPECIAL KEYS
In RAW keyboard mode (see the -k option), dosemu responds to certain key sequences as control functions.

    ctrl-scrlock = show 0x32 int vectors
    alt-scrlock = show the vm86 registers
    rshift-scrlock = generate an int8 (timer)
    lshift-scrlock = generate an int9 (keyboard)
    ctrl-break = ctrl-break as under DOS.
    ctrl-alt-pgup = reboot DOS. Don't trust this!
    ctrl-alt-pgdn = exit the emulator

Also, realize that to generate ALT-function keys, you must depress the RIGHT ALT key together with the desired function key; the LEFT ALT key pressed together with a function key will change virtual consoles, as it normally does under Linux.

MEMORY
The XMS memory support in dosemu conforms to Lotus/Intel/Microsoft/AST extended memory specification 3.0. I have implemented all XMS functions except function 0x12 (Reallocate Upper Memory Block).

While I have implemented the UMB functions, they are extremely stupid and will almost always act suboptimally. The next release of dosemu should have saner UMB support.

dosemu 0.49 may or may not support EMS. This line has been placed into the man page to encourage the author to get off his *ss and do it.

AUTHOR
dosemu (comprised of the files dos and libemu ) is based on version 0.4 of the original program written by Matthias Lautner (no current address that I know of).

Robert Sanders <gt8134b@prism.gatech.edu> is still maintaining and enhancing the incarnation of dosemu with which this man page was distributed.

There is also an X-based version of Matthias Lautner's DOS emulator called xdosemu, adapted by Edward Der-Hua Liu. Xdosemu uses X-specific code to provide color and line-drawing characters, and can be found on the same site as dosemu.

BUGS
There are too many to count, much less list.
However, one hugely annoying bug is the inability of .EXE files to be run from the LINUX.EXE-created "network" or "phantom" drive. This means that the .EXE files must be run from disks accessed through hard disk methods 1 or 2 (see HARD DISKS above), or through floppy access.

Just to make things more difficult, I have noticed some bugs in the floppy code.

Please report bugs to the author. I'd also like to hear about which programs DO work. Just send me a note detailing what program (and what version) you are using, what works and what doesn't, etc.

AVAILABILITY
The most recent version of dosemu can be ftp'ed from tsx-11.mit.edu in the /pub/linux/ALPHA/dosemu directory.

FILES
/usr/bin/dos (the invoker program)
/lib/libemu (the actual emulator code as a shared library) QuickStart and ChangeLog distributed with dosemu.
the MSDOS mailing list: for more information, mail to
    linux-activists-request@niksula.hut.fi