Build your own antisocial writing rig with DOS and a $2 USB key

TribeNews
23 Min Read

Sometimes, the size and complexity of modern OSes – even the FOSS ones – is enough to make us miss the days when an entire bootable OS could fit in three files, when configuring a PC for production meant editing two plain-text files, which contained maybe a dozen lines each. DOS couldn’t do very much, but the little it did was enough. From the early 1980s for a decade or two, much of the world ran on DOS. Then Windows 3 came along, which is arguably the point where the rot set in.

This vulture is not the only one who retains a hint of nostalgia for DOS, which is why today there are community-driven open source recreations of it. We’ve looked at both FreeDOS and SvarDOS in recent years. One community running DOS today are gamers wanting to play classic titles, and there are special emulators aimed at doing this, such as DOSBox-X, 86Box, and PCem. This vulture, though, is not a gamer and finds emulation a little unsatisfying.

- Advertisement -

After Microsoft launched Windows 95, it lost interest in MS-DOS and last year released the source to MS-DOS 4. IBM continued development work on its flavor, PC DOS, for rather longer, releasing PC DOS 6.3, 7.0 and 7.1, as lead developer Vernon Brooks documents on his site PC DOS Retro. Among other changes, PC DOS replaced Microsoft QBASIC with an interpreter for the Rexx programming language, and Microsoft’s full-screen text editor with IBM E. The last version, PC DOS 7.1, even includes FAT32 support, and although it never saw a commercial release, it forms part of IBM’s ServerGuide Scripting Toolkit, which is a free download.

64-bit OSes make running DOS programs harder, but it’s still possible. Actual DOS itself, though, is a different matter. The Reg FOSS desk has been experimenting with DR DOS and PC DOS on modern kit for a few years now. It’s easy to install and run them in virtual machines, but there’s a snag: getting stuff in and out of that VM is not trivial. DOS largely predates local area networks, and what networking it did support pretty much predates the internet. It’s possible to connect a DOS machine (including a VM) to the internet, but it doesn’t leave much free memory and it can’t do very much once it’s there. DOS also doesn’t meaningfully support USB. There are some drivers, but not much hardware works.

- Advertisement -

A secret DOS superpower
But we discovered a useful loophole. In its early days, DOS ran entirely from floppy disks, which modern computers don’t have any more – but the formats of those disks are still used. Any modern OS can happily read and write DOS media – including on USB storage devices. That means that pretty much any x86 PC that still supports legacy boot can boot DOS from a USB drive. When you do that, a little magic happens. The firmware (the BIOS, or UEFI with a “Compatibility Support Module” to emulate a PC BIOS) translates things for DOS. A bootable USB key suddenly looks to DOS like an ordinary hard disk, without any drivers. DOS can’t read modern disk formats, and indeed struggles with any drive bigger than 2 TB, but that doesn’t matter when the entire OS and a whole anthology of apps fits into a few hundred megabytes. That’s less than the smallest USB thumb drive you can still buy.

Thanks to the ancient IBM PC DOS Shell, the bootable USB key has a friendly menu – click to enlarge

- Advertisement -

IBM PC compatibility has been a thing for more than four decades, but while things have changed massively, it’s only in the last decade or so that the recommended specifications for compatibility with Windows 10 or 11 have precluded PCs offering legacy boot.

What it can’t do
So you can boot DOS from a USB flash drive, and it works well. But what use is DOS in the 2020s? It’s little help for BIOS updates any more; UEFI made that obsolete. DOS can’t read NTFS or any other modern file system, so it’s no use as an emergency rescue disk. There are few drivers for modern sound or network controllers, and anyway it barely speaks TCP/IP. You can forget about Wi-Fi.

But it is possible to add many of these functions to DOS. We’ve investigated and tried it. You can add USB storage drivers, CD-ROM drivers, networking and TCP/IP, and drivers for some modern file systems. But the overriding limitation on DOS was the maximum of 640 kB of “base” or “conventional” memory. All the drivers must fit in there; add a few, and soon there’s not enough left to run any apps. There were all kinds of tricks to extend or expand this, and the last generation of DOSes offer memory managers as standard that can do this. Two problems make this much less useful, though.

- Advertisement -

One is that any such memory manager must be manually customized for each and every individual machine they run on. Move one machine’s customizations to a different PC, and the chances are that DOS won’t boot. Smarter memory managers exist that could do this optimization automatically, and one of them, Qualitas 386MAX, is now GPL3 FOSS. Sadly, though, in our testing, they can’t handle the speed of even a 20-year-old CPU, and they freeze on loading. If anyone has got 386MAX working on any 64-bit chip, do please let us know how. Between these two factors, though, doing fancy memory management is sadly off the menu, and that disbars a lot of the fancier DOS enhancements.

By 21st century standards, DOS is so tiny and simple that it can run on almost anything. It has a library of thousands of apps, including some very powerful tools. Many were shareware or public domain, and are legal to use for free. Even many formerly commercial apps are legally freeware now. As an example, there’s a good assortment at the FreeDOS repo. FOSS was not a big thing in the DOS era – it predates the invention of the GPL, for instance – but DOS versions of some of the big-name FOSS apps, such as Emacs and Vim, do exist.

But it’s very limited. It’s a standalone OS – it has no networking that can talk to anything modern, and even that’s a lot of work. On modern kit, it also has no sound, very limited graphics, and famously, no multitasking.

- Advertisement -

And what it can
Then we had a thought. There’s one purpose where being the digital equivalent of a hermit in a cave in the desert is an advantage. A function for which a total lack of ability to connect to a WLAN and access the Web is a desirable thing: a standalone, non-networked, multimedia-free writing machine.

Early versions of many of the big-name word processors ran on DOS, including the classic WordPerfect and the original Microsoft Word. There are other writers’ tools, too, such as Symantec’s GrandView outliner. Not all are free to use these days, but a surprising number are. For instance, one of the most popular British apps from the 1980s boom times, Arnor Protext, is now freeware. Even some of the big names, when the last inheritor ceased trading years ago, as we described regarding MicroPro’s WordStar last year.

Outliners, the writer’s friend. Symantec made its DOS one freeware long ago – click to enlarge

Microsoft Word 5.5 came out in 1990 and was the first DOS release with a modern CUA user interface – in other words, drop-down menus using standard keystrokes. It still works well and Microsoft released this version as freeware in 1999 as a Year 2000 fix for all previous versions of Word for DOS and OS/2. (Unfortunately, this doesn’t apply to Word 6.0 for DOS, which was the final DOS version and is a little more pleasant to use.)

In the late 1990s, Microsoft made Word 5.5 for DOS freeware as a Y2K fix. Thanks, Bill! – click to enlarge

This depends on personal preference, but for us, an old laptop with DOS and some powerful, capable apps is a pleasant writing environment. We’ve tried some dedicated writing hardware. As part of our research for this article nearly a decade and a half ago, this vulture bought himself both a Cambridge Z88 and an Amstrad NC100. They are lovely devices, but getting material on or off them is onerous in the 21st century. The next step was devices with easier transfer: they simply pretend to be a keyboard. We started with an AlphaSmart 3000, an “amazing” $19 “piece of junk,” moved up to a slightly more modern AlphaSmart Neo, and finally to an AlphaSmart Dana Wireless. All are, for their many limitations, lovely devices. We are too averse to spending money to own higher-end kit such as anything from the Freewrite range of machines, or the ReMarkable keyboard, which we wrote about in 2023, when we also mentioned the Pomera digital typewriter. They look great fun – which is more than we can say for their keyboards – but they are not cheap.

They are good at what they do, but a bigger screen, a high-quality laptop keyboard, and a rich word processor are more pleasant and productive for us.

True, you could run a Linux distribution and just not install a GUI and use the text console. The key problem is that there are very few tools for writers of human languages. Most console text editors are for writing program code. Worse still, the learning curves of Vim or Emacs are formidable and forbidding. (We’ve been using Vi-type editors since 1988 and still detest it. Emacs is, if anything, worse.) There are better text editors but they are still aimed at computer text, not creating human language.

One of the very few console-mode word processors is David Given’s WordGrinder, which is extremely limited by design. Even here, you also have to master the basics of using the shell. From the Linux text console, you could even go online, check your email, and mail files to yourself. The snags are that it’s hard work and it destroys the distraction-free nature of running standalone DOS, which has more and better apps for writers.

A USB-bootable DOS
The result of the holiday season at the end of last year is our USB-DOS project on GitHub. It’s a – so far, very small – collection of images of bootable USB keys. There are both FAT16 and FAT32 images. The FAT16 image will fit on a 256 MB key, if you can still find one that tiny; the FAT32 image will fit on a 4 GB key with a lot of room to spare. The first release, version 1.0, contains MS Word, Arnor Protext, an outliner, and the WordPerfect Editor. It boots straight into a graphical menu that lets you run the apps without ever even seeing DOS’s command line. The second release, version 1.1, is nearly twice the size, but that’s because it adds in the DOS components from Robert Sawyer’s WordStar 7 archive, including file conversion utilities, and substantial documentation as PDF files. For that reason, we also added Adobe Reader for DOS.

The official Adobe PDF viewer for DOS is included, and it even supports SVGA – click to enlarge

The key is based on the latest version of SvarDOS. As we wrote last December, the SvarDOS project recently switched from the FreeDOS kernel to using the Enhanced DR-DOS kernel. This is derived from Udo Kuhnt’s DR-DOS Enhancement Project, which started with Caldera’s short-lived 1996 source code release. After releasing the source code to the DR-DOS kernel and a few core utilities, Caldera got cold feet. It took DR-DOS commercial again, adding several important enhancements such as FAT32 support. Kuhnt replicated most of this in his continuation of the open source code release.

Fedora 42 has the Answer, but Ubuntu’s Plucky Puffin isn’t far behind

Ninite to win it: How to rebuild Windows without losing your mind

How to stay on Windows 10 instead of installing Linux

MX Linux 23.6 brings Debian freshness, without the systemd funk

Later, a Caldera spin-off called DeviceLogics released DR-DOS 8. This was followed by DR-DOS 8.1, which unexpectedly used Kuhnt’s kernel as well as some files from FreeDOS, and was swiftly withdrawn.

We enjoyed experimenting with SvarDOS. It’s much smaller and much simpler than FreeDOS, and it uses the same configuration file names and command line syntax that 1990s DR-DOS did, while FreeDOS is subtly different. Using SvarDOS felt as comfortable as an old shoe, so that’s what we chose.

The applications in the current version are intentionally limited. While there are some freeware versions of WordPerfect, the Windows version is still on sale, so we excluded it. We welcome suggestions, though, so long as they were either explicitly made free, or no descendants of the company still exist.

How we built it
Booting DOS from USB is easy. Once it happens, DOS sees the USB key as the main bootable hard disk in the computer, and given that DOS can only natively read FAT and FAT32, what’s on any real HDD or SSD is invisible. But this BIOS emulation magic only happens once you’re in DOS booted from a USB medium. It doesn’t apply if DOS is installed on a real hard disk. So we also needed something else to do that emulation magic. Enter the hypervisor.

If you’ve ever installed an OS from an ISO file into a VM, you know that to the guest OS, an ISO attached to a VM looks like an optical drive. The same applies to a USB key attached to a VM. VirtualBox is FOSS and makes this relatively easy, although the documentation is not clear. As you might expect of The Reg FOSS desk, we usually work on Linux host machines. The following is substantially more difficult on a macOS host, and we’ve found it unreliable. Summary: don’t use a Mac. We haven’t even tried on Windows, as life is just too short. If you prefer another hypervisor, you’re on your own.

There are two stages to the procedure. Both are essential, and so is the sequence:

Step 1
Make your user account the owner of the USB key’s device node. Otherwise, when you’re running VirtualBox as the normal user, it can’t access the device and your VM will fail to start with unhelpfully inscrutable errors. The command is as simple as:

chown lproven:lproven /dev/sdc

Insert your username there in place of mine, obviously. Remember this command: you must re-enter it every time you reboot the computer, or even just remove or reconnect the USB key.

Step 2
Use the VirtualBox command line to create a fake VirtualBox .vmdk device file that points to a USB key. For example, our test machine has two SATA SSDs (/dev/sda and /dev/sdb), so the first USB key we insert becomes /dev/sdc. Change to your VirtualBox VMs directory, and type:

VBoxManage createmedium disk –filename sdc.vmdk –format=VMDK –variant RawDisk –property RawDrive=/dev/sdc

The above command results in a tiny device file called sdc.vmdk that points to whatever is currently /dev/sdc. We advise that you don’t use more than one USB key at the same time. The file is persistent, and will survive reboots and so on.

Note, though, that the permissions on the device file are not persistent, and so you must re-enter the chown command every reboot or re-insertion.

We created the bootable DOS disk image in a normal DOS VM with a file as its hard disk. We attached sdc.vmdk as the VM’s second hard disk in order to partition it and format it from DOS itself – that’s essential in order to make a bootable key.

We also created a second, test VM with sdc.vmdk as its first hard disk. The result is a VM that boots (or tries to) from the real USB key, which is very handy for testing.

A cautionary note – mounting a disk from two machines at once is a Bad Thing and will often destroy the disk. This means that if Linux mounts the DOS key when you insert it, unmount it before trying to access it from a VM. Don’t do this by ejecting the device, or it will no longer be available to the VM. It also means that you should close the VM before removing the key. Also, do not try to run two VMs at the same time that point to the same virtual drive, whether it’s a real key or a virtual hard disk.

If you know how to drive it, there’s a plain old COMMAND prompt, and lots of free base memory – click to enlarge

We are not going to go through the steps of installing and configuring DOS, or worse still, DOS memory management. They’re long-obsolete skills now, so while they were a fun nostalgic exercise to do, they probably aren’t worth teaching.

There are some limitations with this key that could be worked around. For instance, SvarDOS doesn’t have an easy way to check or repair FAT32 drives, but we are leery of including any components from Microsoft’s DOS or Windows 9x that can do this, since Windows is very much still on sale. Just use modern Windows, Linux, or macOS to repair the drive. For the same reasons, the DOS key doesn’t contain any version of Windows or any Windows software – and we won’t add it, either, so don’t ask.

As mentioned earlier, we could add drivers so the bootable key could network, or read NTFS or Ext4, or access optical drives – but only in limited ways, and at a punitive cost in DOS base memory usage. Worse still, these things increases the potential risks of using the drive. There’s no antivirus, as we suspect that DOS viruses represent no threat to modern OSes – and malware for modern OSes can’t run on DOS.

The bootable USB key image files are on our GitHub page for download, as well as a basic wiki containing some documentation and the two main DOS configuration files. To let us know about any problems or bugs, opening a GitHub issue is as good a way as any. ®

Leave a Comment
Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected & This Is Prohibited!!!

We have detected that you are using extensions to block ads and you are also not using our official app. Your Account Have been Flagged and reported, pending de-activation & All your earning will be wiped out. Please turn off the software to continue

You cannot copy content of this app