Skip to content
MasterO2 edited this page Nov 18, 2023 · 10 revisions
Table of contents (click to expand)

Introduction

DOS could be intimidating to new users. This Operating System is based on a command-line where you have to type in commands to execute programs. Also it was a time where applications and games asked you to provide some "IRQ" and "DMA" numbers to get your soundcard properly set up. There were also many video modes (CGA, VGA, etc.) and resolutions (320x200, 640x400, etc.) to choose from.

If you have no idea about these numbers and/or don't know what command to enter in order to install and play DOS games then this section might be helpful.

One objective here is to provide guidance to users by covering the basics of installing a game. Another objective is to ensure users keep their DOS environment as clean as possible which will be easier to maintain. In case of issue, it will be faster to get the required debug information from such environment.

Note: thanks to the flexibility of DOSBox Staging users are free to organize their DOS environment exactly the way they want. Therefore the below guide is just a recommendation.

[Top]


Prepare a DOS environment

With DOS you have to manipulate many different files and folders. That's why it's important to keep them in separate locations with a name easy to remember. The following environment is recommended:

You can see there are directories for each type of content, detailed hereafter.

  • games: to store games files. This will be the C: drive.
  • isos: to store CD or floppy images (.bin/cue, .img, .iso). This will be the I: drive.
  • maps: to store games "mappings" (used to bind keys to a controller for instance).
  • midi: to store MIDI-related files.
  • utils: to store external utilities or drivers. This will be the U: drive.
  • .conf: one file has to be created for each game/application.

On your system, find a suitable location where to create the above directories (eg. C:\DOSDATA or /home/user/dosdata). Feel free to change any names but the guide will stick to the above for consistency's sake.

Once you're all set, let's copy CD images into the isos folder. Promoting the release of Command & Conquer 3 Electronic Arts released Command & Conquer as freeware in 2007. It is therefore legal to download. Grab your copy of the GDI and NOD discs. Cherry on the cake, this game comes with one of the most impressive setup of that era. For now let's create a folder named comcon inside of isos and copy the 2 CD images over there (comcon1.iso and comcon2.iso).

Note: you will notice that most files/directories do have short names. This is due to the fact DOS supported only 8 characters for the filename + 3 characters for the extension. That's why this guide will stick to the 8.3 naming convention to prevent any issue. If you have a file or folder longer than 8 characters it appears on the command-line this way: LONGNA~1.

[Top]


Install DOSBox Staging

To install DOSBox Staging you have many available options. The easiest would be to download a binary for your system from DOSBox Staging's official website. But you can also compile the source code yourself or get a pre-compiled binary from your favourite frontend (eg. Retropie). The location where to install the binary is up to you. Yet the rule is to not place it inside the DOS environment created above but in a separate location (eg. C:\DOSBIN or /home/user/dosbin).

[Top]


Configure DOSBox Staging

The idea here is to take advantage of the layered approach of DOSBox Staging to keep files short and easy to read. Also to not have to edit multiple files in different locations in case of issue. This guide will show users how to work with .conf files (global and local) only. Any use of scripts (batch) or shortcuts will not be covered.

What you need in your environment to get your games and applications working:

  • one global config file (known as dosbox-staging.conf).
  • one local config file per game (ie. <game_name>.conf).

That's all. The global config file will set the default values relevant for your system. The local config file will tell DOSBox Staging how to launch the game.

Note: for some games or applications it's required to rely on specific values for the soundcard or the various memory settings. In that case and thanks to the approach described here, you will need to override the values from the local config only. No need to touch the global config.

Find your dosbox-staging.conf file and use one of the already listed global config file examples as a template depending on your system. Take some time to read the documentation from that file, it's of great help.

Once done let's create a simple .conf file that will serve as our DOS console. It's required to install games from CD or floppies.

[Top]


Create a DOS console

Next to the directories created above inside your DOS environment, create a text file named +dosbox.conf. As you will rely on this for installing your games, the DOS console has to use the most generic hardware settings as possible to ensure it will accomodate a wide range of setups. The +dosbox.conf file is a local config.

Copy/paste the following into it (adjust the path names according to your current setup):

Click to expand
[cpu]
cycles = max

[midi]
mpu401     = intelligent
mididevice = fluidsynth

[gus]
gus = true

[speaker]
pcspeaker = true

[dos]
xms = true
ems = true
umb = true

[autoexec]
mount c /home/user/dosdata/games -freesize 1024
mount i /home/user/dosdata/isos
mount u /home/user/dosdata/utils
SET PATH=U:\;%PATH%
C:

The file will tell DOSBox Staging to run at the maximum speed available (useful for some installation to not take too long), enable General MIDI as well as the Gravis UltraSound, internal speaker and all types of memory are also switched on.

The [autoexec] section is the most interesting as it will tell DOSBox Staging how to mount your various directories as DOS drives. Such drives will then be available from the DOS console by typing the associated letter followed by a colon (:). Eg. to access your CD images from the DOS console simply type at the C:\> prompt:

C:\>i:
I:\>

Note: this file overrides parameters from the global config file (dosbox-staging.conf) like the max = setting. Value(s) from the local config will always takes precedence over global. If a parameter is not specified in the local config then value from the global will be used instead. The Sound Blaster 16 sound card will therefore be enabled as it's being set by the global file. No need to enable it again in the local config.

Now let's run our DOS console to install Command & Conquer. To do so, simply type in the following command:

GNU/Linux:

$ ./home/user/dosbin/dosbox -conf /home/user/dosdata/+dosbox.conf

Windows (CMD):

dosbox.exe -conf path\to\dosbox.conf

Note: Replace path\to\dosbox.conf with the actual location of dosbox.conf on your system.

Windows (Powershell):

.\dosbox.exe -conf path\to\dosbox.conf

Note: Replace path\to\dosbox.conf with the actual location of dosbox.conf on your system.

[Top]


Install a game

If everything goes well, you should be at the DOS prompt, C:\> where DOS is waiting for you to input some commands. Installing a DOS game follows almost always the same process: first you copy files from CD/floppy over to your C: drive then installation program will ask you about your sound setup environment. That's why it's important to note the hardware settings of the soundcard you intend to use. You should be fine with Sound Blaster 16 for majority of applications. Therefore you have to note the port, IRQ and DMA of that card. The default values are set by dosbox-staging.conf which are:

sbtype  = sb16
sbbase  = 220
irq     = 7
dma     = 1
hdma    = 5

Go to your I: drive where you store the various CD images and let's mount the first Command & Conquer CD on the D: drive. D: will be our virtual CD-Rom drive. In this example the 2 CD images are named after comcon1.iso (GDI) and comcon2.iso (NOD). Run the installation program by typing:

C:\>i:
I:\>cd comcon
I:\COMCON\>imgmount d comcon1.iso -t cdrom
I:\COMCON\>d:
D:\>install

Autocompletion is available and should work most of the time hence no need to type every single letter. Just start typing and hit the tab key to see the available candidates.

Note: MS-DOS is not case-sensitive. Therefore commands such as DIR can be typed as DIR, Dir, or dir.

Note 2: Do not mount DOS disc images in Dosbox Staging using Daemon Tools or other similar programs. If you do use Daemon Tools for this purpose, you will run into game compatibility issues like this. Instead, use Dosbox Staging's imgmount command only.

During installation you will have to pick a soundcard. Don't rely on the Autodetect feature and pick the Sound Blaster 16 whenever you are offered the choice. You should hear sound effects and music which confirms everything works as intended. Then you'll have to tell the installation program where to copy files over. Specify a directory under the C: drive like c:\comcon for instance. Once installation is completed exit the program.

You can launch the game already if you can't wait by typing c&c at the C:\> prompt. Yet it would be wiser to go one step further to automate things a bit. This will ensure you won't have to mount or to type the same commands every time you want to play a game.

[Top]


[autoexec] section

To run the game without having to type anything on the DOS command-line, the [autoexec] section will come in handy. It will tell DOSBox Staging to execute any commands specified. A good way to automate things a bit! In our example we will use that to mount everything we need and to tell DOSBox Staging what executable to run.

Create a comcon.conf file in your DOS environment (dosdata/), next to +dosbox.conf. Just add the following lines:

[autoexec]
imgmount d /home/user/dosdata/isos/comcon/comcon1.iso -t cdrom
imgmount e /home/user/dosdata/isos/comcon/comcon2.iso -t cdrom
mount c /home/user/dosdata/games
C:
CD COMCON
C&C.EXE
EXIT

You can see there are two IMGMOUNT commands meaning we are telling DOSBox Staging to mount each CD image to a dedicated virtual CD-Rom drive (D: and E:). Command & Conquer does support multiple CD-Rom drives hence we are taking advantage of that. The game will never ask us to swap discs.

You are all set. Now anytime you want to run this game just type:

GNU/Linux:

$ ./home/user/dosbin/dosbox -conf /home/user/dosdata/comcon.conf

Windows (CMD):

dosbox.exe -conf path\to\comcon.conf

Note: Replace path\to\comcon.conf with the actual location of comcon.conf on your system.

Windows (Powershell):

.\dosbox.exe -conf path\to\comcon.conf

Note: Replace path\to\comcon.conf with the actual location of comcon.conf on your system.

[Top]


Next steps

This tutorial covers the basics of configuring DOSBox Staging for running a single game. It gives you recommendations on how to properly organize your DOS environment to keep it clean and easy to maintain. Should you want to add more games or applications, all you have to do is to create anpother .conf file next to the two created above and add a few lines to tell DOSBox Staging how to run it. Don't forget to override any settings from the global config file (dosbox-staging.conf) to enforce a specific value.

To go further you could add extra utilities or even install an old version of Windows. You may assign keys to your controller/joystick via the Keymapper or configure a MIDI device to improve your gaming experience. There are also Shaders to play with. Last, be sure to read the FAQ which contains plenty of useful information.

[Top]


Clone this wiki locally