Ever wanted to play old DOS games or use old compilers like Turbo C or MASM to run assembly language code? If you have and were wondering how then DOSBox is the way to go.
What is DOSBox?
DOSBox is open-source software that emulates a computer running MS-DOS. It uses the Simple DirectMedia Layer</strong (SDL) which makes it very easy to port to different platforms. As a result, DOSBox is available for a wide range of Operating Systems like Linux, Windows, Mac, BeOS, etc.
Installing DOSBox in Linux
If you are on Ubuntu or Linux Mint, you can install it directly from the Software Center. For other Debian based systems in general, you can use sudo apt-get to install it. The command for it is as follows.
$ sudo apt-get install dosbox
For other Linux flavors like RHEL, CentOS, and Fedora, you can compile and install it from the source as follows. Download the latest source file using the following wget command.
# wget https://nchc.dl.sourceforge.net/project/dosbox/dosbox/0.74-3/dosbox-0.74-3.tar.gz
Navigate to the directory in which the file was downloaded and run the following commands to install it.
# tar zxf dosbox-0.74-3.tar.gz # cd dosbox-0.74-3/ # ./configure # make # make install
How to Use DOSBox
DOSBox can be run from a terminal by executing the following command, it will open up the terminal window, with a Z:\
prompt.
$ dosbox
Once you start DOSBox, you’ll have to first mount the part of your system wants to access inside DOSBox.
mount <label> <path-to-mount>
To mount your whole Home directory as C, you can run the following command.
mount C ~
Then type in C:
If you have to mount the same directory and cd into the same location every time, then you can automate the whole process with the help of the DOSBox configuration file.
This file is located in the ~./dosbox directory. The name of the file will be the dosbox-[version].conf where version is the version number of DOSBox which you installed. So if you have installed version 0.74, you’ll run the following command:
$ nano ~/.dosbox/dosbox-0.74-3.conf
So, if you want your DOSBox to automount the home directory and go into the ~/TC folder every time DOSBox starts, you can add the following lines at the end of the configuration file.
mount c ~ c: cd TC
There are many more options available in the configuration file. For example, if you want DOSBox to always start in full-screen mode you can edit and change the value of a fullscreen parameter from false to true.
Many other options and description of them is given in the configuration file itself. Also, if you want to add comments anywhere in the configuration file, you can do so by using the # character at the start of that particular line.
Installing Few Games and Programmes
If you are a student of Computer Science in India then you must have used this at some point in time in your School or College. Although it is a pretty outdated compiler most Colleges still use it because of their inability to keep up with modern compilers.
1. Turbo C++
Download the latest TC++ from the below link and extract its contents in your home directory.
Now start DOSBox and run the following commands.
mount c ~ c: cd tc3 install
Change the source drive to C in the installation menu.
Keep the directory for installation as the default one and start the installation procedure.
After this, TC++ would have been installed in the location C:/TC. You can run it using the following commands.
cd /TC cd bin tc
2. Wolfenstein 3D
It was one of the most popular first-person shooter games in the ’90s when it was released and is even today widely popular in the DOS games world. So if you want to have some vintage video game action, the steps to install it are given below.
Download the zip file from the below link and extract its contents to your home directory.
Now start DOSBox and run the following commands.
mount c ~ c: cd wolf3d install
Select C drive as the installation drive as shown in the screen-shot below.
Select the default directory for installation and press enter.
After this, Wolf3d would have been installed in the location C:/Wolf3d. Once inside the C:/Wolf3d directory, you can enter “wolf3d” to run the game.
3. MASM(Microsoft Macro Assembler)
If you want to run assembly language code then you need an assembler like MASM or TASM (Turbo Assembler).
Download the rar file from the below link and extract its contents to your home directory.
Now start DOSBox and run the following commands.
mount c ~ c: cd masm611/disk1 setup
Let all the files be installed to their default locations and select the Operating System in which you want your programs to run.
Once the setup is finished, you can run asm files by running the following commands from the C:/MASM611/BIN directory.
masm <filename>.asm link <filename>.obj <filename>
4. Prince of Persia
This was the first game that I played on a computer! It was very popular while I was growing up in the early 2000s in India. So if you too have fond memories like me of playing this game as a kid and would like to revive them, here are the instructions to install it in DOSBox.
Actually, you don’t need to install it, you just need to download the zip file extract it somewhere and you can play the game in DOSBox directly by entering “prince” from that location. Here are the steps for it.
Download the zip file from the below link and extract its contents to your home directory.
Now start DOSBox and run the following commands.
mount c ~ c: cd prince prince
This was my very first article on Tecmint, so please feel free to comment on how you thought the article was and any suggestions if you have them for me. Also, you can post your doubts as comments if you run into some problem during the installation of any game/program in DOSBox.
This is coming from a user with Linux beta on a Chromebook that is trying to install a game and run it off of DOSBox from
gog.com
.When I run the “
sudo apt-get install dosbox
” it says:and I can’t find the file to unzip and install it.
any pointers?
the commands are not working for my mint os dosbox
@Prem,
Which commands? can you mention it and what error you getting?
Thanks a lot…..i was searching for a way to work with MASM on centos. I have to try it. glad to know that i can do it…..Thanks again…
Yeah, one of my favourite apps. I use it everyday, especially – to play DooM II. Thanks for some commands, Ctrl+D ;)
Great article just because wolf3d and prince of persia were mentioned. And please, CHANGE THE FONT on screenshots!
Thank you! :D
Which screenshots exactly? Are you talking about the font of watermark?
Thanks mate. Helped me install DOS for masm compilation :)
Glad that it was of help. :)