What is DOSEMU ?

What is DOSEMU ?
DOSEMU is a PC Emulator application that allows Linux to run a DOS operating system in a virtual x86 machine. This allows you to run many DOS applications.
These are capabilities of DOSEMU worth noting:

Color text and full keyboard emulation (via hotkeys) via terminal
Built-in X-Windows support, includes IBM character set font!
Graphics capability at the console with most compatible video cards.
Much-improved DPMI support.
Runs Borland BCC.EXE / TCC.EXE version 3.x command line compilers!
Borlandc C++ 3.x IDE (with emumodule.o or kernel patch)
Runs several 32-bit DPMI-compilant video games, including DOS/4GW, at the Linux console. A partial list of successfully tested games includes DOOM2, Heretic, Descent, MK2, OMF2097, ROTT, and WarCraft!
Games run *MUCH* faster in dosemu due to improved timer emulation
NetBSD verison of DOSEMU under development, contact jtk@atria.com
CDROM support

---------------------------------------- ----------------------------------------

Where to get it ?
The DOSEMU PC Emulator (version 0.60.3) can be downloaded from the following FTP sites:
tsx-11.mit.edu:/pub/linux/ALPHA/dosemu/d osemu0.60.3.tgz
dspsun.eas.asu.edu:/pub/dosemu/dosemu0.6 0.3.tgz
sunsite.unc.edu:/pub/Linux/system/Emulat ors/dosemu0.60.3.tgz
I recommend this Linux WWW:
http://linux.ms.mff.cuni. cz/LINUX/Archive/Emulator s/dosemu/dosemu0.60.3.tgz

---------------------------------------- ----------------------------------------

Quick start
Instructions on how to quickly get DOSEMU up and running (see QuickStart file).
1. Kernel/GCC/libc requirements
Kernel:
- Linux version 1.1.43 or better is now required for running DOSEMU, version 1.2.2 is recommended.
- If you are running 1.1.59, you should upgrade to version 1.2.2. There are known disk access bugs through the mid 1.1.60's which are known to cause file corruption.
- The kernel must be compiled with System V IPC enabled.
GCC:
- At least GCC 2.5.8
Libc:
- At least 4.5.21
Swap:
- Plenty of swap, since DOSEMU requires between 12 and 25 megabytes of total memory to compile, depending on Makefile configuration.
Note:
Slackware 2.2.0 includes kernel 1.2.1, gcc 2.6.3, libc 4.6.27 - it's O.K.
2. Compiling and installing DOSEMU
If you want to use programs that require DPMI, e.g. BP 7.0, BC++ 3.1 or MS-Windows 3.1, read Preparing for DPMI in DOSEMU and MS-Windows part.
To build the library files:

Type 'make most' if you have not TeX. (I've done this even if I've got TeX.)
Type 'make doeverything' if you have TeX. (I cannot do it because of error with texinfo.)
If you were not logged on as root, you will see errors at the end. Log on as root and type 'make install'.
3. Configuring DOSEMU
While logged on as root, copy the file 'examples/config.dist' to '/etc/dosemu.conf' and edit it following the directions.
Create a file '/etc/dosemu.users' which contains a list of users who are privileged to use dosemu. The user "all" will allow anyone to run dosemu.
Copy './hdimage.dist' as '/var/lib/dosemu/hdimage'. The first disk statement in your '/etc/dosemu.conf' should point to this file.
4. Booting DOSEMU the first time
If you are new to DOSEMU:
Reboot DOS (the real version, not DOSEMU.) Put a newly formatted diskette in your a: drive. Run "sys a:" to transfer the system files to the diskette. Copy FDISK.EXE and SYS.COM from your DOS directory (usually C:\DOS) to the diskette.
Reboot Linux. Put diskette in and run 'dos -A'. After a short pause, the system should come up. Try "dir c:" which should list the files on the harddrive distribution image. If that works, run: "fdisk /mbr" and "sys c:". Exit dos by running "c:\exitemu". If you have problems, hold down the and buttons simultaneously while pressing . ( will automatically exit dosemu.)
If you already have a HDIMAGE file:
If you have a previous version of DOSEMU running, you should copy the .SYS, .COM, & .EXE files in the ./commands directory over to the hdimage drive that you boot from. Some of these files have changed.
5. Now that you've set up your HDIMAGE file
Notes:
After setting up your HDIMAGE file and exiting DOSEMU, run 'dos'. This time DOSEMU should boot from your HDIMAGE.
If hitting Alt-FunctionKey doesn't switch virtual consoles from DOSEMU, try using Ctrl-Alt-FunctionKey to switch from the virtual console running DOSEMU.
You can start setting up /etc/dosemu.conf more throughly.
You can set up DOSEMU to boot directly off your DOS hard disk partition.
If you want to use disk compression such as STACKER or DOUBLESPACE with DOSEMU, you will have to configure /etc/dosemu.conf for partition access.
From here you are on your own. Please read the documentation in the ./examples/config.dist file, the "DOSEMU-HOWTO" file, and the files in the ./doc subdirectory.
My advices:
The easiest way to boot is from diskette via 'dos -A'. You can make any changes in CONFIG.SYS and AUTOEXEC.BAT by any text editor.
After starting dosemu copy all files to boot-diskette. Copy DOS CONFIG.SYS and AUTOEXEC.BAT to diskette and edit them this way:
Delete memory manager's lines (QEMM, MAX, HIMEM, EMM386, cache, ...)
Comment out (REM) a mouse driver and other drivers
Comment out (REM) a SUBST command (because it doesn't work)
Run 'dos -A'. If all right set up internal mouse driver in dosemu.conf (I prefer internal to DOS driver). If you have 3-button mouse add emulate3buttons in mouse line in order to you can use the 3rd button.
Allow rawkeyboard in keyboard section.
Use emufs.sys to see any Linux subtree (also /dos). If you have DOS-partition mounted to /dos then next lines cause that C: is DOS-disk and D: is Linux-tree (where rights are like in linux console).
device=emufs.sys /dos
device=emufs.sys /
Replace SUBST with lredir command in AUTOEXEC.BAT.
This way you will find the best configuration and then create bdisk by 'dd' comand (read '/etc/dosemu.conf' carefully). Finally, append bootoff command to AUTOEXEC.BAT in order to you can use A: as diskette (Don't forget to save booton.com to available place for later changing AUTOEXEC.BAT or CONFIG.SYS).
If something's not right see section 6. Something's not right in QuickStart file.


---------------------------------------- ----------------------------------------

DOSEMU and X-windows
If you have X installed and you have successfully compiled dosemu and run it successfully outside X-windows, you should be able to run "xdos" or "dos -X" right away to bring up a dosemu window. Before the first xdos runing run xset fp rehash. If xdos does not work, make sure:
Dosemu has X support compiled in (X_SUPPORT=1 in the Makefile).
Installed the VGA font. You can do this by running the 'xinstallvgafont' script in the dosemu-0.60 source directory:
sh xinstallvgafont
Set up your X key-mappings. In an xterm, type
xmodmap -e "keycode 22 = 0xff08"
xmodmap -e "keycode 107 = 0xffff"
These lines fixes the backspace and delete keys respectively.
Configured the X-related configuration options in your /etc/dosemu.conf file.
If some keys or their combinations are not work properly check key mapping of your window manager.
You can run dosemu in console mode (via 'dos') while running X. Just remember to use ctrl-alt-<Fn> to go to a Virtual Console, and you can run any Linux application (dosemu is a linux-application).

Note:
Use ctrl-alt-F7 to switch back to X from dosemu.
For detail see ./doc/README.X and ./doc/DOSEMU-HOWTO files.


---------------------------------------- ----------------------------------------

DOSEMU and MS-Windows
Windows 3.0 Real Mode
DOSEMU has been able to run Windows 3.0 in Real Mode for some time now. If you really, really, really want to run Windows under DOSEMU, this is the tact to take for the moment.
Windows 3.1 Protected Mode
**************************************** ***********************
* WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!! *
* *
* Danger Will Robinson!!! This is not yet fully supported *
* and there are many known bugs! Large programs will almost *
* certainly NOT WORK!!! BE PREPARED FOR SYSTEM CRASHES IF *
* YOU TRY THIS!!! *
* *
* WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!! *
**************************************** ***********************

What, you're still reading?
Okay, it is possible to boot WINOS2 (the modified version of Windows 3.1 that OS/2 uses) under DOSEMU. Many kudos to Lutz & Dong!

There are many known problems. Windows is prone to crash, could take data with it, large programs will not load, the mouse may be painfully sluggish, etc. etc. etc. In other words, it is NOT ready for daily use. Many video cards are known to have problems (you may see a nice white screen.) Your program groups are all likely to disappear. Basically, it's a pain.

On the other hand, if you're dying to see the little Windows screen running under Linux and you have read this CAREFULLY and PROMISE NOT TO BOMBARD THE DOSEMU DEVELOPERS WITH "MS Word 6.0 doesn't run!!!" MESSAGES...


Preparing for DPMI
If you want to use programs that require DPMI, e.g. BP 7.0, BC++ 3.1 or MS-Windows 3.1, you have to patch your kernel and recompile it and compile dosemu with EMUMODULEs. You must be logged on as root.
cd /usr/src
patch < path_to_dosemu-0.60.3/dpmi/kernel.diff
cd linux
make zlilo # (it's for LILO, use proper command for your system)

And uncomment the toplevel Makefile around line 21 so that it sets
REQUIRES_EMUMODULE = -DREQUIRE_EMUMODLE

and set KERNEL_VERSION to proper string (eg. 1002001 for v. 1.2.1) then compile dosemu (via make most). I have already compiled dosemu and I must do 'make realclean' before recompile.
Don't forget load the emumodule using the included load_module.sh script before running dosemu. I call it in '/etc/rc.d/rc.local'. In my opinion it is the safest way to do NOT forget load the emumodule.


How run Windows 3.1
Prepare linux and dosemu for DPMI.
Get the WINOS2.ZIP distribution from tsx-11.mit.edu. I recommend a mirror of tsx-11 at
ftp.cvut.cz/pub/linux/tsx-11/
and there
ALPHA/dosemu/Development/DosStuff/os2win 31.zip (358K)
Unpack the WINOS2 files into your WINDOWS\SYSTEM directory. (Infact you only need WINDOWS/SYSTEM/os2k386.exe).
Startup dosemu (make certain that DPMI is set to a value such as 4096).
Copy the file ./dpmi/winemu.bat to your c: drive and edit it if you need.
Look through SYSTEM.INI and comment out:
OS2's lines if you have installed OS2 (I've got Warp).
Timer in [drivers] section.
change mouse.drv= line to mouse.drv from os2win31.zip package.
Cross your fingers.
Good luck!

REMEMBER: THIS IS NOT AT ALL RECOMMENDED!!! THIS IS NOT RECOMMENDED!!!
WE DO NOT RECOMMEND YOU TRY THIS!!!

For detail see ./doc/README.WIN and ./doc/DOSEMU-HOWTO files.


---------------------------------------- ----------------------------------------

Important notes
If you haven't used DOSEMU in several months (Especially if the last version you used was DOSEMU 0.52 or earlier), please go to great caution to read the "QuickStart" file included with DOSEMU since the location and format of files (including the configuration file) has changed since the DOSEMU 0.50pl1.
While DOSEMU may be more stable than many of the previous releases, it must be noted that it is still possible to crash the Linux video and keyboard, if you don't follow instructions properly. In this case, it becomes necessary to use a remote terminal or even the RESET button, to reboot the system.

The main risks of DOSEMU are the 'graphics' capability and 'rawkeyboard'. These can be disabled in the DOSEMU configuration file, to make DOSEMU become bullet-proof, at the cost of some convenience.



---------------------------------------- ----------------------------------------

Conslusion
I've compiled and installed DOSEMU v. 0.60.3. All users can run dos, even multi-times. Mouse works good in each dos session (via internal driver). Only root can run DPMI applications (error message: KERNEL: Unable to enter Protected Mode).
I set up X and DOSEMU for xdos. I have some problem with keyboard mapping (xmodmap) but xdos is nice.
I've patched and recompiled kernel. I've recompiled DOSEMU for DPMI support (with 'make realclean' before it) and installed os2k386.exe and mouse.drv. Root can run WINEMU but I have to have 2 SYSTEM.INI: SYSTEM.DOS for Windows in normal DOS and in Warp, and SYSTEM.LIN for dosemu. In my opinion WINEMU isn't suitable for normal work like in Windows in DOS.