Installation


apt-get install dosemu

Starting DOSEmu


> dosemu

Configuring

Configuration Files

DOSEmu will create a hidden folder under the home directory of the user.

~/.dosemu

In that folder you will find 

root@ubuntu-linux:~/.dosemu# ls -l
total 36
-rw-r--r-- 1 root root 18020 Apr 13 21:29 boot.log
-rw-r--r-- 1 root root   406 Apr 13 21:15 disclaimer
drwxr-xr-x 3 root root  4096 Apr 13 21:25 drive_c
drwxr-xr-x 2 root root  4096 Apr 13 21:21 drives
drwx------ 2 root root  4096 Apr 13 21:29 run


The boot.log is your logfile!

Mounting a Drive

You can mount a folder as a drive in dosemu but updating the autoexec.bat file and adding the following:

lredir g: linux\fs\media\psf\Home\dev\dosemu


vi ~/.dosemu/drive_c/autoexec.bat

@echo off^M
rem autoexec.bat for DOSEMU + FreeDOS^M
path z:\bin;z:\gnu;z:\dosemu^M
set HELPPATH=z:\help^M
set TEMP=c:\tmp^M
blaster^M
prompt $P$G^M
unix -s DOSDRIVE_D^M
if "%DOSDRIVE_D%" == "" goto nodrived^M
lredir del d: > nul^M
lredir d: linux\fs%DOSDRIVE_D%^M
:nodrived^M
rem uncomment to load another bitmap font^M
rem loadhi display con=(vga,437,2)^M
rem mode con codepage prepare=((850) z:\cpi\ega.cpx)^M
rem mode con codepage select 850^M
rem chcp 850^M
rem lredir e: linux\fs/media/cdrom c^M
lredir g: linux\fs\media\psf\Home\dev\dosemu^M
unix -s DOSEMU_VERSION^M
echo "Welcome to dosemu %DOSEMU_VERSION%!"^M
unix -e^M


Restricting a User

TODO: What does restricting a user mean?

> sudo vi /etc/dosemu/dosemu.users

Add a line: <user> restricted

Example:

test restricted

Enable Low Memory Access

In recent linux kernels, being able to map to low memory addresses was disabled due to security concerns; this breaks dosemu for a lot of things. You will need to add vm.mmap_min_addr=0 to your /etc/sysctl.conf (and reboot, or reload as root with sysctl -p) if you want to be able to to run certain programs (TW2002 is one such program that suffers from this). 

> sudo sysctl -w vm.mmap_min_addr=0

Debuging Errors

If we experience an error, we can look in dosemu's boot.log file. This file is located in ~/.dosemu.

Looking at the log file, you should pay special attention to all WARNING and ERROR log entries.


For Example, in the following log file you would notice the WARN entries:

DOSEMU-1.4.0.8 is coming up on Linux version 4.10.0-28-generic #32~16.04.2-Ubuntu SMP Thu Jul 20 10:19:48 UTC 2017 x86_64
Compiled with GCC version 4.9.2 -m64
WARN: vm86plus service not available in your kernel
WARN: using CPU emulation for vm86()
CONF: reserving 640Kb at 0x00000 for 'd' (Base DOS memory (first 640K))
CONF: reserving 48Kb at 0xF4000 for 'r' (Dosemu reserved area)
CONF: reserving 128Kb at 0xA0000 for 'v' (Video memory)
CONF: reserving 8256Kb at 0x100000 for 'x' (Extended memory (HMA+XMS))
Registering HWRAM, type=e base=0x419b3000 size=0x400000
CONF: reserving 4096Kb at 0x419B3000 for 'e' (VGAEMU LFB)
CONF: reserving 12Kb at 0xC0000 for 'V' (VGAEMU Video BIOS)
SERIAL $Id$
CONF: detected layout is "us"
CONF: detected alternate layout: auto
CONF: reserving 16Kb at 0xE4000 for 'E' (EMS page frame)
CONF: reserving 16Kb at 0xE8000 for 'E' (EMS page frame)
CONF: reserving 16Kb at 0xEC000 for 'E' (EMS page frame)
CONF: reserving 16Kb at 0xF0000 for 'E' (EMS page frame)
CONF: reserving 132Kb at 0xC3000 for 'U' (Upper Memory Block (UMB, XMS 3.0))
TIME: using 9154 usec for updating ALRM timer
======================= ENTER CPU-EMU ===============

*       Fault out of DOSEMU code, cs:eip=33:4a6724, cr2=11cf, fault_cnt=1
ERROR: EMU86: error 96
leavedos(e_vm86|1210) called - shutting down
======================= LEAVE CPU-EMU ===============


From this log file, we can see the following 2 warnings:

WARN: vm86plus service not available in your kernel
WARN: using CPU emulation for vm86()


Googling this warning results in the following conclusion:

Some Linux Distributions also disabled VM86 syscall in their kernel versions, so you need to build your own kernel that enables this important functionality.

https://github.com/leecher1337/ntvdmx64/issues/49

We will need to find a linux which has VM86 enabled in order to run this application.

Supported Kernels:

Debian 7 - Wheezy

Debian 8 - Jesse (Maybe)

Commands


CommandDescription Example
lredirMount a folder as a drive
lredir d: linux\fs\${home}


Installing DOSEmu on Debian 7 - Wheezy

Details

Debian installation details:

InfoDetails
Installationhttps://www.debian.org/releases/wheezy/debian-installer/
Package Manager URL
archive.debian.org

Update Package Manager Sources:

echo "deb http://archive.debian.org/debian/ wheezy main contrib" > /etc/apt/sources.list
echo "deb-src http://archive.debian.org/debian/ wheezy main contrib" >> /etc/apt/sources.list


Installing DOSEmu

wget http://ftp.us.debian.org/debian/pool/contrib/d/dosemu/dosemu_1.4.0.7+20130105+b028d3f-1_i386.deb
sudo dpkg -i dosemu_1.4.0.7+20130105+b028d3f-1_i386.deb




References

  • No labels