Dosbian-X 2.0: Turn your Raspberry Pi into a 486DX emulator

0.00 avg. rating (0% score) - 0 votes

I came across Dosbian-X 2.0, an interesting customized version of Debian 12 that boots straight into DOSbox, one of my favorite MS-DOS emulators, and decided to give it a try. It has been such a long time since I last played with Turbo Pascal or Prince of Persia, even though I have DOSBox-X installed on my Windows 11 laptop, and I just want to experience the nostalgic feeling of playing my favorite childhood DOS games once again.

After modifying /boot/config.txt to enable composite output and with the proper composite cable (noting that the Raspberry PI uses a non-standard pinout on its AV port which does not work with many generic RCA to 3.5mm cables), I was able to play Prince of Persia 2 nicely on my Toshiba MV9DM2 Portable 9″ color television:

IMG_0427

As with many US-made CRT TVs, this TV supports NTSC and 110V only, although it also accepts 12VDC. PAL is not supported, whether via RF or composite, and will result in a scrolling image if used. Most CRT TVs made in Singapore, even very early models, are able to accept 110V-220V, and both PAL/NTSC through the composite port. My MV9DM2 was purchased for a mere $5 from a local flea market and still works well after all these years. The VCR (both playback & recording) still works, despite only supporting NTSC (and not PAL).

During bootup, I noticed that Dosbian has an interesting splash screen image which gives the user a feeling of booting into a 486DX:
splash

Because package plymouth which is responsible for displaying Debian splash screens is not installed on Dosbian, I decided to find out which other component might be responsible. First step is to locate where the image might be:

sudo find / -type f -name "splash*" 2>/dev/null

which quickly returns the correct image at /usr/local/bin/splash.jpg. To find out which component might be using this image, I performed another search:

sudo grep -R "splash*" /etc /boot /usr/local/bin /usr/share 2>/dev/null

which reveals that service /etc/systemd/system/dosbian-splashscreen.service is responsible for displaying the splash screen. This service calls /usr/bin/boot_sequence which then calls /usr/bin/fbi -noverbose /usr/local/bin/splash.jpg to display the splash image. The resolution of splash.jpg that comes with Dosbian is too high and I have to reduce it to fit my composite output, which is only approximately 720×480 for NTSC.

DOSBox configuration files are located at /home/dosbian/.dosbox/ which sets /home/dosbian/dosbox/ as the root directory for DOS application, which will be automatically mounted when DOSBox starts, in framebuffer mode without a window manager. To copy files to this directory easily without having to swap the SD card, we will need to enable the networking service and install the SSH service. For some reasons, these services are disabled on Dosbian.

sudo service networking enable
sudo apt update
sudo apt install openssh-server

To be able to use Wifi in addition to LAN, you will need to enable wpa-supplicant (via raspi-config), and configure the necessary wireless passwords. DOS games and applications can then be conveniently copied to Dosbian using WinSCP.

In order to poweroff Dosbian from the DOS command line without having to exit to Debian first, I create /home/dosbian/dosbox/poweroff.bat which creates a c:\poweroff.txt file and exits DOSBox:

@ECHO OFF

ECHO Poweroff > C:\poweroff.txt
EXIT

Because DOSBox is started from /usr/local/bin/bootmachine which is started started when the bash terminal opens, we edit /home/dosbian/.profile to look for the existence of POWEROFF.TXT (noting that DOSBox creates files in uppercase), and powers off the system if this file exists. This is the code change that I made, which also displays the current IP and handles the reboot command:

# Wait a bit to retrieve current IP via Wifi, DOSBox will show when launched
sleep 15
ip -4 addr show | grep inet | grep -v '127.0.0.1' > /home/dosbian/dosbox/ipconfig.txt 2>&1

# Start DOSBox
clear
/usr/local/bin/bootmachine

# Script executed within DOSBox will create this file
# telling host to perform actions. Note that DOSBox creates file in uppercase
PWRFILE="/home/dosbian/dosbox/POWEROFF.TXT"
if [ -e "$PWRFILE" ]; then
rm "$PWRFILE"
sudo poweroff
exit 0
fi
REBOOTFILE="/home/dosbian/dosbox/REBOOT.TXT"
if [ -e "$REBOOTFILE" ]; then
rm "$REBOOTFILE"
sudo reboot
exit 0
fi

With these modifications, my Dosbian is now working well enough to be my retro DOS gaming machine. However, due to the customization efforts needed, I therefore only recommend Dosbian for those who also love to play around with Debian and Linux commands besides MS-DOS. For a seamless retro experience, a dedicated emulator like RetroPie, or perhaps OpenEmu, with a better user interface and far more customization options, is still a much better choice.

0.00 avg. rating (0% score) - 0 votes
ToughDev

ToughDev

A tough developer who likes to work on just about anything, from software development to electronics, and share his knowledge with the rest of the world.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>