Friday 22 June 2012

Turbo C Compiler in 64-bit Windows 7

One of my friends was asking me how to run Turbo C in Windows 7 - 64 bit systems. In my old PC, I had 32 bit Windows 7 and it was working fine for me. The age-old Borland's Turbo-C compiler will not work with the 64 bit edition because of lack of 64 bit compatibility.


Even now, I don't recommend you using Turbo C. Reason: Its old. Anything old, its not very stable for serious development. For windows, you could use Eclipse IDE with gcc plugin for C and C++ development.

 Anyways, coming back to installing Turbo C in 64-bit Window 7. We'll be doing this using an OpenSource software called DOSBox. DOSBox is an emulator which is available for both Windows and Linux which emulates DOS system in the host PC.


Step 1: Downloading necessary packages:

First, download the necessary packages below either from the official link or the Mirror link. Try the mirror only if you have problem with the official link

  • DOSbox Emulator - Download
    • Size : 1.4 MB
    • Version: 0.74
  • Borland's Turbo C installer- Download
    • Size : 3.26 MB
    • Version: 3.0

Step 2 : Installing and configuring DOSBox

   Install DOSBox in your system in any preferred location and launch it. You'll get the DOS prompt somewhat similar to the pic below




  • Create a folder in your C: drive as TurboCInstaller and move the extracted files from tc3.zip into that folder
  • We'll mount the virtual A: as the Turbo C Installer Disc
  • In DOSBox, type the following command
mount a c:\TurboCInstaller\
  • Now, create a new folder in C:\ as Turbo and we'll mount virtual C: for installing Turbo C. In DOSBox type the following command,
mount c c:\Turbo
  • Now, move to A:\ and install Turbo C 
A:

install.exe
While installing, just change the location to C:\ and complete the installation

Step 3 : Some Tweaks

      By default, in DOSBox Ctrl+F9 quits it. So, whenever we try to run something in our TurboC DOSBox will quit which makes us use the mouse everytime to navigate to the menu and run our program. We can prevent this by editing the keymapper

     In DOSBox, Press Ctrl+F1 to invoke the keymapper. The keymapper will be like this

With your mouse, click on the ShutDown box (circled above) and click on Del The entry is now deleted. Click in Save button to save the keymapper settings and exit.


Step 3 : Using Turbo C


         Close DOSBox now and follow the steps below, whenever you want to use Turbo C
  • Launch DOSBox
  • Execute the below command to mount the Turbo C directory
mount c c:\Turbo
  • Then, execute the below commands one by one to navigate to C: and launch Turbo C
C:
cd TC\BIN
TC




You can also use Alt+Enter to enter Full Screen mode.

If you run into any problems or have any other difficulties or suggestions, feel free to comment below. :)

Tuesday 12 June 2012

Mounting ISO images in *nix systems

Many times, while arguing Linux vs Windows many people brought forth the point that there's no software like Daemon Tools (in Windows) for creating Virtual CD/DVD ROMs in *nix. 

               The thing is that we don't actually need any kind of Virual CD/DVD emulation. It can be done natively. The only requirement is that the kernel of the system, should support loop devices. And don't worry, all latest kernel support it.


 WARNING: You need to be root or a sudoer to do this.

 Step 1: (Creating Mount Point)

          In any linux based system, you need a mount point to mount any Hard disk or Pen Drive or any loop devices, like this. Bluntly, its like a folder where you can access the contents of the device. Your hard disk will be mounted under /dev/sda1 or /dev/hda1. It differs from system to system.


          Conventionally, any mounting is done under the /mnt directory. so, we'll create a mount point there.

so, fire up your Terminal ;)


geekytux@fox ~ $ sudo mkdir /mnt/iso

  

 Step 2: (Mounting the Image)

         Now, the mount point is created. We'll mount our image in the mount point. Let's say the name our image file is Backup-Latest.iso We'll mount it by 

geekytux@fox ~ $ sudo mount -o loop Backup-Latest.iso


Now, our image is mounted and you can access the files inside the image by navigating through your terminal itself or by any file managers like Nautilus or Thunar on /mnt/iso

Step 3: (Unmounting the image)


       Ah, actually this step is not that compulsory. Your system will automatically unmount all mounts once you shutdown your PC. But, I've added this in case you want to unmount it on your own

geekytux@fox ~ $ sudo umount /mnt/iso



And also, you can create new mount points and mount multiple number of iso images at a time, unlike in Daemon Tools where the no. of Virtual Devices is limited. 

Sunday 3 June 2012