DOSBox, part I: Installation and configuration

[ Tuesday, 18 March 2008, Raptou ]


In this article I am going to explain how to configure and use DOSBox, the best MS DOS emulator for Windows, Mac OS X and GNU/Linux systems.

Dragonia Magazine

Author: Radek Krakowiak – Raptou

Originally DOSBox was destined to be a “classic game” player, for games which today’s counterparts are far behind in terms of “playability”. The good ol’ games to which one turns back so many times and always with great pleasure! They do not enjoy high quality graphics, although audio is of the best quality thanks to Roland, Sound Blaster AVE32 or equally legendary Gravis Ultrasound audio cards. Modern games ravish us with graphic and sound effects but… most often they are played only once! They are quickly forgotten contrary to the DOS games to which many turn back to throughout their whole lives as they have “something” the new games lack, old game enthusiasts say.

DOSBox is not destined for games only. It is able to run many DOS applications which I will try to present in future parts of the article. Opening game codes created an environment in which one can live out adventures in Hokus Pokus once more, drive the Lotus car or play with legendary Illusion Pinball — a blueprint for all computer flippers (I still reckon it’s the best in its class!). Most of the games are free of charge with Abandonware status. Even Windows 3.11 can be installed in DOSBox!

What is DOSBox?

DOSBox is equipped with its own DOS commands interpreter but contains some MS DOS 6.22 internal commands. DOSBox emulates a few sound cards with excellent quality. The emulation embraces audio cards with musical instrument sound samples stored in the cards’ memory. They were known as Wavetable cards:

  • Roland,
  • Yamaha OPL 1, 2, 3,
  • General Midi,
  • Gravis Ultrasound,
  • Creative Sound Blaster 1, 2, Pro, Pro 2, 16,
  • Adlib,
  • PC Speaker,
  • MIDI MPU 401.

DOSBox emulates graphical cards (one at a time):

  • CGA (Colour Graphic Adapter ) – 4 colors,
  • Hercules MDA (Mono Display Adapter) – 2 colors with high resolution 762×348,
  • EGA (Enhanced Graphics Adapter) – 16 colors,
  • VGA,
  • SVGA (compatible with VESA 2.0) – 64 thousand colors with 1024×768 resolution. It needs additional VESA Univbe drivers.

DOSBox emulates the resident mouse driver as well; moreover, it incorporates IPX/SPX intranet to play network games in Multiplayer mode.

FreeDOS developers allowed part of the system’s external commands to be used with the DOSBox emulator. In other words, if FreeDOS commands do not reference to the BIOS or to hardware directly they should be able to run within the DOSBox environment without a glitch.

DOSBox Installation

Here are the installation and configuration instructions for the key platforms.

Mac OS X

  1. Download DOSBox and copy it to the Applications folder.
  2. Create a folder on the HDD which will later become your C partition. For example: create DOS folder as /Users/johnny/dos.
  3. Copy Norton Commander, Xtree, and Dos Navigator to the folder for your convenience.
  4. Copy doxbox.conf to Applications folder as well.

Windows

  1. Download DOSBox and install it.
  2. Create a folder on a disk which will later become your C partition; in short, create DOS folder on C disk.
  3. Copy to the folder your favorite managers if you want to, for example Norton Commander, Xtree, or Dos Navigator.
  4. Copy doxbox.conf to the folder with installed DOSBox. It will be “mount c c:\dos” in our case.
  5. Last lines show that it is, simply speaking, running Norton Commander in order to get rid of DOS command typings every time the DOSBox is started.

Debian GNU/Linux (and derivatives like Ubuntu)

Set yourself as root and type in the terminal:

su -

and type:

# apt-get install dosbox

In Ubuntu instead of switching to root mode, you need to type sudo before the apt-get command to temporarily switch to root mode.

Other methods for obtaining DOSBox under GNU/Linux:

  1. Download DOSBox sources, uncompress them, and then run the following commands:
    configure && make && make install
  2. Create a directory in the /home/user directory which will be used for DOSBox as a C partition, e.g. /home/raptou/dos
  3. Copy the dosbox.conf file to the /home/user directory.
  4. Edit the config file the same way as in Windows — namely, change the last lines to suit your data.

GNU/Linux (using Klik)

There is an easy way for the beginners, thanks to a Click program. We can download and install it in one command:

wget klik.atekon.de/client/install -O -|sh

It is a rather indispensable tool if you want to run programs found on the http://klik.atekon.de website. It is enough to start Firefox or Konqueror and type http://dosbox.klik.atekon.de/ in the URL. That’s all. Nearly all new LiveCD distros contain Klik, so it suffices to go to the single website and download and run DOSBox.

DOSBox configuration

The DOS directory can be defined on FAT32/NTFS file system for both Windows and GNU/Linux. It should be mounted before running DOSBox.

Let’s look into dosbox.conf file sections now. The speed of emulation depends on its proper settings, so read carefully.

  • fullscreen – true/false,
  • fulldouble – double buffering of screen memory – true/false
  • fullresolution – resolution for fullscreen mode,
  • windowresolution – resolution in windows mode. “Original” value concerns game’s resolution,
  • output – defines DOSBox mode for “true” (physical, not emulated) graphical card. If it supports 3D acceleration it’ll be better to turn it on. This will make fonts and pictures more polished. It affects emulation efficiency. The best mode for Windows is ddraw (DirectDraw), and for GNU/Linux and Mac OS X the opengl (OpenGL) option. Of course you can set the options vice versa but, practically, DOSBox will not work well in such circumstances, not to mention that some games will not start at all. If your card is not the accelerated one select the overlay option (Overlay) for newer cards or surface option (Surface) for older cards like Ati Rage 128. This mode will move the burden of graphics processing from the graphical chip to the CPU. Beware, though — it has adverse effect on emulation efficiency.
  • autolock – defines mouse locking for DOS. Releasing mouse to Windows or other systems will be possible after pressing [Ctrl]+[F10],
  • sensitivity – declares mouse sensitivity in DOS,
  • waitonerror – this option leaves the terminal window opened after a DOS error,
  • priority – sets processing priority level for parent system running DOSBox; the higher priority the more CPU power is commited to run DOSBox and the better its responsiveness,
  • mapperfile – defines keys mapping file. It needs to be declared. Default mapper file is mapper.txt,
  • machine – determines graphical card which will be emulated. Users can choose from the following names: CGA, EGA, Hercules/MDA, VGA (SVGA VESA),
  • captures – suggests directory for screenshots and grabbed sound files,
  • memsize – stipulates memory size for emulated graphical chip; it should not exceed 4096 kB. Higher values are used on rare occasions, mainly for graphically demanding programs.
  • frameskip – presets number of frames dropped before drawing one. Default value is set to 1 but slower machines must use higher numbers. Such extreme settings can create strobe effects, albeit making the games playable. Users can change the option during the course of a game using [Ctrl]+[F7] and [Ctrl]+[F8] keys,
  • aspect, scaler – these two options improve the quality of lower resolution images being displayed on the whole screen; for example, they make it possible to display “old” 320×200 windows in full screen mode with satisfying quality.
  • core – sets processor modes (speeds) for CPU emulation; it should be left to auto.
  • cycles – defines number of CPU instructions which DOSBox will try to emulate in one millisecond. The speed of a few old games was in direct proportion to CPU clocking.
  • cycleup, cycledown – controls emulation speed by “manually” increasing or decreasing number of CPU cycles — use [Ctrl]+[F11] or [Ctrl]+[F12] accordingly.

We will leave sound card settings alone. Hands-on experience suggests to leave them with default options. The same should be applied in the case of memory settings. Nevertheless, some memory options could be turned off when a memory conflict appears.

There’s a very important section — autoexec. It is the DOSBox equivalent of the DOS true autoexec.bat file. It controls drivers and resident programs loading, deciding which should be loaded before running a game or an app. For example, it can load the VESA uniVBE driver. It contains system variable definitions, e.g. PATH, or sets them with the help of the SET command (e.g. set blaster=a220 i7 d1 t4). It can execute other batch files as well, but it should be kept in mind that the DOSBox autoexec file has limited functionality in contrast to the original MS DOS autoexec.bat. Not all commands have been implemented.

[autoexec] section should always begin with disk C declaration from which DOSBox will be run. In other words, disk C is to be mounted to the appropriate DOSBox directory. It goes more or less like this:

Windows:

mount c disk\path\path(...)

Unix or GNU/Linux:

mount c disk/path/path(...)

Please, pay attention to slash types!

If we have decided to put DOSBox on a mobile disk, e.g. USB pendrive, we should use meta characters because a Flash disk would be seen under different letters and it would be attached within the directory tree in different places. Let’s get rid of the disk name now, instead making use of “dots” — where “one dot” means the same directory, “two dots” means move up one directory, etc.

For example, the command below:

mount c ..\dos

means “mount dos directory as C disk, dos is placed on the same level as the current directory (to mount command). Watch out for the slash’s direction, again!

When we define the directory simulating disk C, we may copy the program we will need to work with. For the most part it will be Norton Commander. But we are not constrained to one DOSBox instance. We can multiply the directory with DOSBox files and the directory of the pseudo-C disk and get independent environments with different games. They could be run after clicking DOSBox icons. It suffices to provide the program name which will start a given game or program. The name should be added in the line next to the one containing the “mount” command. We will cover this in detail in the follow-up article on PolishLinux.org, so stay tuned!

We can also add the exit command to the end of the dosbox.conf file. It will instantaneously switch the processing environment back to the Windows system or other systems under which DOSBox has been running.

DOSBox Keys Description

Here are some useful key bindings that DOSBox defines by default.

Win/Linux

  • [Ctrl]+[ENTER] – window/fullscreen,
  • [Ctrl]+[F11]/[F12] – decrease/increase CPU cycles,
  • [Ctrl]+[F7]/[F8] – skip frames down/up – useful for slower computers,
  • [Ctrl]+[F9] – kill program – which went dead (froze),
  • [Ctrl]+[F10] – transfer mouse control to parent system.

Mac

  • [Option]+[ENTER] – window/fullscreen,
  • [Option]+[F11]/[F12] – decrease/increase CPU cycles,
  • [Option]+[F7]/[F8] – skip frames down/up – useful for slower computers,
  • [Option]+[F9] – kill program – which went dead (froze),
  • [Ctrl]+[F10] – transfer mouse control to parent system.

Last but not least — the sample configuration of dosbox.conf. The text can be copied to the config file or edited and then saved under the proper name, but always put it in the DOSBox executable directory at the very end!

About the Author

Radek Krakowiak

DOS fanatic off sentiment. Open Source, Linux and Mac OS X lover. Apple Mac user. Hobby: digital international communication, with vision on CB band, using the sound card as a modem. Fan of railways. (more...)

New AdTaily ads!

Are you a film buff?

film buffs community, movie recommendations and reviews

RSS: Comments

You can follow the comments to this article through a special channel RSS 2.0 .

Related articles: Apps

 more »

PolishLinux Top Content


Become our fan on Facebook!

PolishLinux.org on Facebook

Follow PolishLinux on Twitter!

Follow polishlinux on Twitter

Google Ads