Technology Lab —

Old school: I work in DOS for an entire day

Open source MS-DOS alternative lives—but using it nearly killed me.

Twenty years ago this week, as Microsoft announced that it would end support for the MS-DOS operating system, James Hall announced to the world that he intended to create a public domain version of the OS in order to keep the universe of character-based DOS software alive. Hall’s “PD-DOS” project eventually became FreeDOS, which today supports an ecosystem of developers, retro gamers, and diehards who will give up their WordStar when you pry the floppies from their cold, dead fingers.

Further Reading

In tribute to the project's two decades (and to those brave souls who keep the DOS fires burning), I decided to spend a day this week working in FreeDOS. I set up a machine running the latest distribution of the OS along with software from the FreeDOS Package Manager repositories. I then added whatever other software I could scrape together—open source software, freeware, and “abandonware” found on the Web, plus some software graciously sent by Lee Hutchinson from his own personal reserve of DOSware. I wanted to know if it was possible to do modern Web-based work in DOS—and just how painful it might prove to be.

I was soon rocking my computer like it was 1994. That is, I had no Twitter, Google, or anything else that used SSL, but I did have some command line TCP/IP tools, an otherwise functional Web browser, and... Gopher. Plus, I had WordPerfect 5, Microsoft Word 5, WordStar, Lotus 123, and dBase III—everything I could ever want, right?

Why FreeDOS?

Linux is free, too, and I’d rather spend any day working on an aging laptop running Debian or Ubuntu than working from the DOS command prompt. But there's a certain insane beauty to the austerity of FreeDOS—plus, it’s an operating system that can boot from a floppy disk and run in 640KB of memory with no sweat (though it can go beyond that limit with one of several open source “high-memory” extenders).

FreeDOS has dressed up the old DOS environment a bit; for instance, with the addition of FAT32 support, FreeDOS can today support drives up to 8TB in size. An add-in module called LFNDOS adds support for the long filenames introduced in Windows 95. And thanks to a small army of open source developers and to the intellectual property gifts of two decades of commercial and academic DOS development, FreeDOS has compilers for dozens of programming languages (though, as far as I can tell, Java is not one of them).

At one point, FreeDOS became the only DOS that shipped with major PC brands, but you had to ask for it. Dell and Hewlett-Packard shipped FreeDOS with their “no operating system” machines as an alternative to Windows preconfigurations, and it became a popular option on cheap PCs, particularly in Asia, late in the last decade. The OS is still listed on the Dell and HP websites, but it seems that the option to have it shipped with new PCs is no longer available through those companies' Web stores.

Despite its decline, FreeDOS continues to have an active user community. It’s still used as a lightweight OS for “boot floppies” needed to do network startups, to install or repair other operating systems, or to perform firmware updates. Because of its low memory and storage footprint, FreeDOS has also found a home in the virtual machine world, with ready-made images available for a variety of desktop and server VM environments.

But as was always the case with DOS, some assembly is required to get things running just right.

Building an Internet-friendly DOS

The official current version (FreeDOS version 1.1, released in 2011) is available as a live CD image, but the default installation lacks many of the pieces you’ll need to connect to the 21st-century Internet—including network drivers. Fortunately, another CD image is available that contains all the repository packages, including a couple of network driver options that can be installed with the FreeDOS Package Manager (FDNPKG).

I opted to install most of the packages, starting with the Crynwr packet driver—a freeware networking driver set that works with most standard network cards from the DOS era. Many DOS applications that use TCP/IP use a TCP library rather than a system driver, and FreeDOS has two that are compatible with the Crynwr packet driver: mTCP, still supported and accompanied by a handful of utilities (including an IRC client), and the venerable Waterloo TCP (WATTCP) developed in the early 1990s. The mTCP library has even been used to build a Web server—its home page is served up from an IBM PCjr.

You can also find “terminate-stay-resident” drivers for TCP/IP and other networks, which you’ll need for network file sharing. But to make them work, you’ll have to play hunter-gatherer with all the component parts, as most of these were commercial and are now unsupported. Someone on the VirtualBox forums has done a lot of that work already, fortunately. I took an alternate route: I ran FTP on my Mac OS X host and used the mTCP FTP client to shuttle files over to the DOS client. That allowed me to rather quickly add to my toolkit for a day of DOS productivity.

The land of “abandonware”

Next, I needed some content creation software. If I was so inclined, I could have foregone the luxury of a word processor and just used the FreeDOS EDIT.EXE tool or one of the many ported open source text tools. But if you’re looking for something a little closer to the “modern Office” experience, Microsoft Word 5.5 for DOS is available for free.

Before Microsoft won the desktop wars, word processors had devout followings. George R.R. Martin reportedly still uses WordStar, which I used briefly in the mid-1980s—it came bundled with my Kaypro PC. But to me, there was no other choice than the reassuring default deep blue of WordPerfect 5; I still have the function key template burned into my retinas. Fortunately, Lee Hutchinson happened to still have a copy.

Next came the choice of a spreadsheet. Lotus 1-2-3 or VisiCalc? Both are freely available off the Web. The executable version of VisiCalc that its developer, Dan Bricklin, has posted online is the original version for the IBM PC, created in 1981. Its user interface is a little primitive, but considering that it’s only a 27.5KB file—smaller than the Word document that I created to write this story—it’s a study in elegance.I don’t print things much anymore, so I didn’t have to dive into the world of printer drivers.

Unfortunately, you might as well send someone the Dead Sea scrolls as anything saved in the native file formats of these ancient spreadsheets—unless your recipients happen to have Apache OpenOffice, in which case you can send them a 1-2-3 .WK1 file, by all means.

Finally, to round out my software set, I found a .ZIP file of Ashton Tate’s dBase III and built a quick contact database. My inner Clipper programmer was happy again.

The Internet of 1994

But the thing is—I work for a website. And there was the small matter of actually using the Web from DOS.

Yes, Virginia, there is a DOS-based Web browser that's still in development, and it’s open source. Arachne, which was most recently updated a year ago and is licensed under the GPL, is a full screen graphical browser that has its own built-in TCP/IP stack along with SLIP/PPP support (for those still in the world of dial-up). It even has a built-in POP/SMTP mail client, albeit a fairly primitive one.

Arachne is stable, but it’s hardly in tune with the requirements of the modern Web. For one thing, there’s no support for HTTPS, so Google, Twitter, Yahoo, and all those sites that have moved to SSL encryption in the post-Snowden era are unreachable. (Thank Bill there’s still Bing, right?) Also, it supports only the most basic of CSS style sheets, so modern websites look a little less modern. And while the mail client works, attaching files requires a bit of finesse.

I also tried Dillo, another open source browser based on FLTK, a cross-platform GUI library, which behaves like Mozilla 4.0. FLTK provides a Windows 2.0-like GUI experience. I managed to get it to work with Google (after turning off image downloads), but the mouse support was iffy, and it crashed and burned several times while loading pages.

After some pain and suffering with Arachne, I found what appeared to be a more robust mail client, called FlMail, based on the same FLTK library as Dillo. FlMail appears to support SSL, and it works with Gmail and other webmail services that support POP and SMTP. But making the mistake of clicking on an HTML-formatted message in my mailbox sent FlMail into a “preformating [sic] page” loop that gave me reason to go brew another pot of coffee. Sending a message with the first draft of this article attached? The same thing happened, before finding that the send failed. So I fled back to Arachne.

Killing things, coding things

I tried to share my pain via Twitter. Sadly, there's no DOS Twitter client. When I tried to command-line tweet using WGET, Twitter.com wouldn’t resolve—I couldn’t figure out which network stack it was supposed to use, so I just wrote myself a reminder on a Post-It note.

Soon, I was going through copy/paste withdrawal, and it was time for a break. So I started searching through the games I had downloaded. One of the attractions for gamers offered by FreeDOS is its collection of emulators. There are a dozen or so DOS versions of classic consoles, including the NES, Gameboy, and Atari 800.

I had also installed a free mod of Doom, called (imaginatively) FREEDOOM, and I spent some time running around pixelated hell, blasting monsters. There were also two versions of Tetris, and a Mario-like side-scroller called HappyLand that I… really didn’t know what to make of. A DOS Space Invaders clone blew up the system every time I tried to load it.

After leaving a trail of VGA blood, I took a look at the developer tools. The GNU Compiler Collection was ported to FreeDOS as DJGPP. It allows for the creation of 32-bit programs that execute from DOS, and it was updated in March 2012 to include the Go programming language in addition to C, C++, and Fortran. It also includes the RHIDE integrated development environment. There are a few dozen other free and open source compilers and runtime environments as well, including one released earlier this year for the FORTH language.

Of course, there’s a lot of abandonware available for developers as well. Just for the sake of nostalgia, I downloaded Turbo Pascaland Harbour, an open-source Clipper compiler. As soon as I get my DOS contact manager app debugged, I’ll post a link to it.

At the end of the day, I was very ready to return to the comfort of a modern operating system—any modern operating system, thank you. But I did see why there's still interest in DOS after all these years. Despite its archaic limitations, FreeDOS can turn even the oldest PC hardware into a functioning member of the Internet world, and it keeps decades of software up and running.

While it's obvious FreeDOS will never be a mainstream, desktop OS, it's good to know that it's there for supporting old games and legacy programs in virtual machines. FreeDOS + DOSBoxis a pretty useful combo.

Every once in a while I have to launch FreeDOS to upgrade device firmware on a remote machine. Since I'm using OS X locally, and don't have physical access to the remote box, this involves a complicated dance.

1) Create a virtual machine image on my OS X laptop, install FreeDOS on the image, and copy the firmware onto the image. So far, 2 computers involved, one virtual and one real.2) Connect to the baseband management controller (BMC) of the remote server, using a terrible terrible Java application. The BMC is itself another physical computer, with an ARM CPU. One count possibly count the Java Virtual Machine as another computer, but I don't. So 3 machines, 3 different operating systems, and 2 different CPU types involved so far.3) Connect the virtual machine image on my local computer to the BMC as a hard disk, and boot the actual real server off this virtual hard disk that is actually on my laptop. Now we're up to 4 computers, 3 real and 1 virtual.4) At this point, I can install the firmware on the remote server's device. The device actually has a PowerPC CPU on it and is probably running a custom build of Linux on the other side of the PCI bus. So at this point I've interacted with 5 machines, 4 physical CPUs, 3 different CPU architectures, and 3 different operating systems.5) Profit (actually, no, there's no profit here! ha ha ha).

As unpleasant as this is, it is still perhaps more pleasant than using FreeDOS as a desktop OS.

You can still find Trumpet on the Web, for DOS, as well as the Microsoft NetBEUI drivers. I am going to have to get those to work, just so I can have a reminder of my life as 3Com 3Plus Open network admin in 1989.

Ah, TSRs.... I still remember those days of trying to eke out just another 64k of RAM, using QEMM386 to move some of those TSRs to UMBs, and then having multi-boot configs just for different games (Falcon, anyone?).

All that memory work was both fun and irritating at times. I was able to create a RAMdisk for some of my single-floppy games. That was like having a SSD! (yes, I know you can still create RAMdisks)

This brings back fond memories of when I started down my I.T. career path. I had to deal with DOS and Novell 2x. Not to mention my first experience was on an IBM compatible PC with two 5.25 floppy drives and I used BasicA (a variant of the basic language) language to start my programming forray. I love stories like these. Although it reminds me of how old I am now.

You can still find Trumpet on the Web, for DOS, as well as the Microsoft NetBEUI drivers. I am going to have to get those to work, just so I can have a reminder of my life as 3Com 3Plus Open network admin in 1989.

For the next time you do an experiment like this: I can remember getting the "mg" editor to build for DOS using the ANSI.SYS driver, way back in the day. (I cared because I had a hacked ANSI.SYS for my PC, an AT&T PC6300 with Olivetti graphics, that gave me an 80x50 text display in DOS. I had to edit the assembly language source for a custom ANSI.SYS driver to do it, to add support for special modes that the Olivetti graphics card supported, but it worked fine once I'd done that.)

Ah, TSRs.... I still remember those days of trying to eke out just another 64k of RAM, using QEMM386 to move some of those TSRs to UMBs, and then having multi-boot configs just for different games (Falcon, anyone?).

All that memory work was both fun and irritating at times. I was able to create a RAMdisk for some of my single-floppy games. That was like having a SSD! (yes, I know you can still create RAMdisks)

The fun thing is that given the speeds involved, they should have been roughly the same as using a current gen 6Gb/s SSD. Which is insane and extremely cool at the same time

Ah, TSRs.... I still remember those days of trying to eke out just another 64k of RAM, using QEMM386 to move some of those TSRs to UMBs, and then having multi-boot configs just for different games (Falcon, anyone?).

All that memory work was both fun and irritating at times. I was able to create a RAMdisk for some of my single-floppy games. That was like having a SSD! (yes, I know you can still create RAMdisks)

I remember setting up a boot menu to select between different configurations...all because Ultima 7 included its own memory manager (Voodoo), rather than working with the standard EMM386.

You can still find Trumpet on the Web, for DOS, as well as the Microsoft NetBEUI drivers. I am going to have to get those to work, just so I can have a reminder of my life as 3Com 3Plus Open network admin in 1989.

I used to teach DOS in the bad old days. One of the biggest problems with people was getting them to keep their paws off config files and the like. For some reason, people who had no idea of what they were doing used to copy lines of code from the magazines into their machines, and edit the OS. More problems from that than almost anything else.

Even with Windows 3, and later, that was a problem.

Otherwise, it was what it was. I remember people telling me why WordStar was so wonderful because of the 600, or so, two and three key commands you had to learn to make the program useful. Uck!

I bought a computer with FreeDOS pre-installed last week - the exceptionally cheap £130 Acer Aspire XC-603. Now I've read this adventure I'm almost sorry I only booted it once to flash the BIOS before nuking it with a Linux install... almost... but not really.

The DOS experience is incomplete without a dial up modem. Setting up the KlosPPP stack and browsing the web using DOSlynx or playing games online through Kali (Warcraft2, Descent, Duke3D) will complete the experience for me.

"a reminder of my life as 3Com 3Plus Open network admin in 1989" wasn't enough for that already? In all seriousness, I do second your motion of missing Borland...Turbo C++ for DOS was my first foray into learning that language (and really, software development in general, since C64 BASIC really didn't count).

Depending on circumstances and DOS version, two or more of the following choices may have been offered:

Abort (A): Terminate the operation/program and return to the system command prompt.[2] In hindsight this was not a good idea as the program would not do any cleanup (such as completing writing of other files). "Abort" was necessary because early DOS did not implement "Fail". It may have remained necessary for poorly written software for which "Fail" would have caused a loop that would have repeatedly invoked the critical error handler with no other way to exit.

Retry (R): DOS would attempt the operation again.[2] "Retry" made sense if the user could rectify the problem. To continue the example above, if the user simply forgot to close the drive latch, they could close it, retry, and the system would continue where it left off.

Ignore (I): Return success status to the calling program/routine, despite the failure of the operation.[2] For instance, a disk read error could be ignored and DOS would return whatever data was in the read buffer, which might contain some of the correct data from the disk. Attempting to use results after an "Ignore" was an undefined behavior.[2] "Ignore" did not appear in cases where it was impossible for the data to be used; for instance, a missing disk could not be ignored because that would require DOS to construct and return some kind of file descriptor that worked in further "read" calls.

Fail (F): Return failure status to the calling program/routine.[2] "Fail" returned an error code to the program, similar to other errors such as file not found. The program could then gracefully recover from the problem. This option did not exist in DOS 2.0.

I've been reading Ars for a while but I had to sign up to comment on this article. A few days ago I did the same thing and installed MS-DOS 6.22 in VirtualBox. DOS is before my time so it took a while to get the necessary software (I still don't know what a packet driver is) but I managed to get online and it was really surprising just how serviceable DOS is. That said it also makes me thankful to live in a time when I don't really have to worry about things like running out of memory.