A concise guide to installing and using FreeDOS ver 1.0 in GNU/Linux

September 27, 2006
I have always looked at the DOS operating system with some nostalgia. At a time when networking as you see now was confined to some labs or universities in the US, and one had to put up exclusively with floppies to transfer data from one computer to another, DOS was a big player atleast on the home front. I have fond memories of playing games such as pacman, Dig Dug, galaga, ..... on Dos.

I clearly remember the Win 3.1 operating system which was entirely built on top of MS-DOS. But when networking between computers became more common, Dos (or MS-DOS as it was known) started revealing its shortcomings as it is not a network operating system and was designed to be run on standalone machines. More over it did not have true multi-tasking, multi-user functionality. Recognizing these drawbacks, Microsoft decided to move on and built the Windows 95/98/NT/2000/XP OSes and gradually shifted base from a DOS based kernel to an entirely new network operating system as you see in Windows 2000/XP.

FreeDOS is a project which aims to recreate the magic of DOS and bring a truly free GPLed DOS encompassing all the characteristics of MS-DOS with lots of improvements thrown in. A couple of weeks back, FreeDOS developers released ver 1.0 of their OS. I downloaded the full CD ISO of FreeDOS from their website which was around 153 MB in size.

Using Qemu to install FreeDOS in Linux

Since I have been using Linux as my operating system, I decided to install and use FreeDOS inside Linux by means of an emulator. In the past, I have used Qemu to run Damn Small Linux on my Ubuntu machine. And I was pleased with its performance. So I decided to use Qemu to run FreeDOS as well.

Qemu is an emulator which can be used to run a variety of OSes inside a host OS. It is well supported on the Linux platform with ports available for Windows and Mac OSX. If it is not already installed, you can install it from your Linux distribution's repository. In Ubuntu Linux, you can install Qemu as follows.

$ sudo apt-get install qemu

Next, I created a directory /opt/freedos and moved the downloaded FreeDOS ISO file into it.

$ mkdir /opt/freedos
$ cp fdfullcd.iso /opt/freedos/.

Preparing an image to hold the FreeDOS


In Linux, everything is considered a file. So the hard disk, the monitor, the keyboard, mice are all recognised as files by the OS. By the same logic, it is possible to install programs and entire OSes into a file, the only requirement being the file should be large enough to store what ever is intended to be stored in it.

My intention was to install FreeDOS into a file and boot it using QEMU. I roughly estimated that 400 MB space is ample for installing and working in FreeDOS and so created a raw file named freedosfile.img roughly of size 400 MB using the dd command as follows:

$ cd /opt/freedos
$ dd if=/dev/zero of=freedosfile.img bs=1024 count=400000
400000+0 records in
400000+0 records out
409600000 bytes (410 MB) copied, 18.9476 seconds, 21.6 MB/s

Now lets check out the contents of the /opt/freedos/ directory.

$ ls -l /opt/freedos
-rw-r--r-- 1 ravi ravi 160184320 2006-09-05 02:11 fdfullcd.iso
-rw-r--r-- 1 ravi ravi 409600000 2006-09-12 10:38 freedosfile.img

Installation of FreeDOS


To initiate the installation of FreeDOS, I used the following command:

$ qemu -cdrom fdfullcd.iso -hda freedosfile.img -boot d

The qemu options used in the above command are described below.

-cdrom - points to the ISO image of FreeDOS.

-hda - passes the name of the hard disk. In our case, a file freedosfile.img functions as the hard disk.

-boot takes different options one of which d denotes to boot from the CD-ROM.

Now I was presented with the FreeDOS installer.

Installation steps for FreeDOS


The installation itself is quite simple. It involves formating the hard disk (in my case the image), selecting the packages, and copying the files to the hard disk. All the steps are detailed in the screenshots below.




























What you will find in FreeDOS

The FreeDOS OS is split into 10 packages each pertaining to a particular aspect of the OS. They are as follows:

base - Essential DOS utilities which reproduce the functionality of MS-DOS

compress - Free file compression and decompression utilities (7zip, arj, bzip2, cabextract, gzip, tar, zoo ...)

driver - Free drivers for network cards and usb

edit - A collection of editors (emacs, vim, pg, setedit, ospedit)

games - A good choice of free DOS games - Doom, Solitare, BumpNJump, nethack, tetris...

gui - Gem Desktop (Very nice)

lang - Free compilers and assemblers (Pascal,C,Basic,assembler,Fortran, debuggers,make tool...)

media - Free multimedia applications (cdrtools, ogg vorbis, mpxplay,lame ...)

net - Networking programs (wget, VNC, SSH client, lynx, arachne, mail client, wattcp - a free TCP/IP stack for DOS).

util - Free file, directory and other utilities (fprot anti virus, locate, head, du, cal, dos32ax, tail, tee, 4dos, uptime ...)

Booting into FreeDOS using Qemu


Post installation, I used the following Qemu command to boot into FreeDOS.

$ qemu -hda freedosfile.img -boot c

To have access to the floppy drive from within FreeDOS, the Qemu command as follows:

$ qemu -hda freedosfile.img -fda /dev/fd0 -boot c

Features of FreeDOS


  • Install and run 100s of free DOS games.
  • Many Linux based command line tools have been ported to FreeDOS. Eg: cal, head, tail, ls, tar, gzip, bzip2, lynx, wget and so on.
  • Low memory footprint.
  • Run many useful DOS programs.
  • Offers a nostalgic experience.

A few programs running in FreeDOS


Mine DOS game

Fig: Mine game in progress

OpenGEM GUI for DOS

Fig: Open Gem Desktop

Archne web browser for DOS

Fig: Arachne Web Browser

12 comments:

  • I wonder how this compares to running dosbox? Mainly in terms of speed (games).

  • Actually you can use qemu's tools
    instead of doing this :
    $ cd /opt/freedos
    $ dd if=/dev/zero of=freedosfile.img bs=1024 count=400000

    you can use
    qemu-img create -f qcow freedosfile.img 410M

  • Thanks for this detailed article, can't wait to try it myself and replay all these old games like Heretic and Hexen.
    More comments are on OSnews.

  • jape_svk

    Very nice article.. It's helpfull.. I'll need this in near future..

  • Nice to see the old DOS world again.
    Yes, it's working as described.

    Have fun then, also with DOOM in DOS...

  • Arrggh! having keyboard problems. Keys don't match. Tried it with FreeDOS, FreeDOS32, MSDOS..no good. Got a USB keyboard, QEMU 8.1 on Debian. Any ideas?

    Oh, never mind. This "-k en-us" did the trick.

    Great introduction though.

  • A good article! I was especially happy to learn that 4Dos is included in FreeDos. 4Dos is a wonderful programming language by which a person can draw menu- and list-boxes, search for and extract text strings, create aliases and the like. The environment size has to be increased tenfold for serious batch-file work in 4Dos, which can be done in a single line in autoexec.bat. A truly excellent spreadsheet («As Easy As») is still available from Trius, Inc («try us»). At their web site there is a link to some bright young chaps in the Caribbean who are learning computers on Dos. With the aid of this article (or, alternately, by aid of DosEMU for which excellent docs are available) people all over the world who've been learning by Dos, especially if with 4Dos (which is freeware now), can continue to run Dos but now inside of *nix. 4Dos is very much like the Unix shell. Thanks to this article and others like it, «third-world» people who have good experience at the Dos command-line (when 4Dos.com replaces command.com) have a real jump into the Unix command-line. For them, it will be no hardship to do without GUIs with high ram-overhead. Now that they are able to run *nix and Dos side by side, simultaneously thanks to Qemu or DosEmu (if not always in an Xterm), they will be able nicely to do wonders at the *nix command-line because they already have a good feel for typed commands. And the work they've put into (say) a dos spreadsheet will not have to be re-done in *nix. I applaud articles such as this one. I feel this kind of article is very important for everybody who is working with legacy equipment and wants to do more than click on something!

    Sincerely,

    Roger (Illinois, USA)

  • Is there anyway to acess files on our hard drive?? like, my folder "home"
    thanks

    Felipe, brasil

  • Felipe,
    It is possible to access your hard drive but you might have to configure a tun/tap device first. Though I haven't tried it.

  • I was wondering how you install an application in FreeDos, as in step by step? The app is on a floppy.

  • Hi!,
    I'm tryin to install free DOS in my pc with puppy linux. After I write:
    qemu -cdrom fdbasedcd.iso -hda freedosfile.img -boot d I have this message

    qemu: error while loading shared libraries: libSDL-1.2.so.0: cannot open shared object file: No such file or directory

    I have installed the sdl.pup libraries, but there's not any change at all.

    Any suggestion?... sory I'm a newbie.

    Thanks in advance.
    JOC

  • Hi! 2 questions:

    If I have a ISA dac card, do I have to give a special instruction to recognize it? and second question:
    how can I share files between linux and freedos?

    Thank you very much! It's amazing!

    Joc