Skip to content

External DOS Emulators

This page covers running classic DOS door games using external emulators — DOSEMU and QEMU — via the abracadabra module. ENiGMA½ launches the emulator as a child process and bridges I/O over stdio or a socket.


DOSEMU provides a DOS environment on Linux via stdio. Configure COM1 as a virtual serial port to connect it to ENiGMA½’s stdio bridge.

$_cpu = "80486"
$_cpu_emu = "vm86"
$_external_char_set = "utf8"
$_internal_char_set = "cp437"
$_term_updfreq = (8)
$_layout = "us"
$_rawkeyboard = (0)
$_com1 = "virtual"

$_com1 = "virtual" maps COM1 to stdio — ENiGMA½ speaks directly to the door over stdin/stdout.

Create a virtual drive for your door, e.g. /home/enigma/DOS/X/PW, and map it in your DOSEMU AUTOEXEC.BAT:

Terminal window
@echo off
path d:\bin;d:\gnu;d:\dosemu
set TEMP=c:\tmp
prompt $P$G
C:\BNU\BNU.COM /L0:57600,8N1 /F
lredir.com x: linux\fs\home\enigma\DOS\X
unix -e

BNU is a FOSSIL driver installed here at C:\BNU\. A FOSSIL driver is required by most classic DOS doors.

doorPimpWars: {
desc: Playing PimpWars
module: abracadabra
config: {
name: PimpWars
dropFileType: DORINFO
cmd: /usr/bin/dosemu
args: [
"-quiet",
"-f",
"/path/to/dosemu.conf",
"X:\\PW\\START.BAT {dropFile} {node}"
]
nodeMax: 1
tooManyArt: DOORMANY
io: stdio
}
}

QEMU provides a robust, cross-platform solution for DOS doors. The general approach is a bootstrap shell script that prepares a node-specific GO.BAT, then launches QEMU with the FreeDOS image.

Follow the QEMU/FreeDOS guide to create a freedos_c.img. Install FreeDOS, then install your door game at C:\DOORS\LORD\ (or similar).

Transfer files from host to the image using QEMU’s vfat drive:

Terminal window
qemu-system-i386 -localtime /home/enigma/dos/images/freedos_c.img \
-hdb fat:/path/to/files/to/copy

Files appear on D: inside FreeDOS. Add to the image’s AUTOEXEC.BAT:

Terminal window
CALL E:\GO.BAT

This script writes a per-node GO.BAT before launching QEMU:

#!/bin/bash
NODE=$1
DROPFILE=D:\\$2
SRVPORT=$3
mkdir -p /home/enigma/dos/go/node$NODE
cat > /home/enigma/dos/go/node$NODE/GO.BAT <<EOF
C:
CD \FOSSIL\BNU
BNU.COM
CD \DOORS\LORD
COPY /Y $DROPFILE
CALL START.BAT $NODE
FDAPM POWEROFF
EOF
unix2dos /home/enigma/dos/go/node$NODE/GO.BAT
qemu-system-i386 -localtime /home/enigma/dos/images/freedos_c.img \
-chardev socket,port=$SRVPORT,nowait,host=localhost,id=s0 \
-device isa-serial,chardev=s0 \
-hdb fat:/home/enigma/drop/node$NODE \
-hdc fat:/home/enigma/dos/go/node$NODE \
-nographic
  • -chardev socket,... connects COM1 to ENiGMA½’s socket server on $SRVPORT
  • -hdb fat:... exposes the drop file directory as D:
  • -hdc fat:... exposes the GO.BAT directory as E:
  • -nographic runs headless
doorLORD: {
desc: Playing L.O.R.D.
module: abracadabra
config: {
name: LORD
dropFileType: DOOR
cmd: /home/enigma/dos/scripts/lord.sh
args: [
"{node}",
"{dropFile}",
"{srvPort}",
]
nodeMax: 1
tooManyArt: DOORMANY
io: socket
}
}

DOSBox-X is a graphical DOS environment available on Windows, macOS, and Linux. It is primarily useful for preparing disk images — raw .img images created in DOSBox-X are compatible with QEMU and with ENiGMA½’s built-in v86_door.

Using DOSBox-X as a production door server (launching it per user session) is possible but uncommon. The imgmount command can mount raw disk images inside DOSBox-X. See the DOSBox-X documentation for details.