Raspberry Pi · rpix86

Run DOS on the Raspberry Pi – Use rpix86 to turn your Pi into a 1980s super-computer.


This tutorial is not intended for absolute beginners. It requires the use of the Raspian terminal commands which is text-based, so expect some Linux skills.

Please feel free to jump straight to the ‘DOS on the Pi‘ if you have no interest in a computer history lesson.

What is DOS?

DOS was a semi-open standard that included a standard operating system for desktop computers in the 1980s and early 1990s. The hardware used Intel x86-compatible CPUs while the operating system for this architecture was DOS the Disk Operating System. Note that the DOS acronym also describes some incompatible and unrelated computer systems such the Apple DOS and Atari DOS.

As DOS was a primitive, text only operating system that was easy to reverse-engineer. Some companies made their editions of DOS and for the most part, they were all compatible with each other. The most common x86-edition of DOS was Microsoft‘s MS-DOS but IBM also had their PC-DOS as did Digital Research with DR-DOS.

MS-DOS was Microsoft’s precursor to its Windows operating system. In the 1990s many editions of Windows were simply a layer of software designed to load up after MS-DOS or later contained MS-DOS built-in.

Off the shelf x86-compatible hardware combined with the DOS operating system became the prominent computer gaming system in North America from the late 1980s until Windows 95. Other regions such as Europe preferred cheaper, propriety systems such as the 8-bit Commodore 64, Amstrad CPC, Sinclair Spectrum. Or the equally as expensive but more user-friendly 16-bit Atari ST and Commodore Amiga lines. In these parts of the world x86-compatible computers only became popular after the early 1990s.

How did DOS come to be?

DOS started out as a clone of the early microcomputer operating system CP/M by Digital Research. CP/M was created in 1973 to run on the Intel Intellec-8 development system which happens to be the first microcomputer sold in the USA.

By the end of the 1970’s CP/M was the most popular microcomputer operating system for professionals and business. Once IBM decided to enter this burgeoning market, they wanted to use CP/M on their future products, but they couldn’t come to an amicable agreement with Digital Research.

So IBM asked Microsoft to develop a clone of CP/M for their first microcomputer that they dubbed the Personal Computer or the PC. But at this early stage of its life, Microsoft had never developed an operating system but bluffed IBM to believe otherwise.

Microsoft discovered a small software company known as Seattle Computer Products who had an x86-compatible CP/M clone called 86-DOS. Microsoft signed a non-exclusive contract to market and distribute this operating system and on-sold it to IBM. Just weeks before IBM’s major PC public announcement Microsoft obtained near-exclusive rights for Seattle’s 86-DOS.

In August of 1981, IBM launched the IBM PC. A machine that brought mainstream attention to microcomputers and made them respectable in the eyes of the public. Every IBM PC sold was operating off a royalty-free copy of Seattle Computer Products 86-DOS operating system re-branded as PC-DOS.

IBM had always been a hardware company and believed there was little money in software. Apple to this day follows that same ethos. What IBM failed to realise was they had designed their machine with off the shelf parts that anyone could buy. The only thing other manufactures lacked to create their PCs was the operating system. But due to IBM’s non-exclusive operating system agreement. Microsoft was free to re-brand their version of IBM’s PC-DOS and to sell it to potential companies who wanted to make copycat IBM PCs. That small mistake by IBM launched Microsoft, who became one of the world’s largest companies.

Why DOS?

Many popular franchises, genres and software companies were first launched or popularised on DOS. Warcraft, Grand Theft Auto, Sid Meier’s Civilization, Monkey Island, X-Com, Need for Speed. The first person shooter, the graphic adventure, simulators, real-time strategy are some examples. So DOS would be well worth investigating for anyone who has an interest in retro-gaming from this era.

Why not DOS?

The DOS ecosystem has to be the most complicated and arcane mainstream gaming system of all time. The same openness that made it famous was also what made it so horrible to use.

Backwards compatibility was a significant benefit and selling point of the DOS ecosystem. But at the same time, it held it back and made it much more complicated than necessary. By the late 1980s, its text-based 1970s lineage was primitive and outdated.

Hardware support was complex. Often users had to manually change and configure their operating system for each item of software they ran. What unfortunately started off as a clean and straightforward for IBM in 1981, evolved into an unintended ad hoc open platform.

Worse was hardware driver support. For the most part, the new hardware had to be directly supported by software. It meant that a user’s existing game collection would often not support new equipment because it didn’t exist when the software was composed.

Finally, many game developers targeted the lowest common denominator hardware. It meant you could have had the latest and most expensive hardware that was underutilised or ignored by new release software.

Fortunately, much of this hardware complexity is now avoided when using software emulation such as rpix86 on the Raspberry Pi.

Snooper Troops supporting IBM’s Color Graphics Adapter  in 1982.
1984’s Troll’s Tale on IBM’s PCJr.
IBM’s Enhanced Graphics Adapter in use in 1986’s King’s Quest III.
IBM’s Multicolor Graphics Array in 1987 allowed photo like graphics in Moebius: The Orb of Celestial Harmony.
King’s Quest V from 1990 was one of the first titles to fully embrace IBM’s Video Graphics Array with upto 256 colours on-screen.
By 1992 some games such as Links 386 Pro had embraced hi-resolution Super VGA graphics.

DOS today?

DOS is still in use on embedded systems that need a small and straightforward, text-only operating system. Today most of the DOS community centres around the open source FreeDOS that offers modern tools as well as legacy compatibility.

DOS on the Pi.

At the time of writing in April 2013, the only acceptable DOS emulator for the Raspberry Pi is rpix86 by Patrick Aalto found at http://rpix86.patrickaalto.com.

What PC hardware does rpix86 emulate?

CPU: 80486 processor, including the protected mode features (for running DOS4GW games) but without virtual memory support. The emulation runs at a speed of around 20MHz 80486 (which equals a 40MHz 80386) machine.
Memory: 640KB of low memory, 4MB of EMS memory and 16MB of XMS memory.
Super-VGA graphics, with a maximum resolution of 640×480 with 256 colors.
SoundBlaster 2.0 (including AdLib-compatible FM sounds) sound card.

This combined hardware could have belonged to a costly high-end PC in the very late 1980s. Or a more affordable and ordinary mid-range PC in the early 1990s. In that later era, the audio would have been the machine’s weakest point. The graphics and memory would have been very good while the CPU would have been average.

My article DOSBox Sound Emulation talks about the vast variety of audio options on the x86-compatible platform while DOSBox Graphic and Machine Emulation cover the array of graphics modes.

What operating systems does rpix86 support?

Unfortunately only the obscure 4DOS is supported by rpix86. 4DOS is a rather full-featured and complex edition of DOS created by a small company out of Germany. While it was great for daily users of DOS-based PCs back in the 1990s, it is overkill for our purposes of PC gaming emulation on the Pi.

4DOS downloads http://www.4dos.info/v4dos.htm

Raspberry Pi set up.

This guide assumes that a clean install of Raspbian is in use on the Raspberry Pi.

You can obtain Raspbian from http://www.raspberrypi.org/downloads
A guide for installing Raspbian to an SD card for use with the Raspberry Pi is at http://elinux.org/RPi_Easy_SD_Card_Setup

raspi-config
raspi-config.

Start your Raspberry Pi with a new install of Raspbian and at the Raspbian Raspi-config configuration tool do the following.

First select update to make sure you’re using the latest version of the configuration tool.
Select expand_rootfs, so the free space on the SD card is fully utilised.
Select change_timeszone to set your Pi’s time zone.
Select boot_behaviour and set Should we boot straight to desktop? as No.
Select change_pass to change the default pi user password.
Select <Finish> to exit.

Now in the terminal if you ever need to return to Raspi-config.

sudo raspi-config

Now lets update Raspbian and any out-of-date software.

sudo apt-get upgrade -y

DOS set up.

We are going to use a directory called /dos located in our pi home directory /home/pi/ to store our rpix86 related files. For the commands shown below ~/ in Linux is treated a short-cut for the pi user home directory.

mkdir ~/dos
cd ~/dos

mkdir ~/dos
mkdir ~/dos

This /dos directory will also double up for a mock hard drive that rpix86 will use for DOS.

Download the latest version of rpix86 the DOS emulator.

wget http://rpix86.patrickaalto.com/rpix86.tar.gz

wget rpix86.tar.gz
wget rpix86.tar.gz

Now uncompress and run rpix86. Please note that rpix86 will not work over a remote terminal connection such as SSH or Telnet.

tar -xf rpix86.tar.gz
./rpix86

rpix86
rpix86 running under a remote terminal connection.

When prompted, press Y to download the required 4DOS.COM command interpreter.

rpix86 unable to find 4dos.com
rpix86 unable to find 4dos.com.

Once complete your Raspberry Pi should be running a DOS prompt.

rpix86 startup
rpix86 startup.

Basics of DOS shell.

At its core, a DOS shell is mostly a self-contained program that allows commands to be run from a text prompt. It lets you interact with your computer’s file system and some hardware. By communicating with the file system, you can launch programs; move, copy or delete files and modify the directories.

The rest of the DOS operating system comes in the form of extra programs, applications and hardware drivers that usually reside in a subdirectory. These additions can vary between different releases and iterations of DOS.

DOS command prompt explained.

C:\>

C: Is the active drive. In DOS each floppy, CD, DVD or hard drive is assigned its drive letter. The C: drive is usually reserved for the first hard drive while A: and B: are reserved for floppy drives.
\ Is the active directory. When a backlash is displayed, the active directory is at the root of the drive.
> Is the beginning of the text prompt.
_ Is a blinking prompt that shows where the user’s typed input will display.

Commands.

Please run the following commands in the DOS prompt. Note that unlike Linux, DOS  is not case sensitive.

List the current directory.

DIR

Display some basic 4DOS information.

4DOS

Clear the screen.

CLS

Make a new directory named TEST.

MKDIR TEST

Copy the file 4DOS.COM to the TEST directory.

COPY 4DOS.COM TEST

List the content of the TEST directory.

DIR TEST

Change the active directory to TEST.

CD TEST

Delete the file 4DOS.COM

DEL 4DOS.COM

Change the active directory to root.

CD\

Remove the directory TEST.

RMDIR TEST

You can use the [Tab] key to auto-complete the names of files and directories that exist in the active directory.

4d [Tab]

You can cycle through previous commands typed at prompt by using the up and down arrow keys.

Quit rpix86.

EXIT

DOS commands.
DOS commands.

Dumb DOS names.

DOS uses the FAT file system. The legacy FAT16 file system was first introduced into MS-DOS 4.0 and applied through the late 1980s and early 1990s. It is dated but can still be read by modern operating systems.

Because of its age FAT and DOS has some particular but essential to know traits.

  • In DOS file and directory names can be at most 8 characters long. An additional identifier extension can be given but that can only be up to 4 characters, and the first character must always be a period.
  • File usage is identified by extensions, many of which are still in use today. FILE.TXT is a plain text document. FILE.MP3 is an MP3 audio track. FILE.AVI is a video file. FILE.HTM is a HTML document. DOS script files use the .BAT (batch processing) file extension. Program files use .EXE (execute) or the .COM (command) file extensions.
  • Files and directories are case insensitive.
  • The backlash \ character is used to separate directory and file paths.

Fetch and use DOS software.

For the purposes of this article I will only use games sourced from the excellent DOS Game Archive. It only offers DOS software that is legal to distribute and use without payment.

Under the Copyright laws of many countries, copyright on software remains active until 50 or 70 years after an author’s death. It is designed to protect any potential long-term income and the resale value of a product.

The majority of dated, commercial computer software has no financial value and is usually long out of print. It is more apparent with software created for obsolete systems such as DOS. Copyright of this type is rarely defended by its owners and is unofficially known as abandonware.

While the act the downloading and use of abandonware is classed as piracy and is officially illegal. I do not see any serious legal or moral issues with downloading and using out of print, old commercial software. But you should use your judgement.

Where to get games?

You can find legal to download DOS shareware, freeware and public domain games at the DOS Game Archive http://www.dosgamesarchive.com.

To find abandoned but technically illegal to download DOS software, type DOS abandonware into Google and go from there.

DOS Demo 1 – LucasArts, Day of the Tentacle Demo

The surreal and funny Day of the Tentacle was a massive success for LucasArts in 1993. This non-interactive demonstration is easy to run and shows the old DOS low-resolution VGA graphics and SoundBlaster audio hardware at its best.

At the Raspbian Linux terminal prompt create the directory DOTTDEMO.

mkdir ~/dos/DOTTDEMO

Change the active directory to DOTTDEMO.

cd ~/dos/DOTTDEMO

Use wget to download the Day of the Tentacle demo from DOS Game Archive.

wget ftp://download.dosgamesarchive.com/tentacle.zip

wget http://image.dosgamesarchive.com/games/tentacle.zip

Uncompress the demo file using unzip.

unzip tentacle.zip

Return to the /dos directory and run rpix86.

cd ..
./rpix86

Now in the rpix86 DOS prompt list the content of the DOS root to make sure the DOTTDEMO directory exists.

DIR

Change the active directory to DOTTDEMO.

CD DOTTDEMO

List the content of DOTTDEMO but only display items that use the extension .EXE which execute programs.

DIR *.EXE

Run the program DOTTDEMO.EXE.

DOTTDEMO.EXE

Congratulations, hopefully, you have a working Day of the Tentacle demo.

To exit the demo press [Alt] X and follow the prompt.

wget DOTT
wget tentacle.zip
DOS for DOTT
DOS for DOTT
DOTT DEMO
DOTTDEMO.EXE

DOS Demo 2 – Sierra Online, Space Quest 3.

From the early 1980s to the 1990s Sierra Online was all about pushing the envelopes of audio and visuals on the home computer. Space Quest 3 in early 1989 was certainly doing that on the PC. Unfortunately, but typical for the era, this demo requires a complicated set-up procedure.

At the Raspbian Linux terminal prompt create the directory SQ3DEMO.

mkdir ~/dos/SQ3DEMO

Change the active directory to SQ3DEMO.

cd ~/dos/SQ3DEMO

Use wget to download the Space Quest 3 demo from DOS Game Archive.

wget ftp://download.dosgamesarchive.com/spaceq3.zip

wget http://image.dosgamesarchive.com/games/spaceq3.zip

Uncompress the demo file using unzip.

unzip spaceq3.zip

Return back to the /dos directory and run rpix86.

cd ..
./rpix86

Now in the rpix86 DOS prompt list the content of the DOS root to make sure the SQ3DEMO directory exists.

DIR

Change the active directory to SQ3DEMO.

CD SQ3DEMO

List the content of SQ3DEMO but only display items that use the extension .EXE which are execute programs.

DIR *.EXE

Run the program INSTALL.EXE to tell the demo of Space Quest 3 what hardware our DOS machine supports.

INSTALL.EXE

In the Sierra Game Setup/Installation Program.

Press [Enter] at the Sierra’s newest products .. notification.

Select EGA/VGA with RGB monitor.

Select AdLib Music Synthesizer Card.

Select IBM or IBM-compatible keyboard.

Press [Enter] at the NUMLOCK is OFF confirmation.

Select NO for the MicroSoft compatible mouse.

Press [Esc] to skip the install the game on your hard disk.

Press [Enter] at the Installation is complete prompt.

Back at the DOS prompt list the content of SQ3DEMO but only display items that use the extension .BAT which are script files. Many older Sierra games used batch script files to launch their programs.

DIR *.BAT

Run the batch script SQ3DEMO.BAT to launch the Space Quest 3 demo.

SQ3DEMO.BAT

Welcome to Scenes From Space Quest III.

To exit press [Esc] to bring up the in-game menu and then select File > Quit.

SQ3DEMO.BAT
SQ3DEMO.BAT

Demo 3 – Windmill Software Digger

Next up is the simple Digger created by Windmill Software in 1983. The basic graphics and primitive audio were terrific compared to many early games designed for the original IBM PC machines of this era. This game looks to be inspired by the 1982 Universal arcade game Mr. Do! Currently, there are some audio emulation issues with this game when used on rpix86.

At the Raspbian Linux terminal prompt create the directory DIGGER.

mkdir ~/dos/DIGGER

Change the active directory to DIGGER.

cd ~/dos/DIGGER

Use wget to download Digger from DOS Game Archive.

wget ftp://download.dosgamesarchive.com/digger.zip

wget http://image.dosgamesarchive.com/games/digger.zip

Uncompress the game file using unzip.

unzip digger.zip

Return back to the /dos directory and run rpix86.

cd ..
./rpix86

Now in the rpix86 DOS prompt list the content of the DOS root to make sure the DIGGER directory exists.

DIR

Change the active directory to DIGGER.

CD DIGGER

List the content of the directory DIGGER.

DIR

Run the program DIGGER.EXE.

DIGGER.EXE

Welcome to computer video gaming 1983 style. Use the arrow keys to control your character or to exit Digger press [F10] a couple of times.

DIGGER.COM
DIGGER.COM

Demo 4 – Non-working Games

At the moment rpix86 is still an immature product, and your mileage for running the various software will vary. Some DOS software can be temperamental such as Epic MegaGame’s Zone 66 from 1993. It demands that we do not load any DOS XMS memory drivers, but currently we can not do this in rpix86.

At the Raspbian Linux terminal prompt create the directory ZONE66.

mkdir ~/dos/ZONE66

Change the active directory to ZONE66.

cd ~/dos/ZONE66

Use wget to download Zone66 from DOS Game Archive.

wget ftp://download.dosgamesarchive.com/zone66.zip

wget wget http://image.dosgamesarchive.com/games/zone66.zip

Uncompress the game file using unzip.

unzip zone66.zip

Return back to the /dos directory and run rpix86.

cd ..
./rpix86

Now in the rpix86 DOS prompt list the content of the DOS root to make sure the ZONE66 directory exists.

CD ZONE66

List the content of ZONE66 but only display items that use the extension .EXE which are execute programs.

DIR *.EXE

Run the program ZONE66.EXE.

ZONE66.EXE

ZONE66.EXE
ZONE66.EXE

Disappointingly we receive an abort error message This program can not run with an XMS driver!!! because our DOS operating system is not configured correctly. As you can see gaming on PCs in this era often required more technical knowledge than today.

Fi

Well, that is it for this tutorial. I will continue to update this entry as new revisions of rpix86 are released for the Raspberry Pi. Feel free to ask any questions in the comments below.

Advertisements

31 thoughts on “Run DOS on the Raspberry Pi – Use rpix86 to turn your Pi into a 1980s super-computer.

  1. Hello, great tutorial, but I have a couple of issues. first, you walk us through running rpix86 for the first time, but I had a bit of trouble getting it to run a second time. a couple of lines added could help.

    A bit about how to add games you already have would also help (I just rebooted back to the GUI and dropped the game folders into the Dos directory)

    Im pretty good with computers I got my first one 36 years ago, but, I’m brand new to the PI, and some of this took some work. A total noob would need more help.

    Do you know if there is anyway to make the PI just boot straight into Rpix86/4dos without having to mess with commands? A batch file of some sort?

    1. Hi Doug, thank you for the feedback as it is always appreciated. The guide is definitely not for noobs and I’ve updated the intro to reflect that. Like home computers of the 1980s, the Pi has limited resources. So I was forced to use the text terminal and disable the GUI to improve the performance of the DOS emulation.

      What kind of trouble you were having in getting rpix86 to run a second time (I assume after a reboot)?

      Did you know Raspbian is a slimmed down port of Debian Linux created specifically for the Raspberry Pi? So the guide was written for those with some skill in Linux but were maybe new to or unfamiliar with DOS, rather than the other way around. Linux is a very rewarding environment to learn once you get past its learning curve.

      For file transfers I found the `wget http://example.com/somefile.zip` download command was the simplest way to get software onto rpix86. Because to be honest, there are so many possibilities for transferring files that I figured it was best to let the reader to work out their own solution.

      1. Hi.

        I haven’t touched this in months, but i got back to it this evening.

        Your instructions are great for downloading, unpacking, installing, and then running dos. But, when you reboot the pi to play later you don’t need to download, unpack, and install – you just need to run it and it took me a good twenty minutes of playing around to figure out how to do that.

        In my case it was 2 commands

        cd dos (where dos was the name of the directory I installed this stuff in)
        ./rpix86 (it was the ./ that really had me stumped)

        then I had my C: prompt and I’m playing Kings Quest like I was 12 again.

        (i’ve written that on a bit of paper taped to my Pi for future refernce)

        Is there anyway to set things so that it just does that automatically when I turn it on?

        BTW, Im 43 and have had a computer since I was 6. I have some programming experience, some Linux experience and lots of hardware experience. I’m new to the Pi, but new tech does not scare me.

        1. Hi Doug,
          Great to hear you got Kings Quest running on your Pi! I too used to be a massive Sierra Online fan as a child; Space Quest 2 was one of the first games I ever owned.

          One problem I find with writing blog posts is they can become bloated too much information and turn readers off, so you have to be on the point.

          In the DOS setup, chapter it does say where the rpix86 application will be stored, how to access it.

          We are going to use a directory called /dos located in our pi home directory /home/pi/ to store our rpix86 related files.

          cd ~/dos

          And how to run rpix86.

          Now uncompress and run rpix86.

          ./rpix86

          I do agree it is a little subtle and I did assume most people would pick up on the keywords, especially since both DOS and Linux terminal share a similar procedure.

          1. I’m not good at subtle. But, I did work it out in the end. and, I can see how you wouldn’t want to make an already long tutorial longer, but one sentence inserted just before “Basics of DOS shell.” would work, something like “the next time you want to run this simply type “cd dos” to change to the dos directory and “./rpix86” to start the emulator.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s