Ubuntu 20.04 (64-Bit) DOSEMU Setup

Set up DOS Doors on Ubuntu 20.04 Mystic BBS for Linux

Running 16-Bit DOS doors on a 64-Bit version of Ubuntu 20.04 is possible, and I have it configured and working now with very few problems, but there were several roadblocks along the way. The Linux and BBS community is a great resource and the information is out there, but since Ubuntu 20.04 is fairly new there is not a lot of relevant information out there.

I am going to assume that you already have installed and updated your Ubuntu 20.04 LTS installation with all the most recent security patches. I am also going to assume that you have installed the most recent version of DOSEMU and FreeDOS. You can download it here if you still need it.

Configuration

I run the Mystic BBS system so my directions will be geared towards that package however the information contained in this how-to should be relevant to any BBS system with the exception that the doors may will be called differently within the BBS software. I will update this document with BBS specific information if somebody wants to send me information from other software.

mmap_min_addr

mmap_min_addr is a kernel tunable that specifies the minimum virtual addresses that a process is allowed to mmap. You can read more about this on the Debian Wiki Pages. You will need to execute the following command as root or DOSEMU will hang when calling Doors from your BBS:

# echo "vm.mmap_min_addr = 0" > /etc/sysctl.d/mmap_min_addr.conf
# /etc/init.d/procps restart

Configure DOSEMU

the dosemu configuration script can be found in /etc/dosemu/dosemu.conf and will need the following values to be set. I recommend leaving any additional values set at their default settings as they are not needed for most doors.

$_cpu = "80486"
$_cpu_emu = "vm86"
$_hogthreshold = (10)
$_external_char_set = "utf8"
$_internal_char_set = "cp437"
$_term_updfreq = (8)
$_layout = "us"
$_rawkeyboard = (0)
$_joy_device = ""
$_speaker = ""
$_sound = (off)

AUTOEXEC.BAT

DOSEMU looks for the AUTOEXEC.BAT file in the user directory of the user that the BBS runs under. For this reason, you should never run the BBS as root, as DOSEMU will be unable to access the ~root directories at run time and will generate errors. If you are running mystic I strongly recommend that you run the BBS in daemon mode. VSWITCHzero has excellent systemd Start/Stop scripts that can be configured to load Mystic at system boot along with relevant instructions. These scripts work flawlessly on Ubuntu 20.04.

Assuming that your BBS user account is “BBS” you will find your autoexec.bat script in the following location:

~bbs/.dosemu/drive_c/autoexec.bat

You can edit this file with your favorite text editor such as emacs, nano, or vi. You will need to use a fossil driver to open DOS doors which will mean you will need to download and install either X00 or BNU. FreeDOS comes with a fossil driver called “fossil” which is what I use in my example below. This seems to work well enough on my BBS.

@echo off
prompt $p$g
path=z:\bin;z:\dosemu
lredir d: linux\fs\bbs\
d:
cd \doors
fossil
share
unix -e

LORD / Door Setup

My path to Mystic BBS is /bbs/mystic/ and my doors are located at /bbs/doors. In the autoexec.bat file from above, you will notice that we have mapped the /bbs directory as the DOS D:\ drive. I have taken a screenshot of my LORD config screen from my BBS for you to use as an example. You will need to set up a new node config for each BBS node you want to run.

LORD 4.02m Node Configuration Screen

BBS Setup

At this point everything is ready to go, you are going to need to load into the menu editor for your BBS software. I use the default LORD batch file that comes with the game (edited with the correct paths) to load the game.

Mystic BBS Menu Option

Doors want to be loaded as (DD) Exec external program in Mystic with the Data value set as in the below example:

stty cols 80 rows 25 && dosemu -I"serial { com 1 virtual }" "/bbs/doors/LORD/START.BAT" %3 /DOS

In my example, as seen above the stty cols 80 rows 25 tells DOSEMU to set the screen to 80 columns by 25 rows. the -I”serial { com 1 virtual }” tells DOSEMU to create a virtual com port for communications which allows your callers to see the screen. The %3 is the node number which is used by the door to find the drop file. The /DOS tells mystic to create a DOOR.SYS file in DOS format.

DPMI Doors

This guide will get almost all BBS doors up and running with one notable exception, Tradewars 2002, which uses DPMI and will require further setup to get working correctly. Please visit my Tradewars 2002 Linux Config Guide for additional steps to get Tradewars (and other DPMI doors) running.