Turbo C++ on Ubuntu using Dosbox

Screenshot from 2014-08-09 14:55:33

The objective of this article is to help you to run Turbo c++ under Ubuntu(Linux) Operating System.

Still in our schools and colleges, Turbo c or c++ is the most widely used compiler. Although there are so many other compilers also avaialble for free which are even better than this outdated compiler but still the students are not exposed to such new technologies.

Turbo c++ cannot run under Ubuntu as it is built for DOS. But it can be possible by using Dosbox, which is a DOS emulator for Linux Operating System. Dosbox is light and very stable emulator for DOS based programs and it was developed with the intension of using it to emulate DOS games and programs on Linux system.

No doubt, we use WINE to run the windows based programs on Ubuntu or Linux kind of O/S but here in this case, WINE can’t be used so efficiently as it can’t handle the DOS programs like Turbo c++, moreover wine is heavy on the system as it is basically meant for Windows based programs.

STEPS TO FOLLOW:

1. INSTALLATION

Open the terminal by CTRL+ALT+T.

Type the following code:

sudo apt-get install dosbox

Once it has been installed, download the Turbo c++. Extract this. And simply place the folder in /home directory. Now, open dosbox by simply typing

dosbox

Here, we have to mount the Turbo, type the following commands for this task-

mount c ~
c:
cd setup
install.exe

Now, press Ok to start the installation. Select C: drive for destination and source path as setup in the next window.

Select Start installation. After it is done. Write the following code:

c:
cd TC/BIN
tc.exe

Screenshot from 2014-08-09 15:17:53

2. CREATING CONFIGURATION FILES:

Run the following code:

config -writeconf /home/your-username/dosbox.conf

3. CREATING AUTO-MOUNT AND EMULATING IN FULLSCREEN

Screenshot from 2014-08-09 15:26:25

Open dosbox.conf file which we have created earlier under /home directory.

turbo_c++_dosbox_ubuntu_installation_solancer_auto_mount
At the end, write the following lines:

mount c ~ /home/your-username/
c:
cd TC
cd BIN

Now, to set the fullscreen mode, find the word fullscreen in the same file and change its value to true.

Save and close this.

4. DELETING Ctrl+F9 KEY TO AVOID SHUTDOWN of DOSBOX

In the end, you’ll have to delete a key from the dosbox keymapper : ctrl+F9
Since Ctrl+F9 is a Shutdown key in DOSBOX, so it can create problem while compiling a c++ program, as the same key is used to compile in Turbo c++.

Screenshot-DOSBox 0.74, Cpu speed:     9000 cycles, Frameskip  0, Program:   DOSBOX

To solve this, open the dosbox and hold ctrl+F1. Now, in the window, select the shutdown option on the right hand side bottom, click on delete and then save and exit.

That’s all about it. Now, you’re able to run c++ program using Turbo c++ in Ubuntu.

🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

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