Do-It-Yourself DOS
Microsoft would like you to believe that MS-DOS is dead, but we should all be as dead as MS-DOS! Windows-95, which is preloaded on nearly every IBM-compatible PC that is sold these days, is little more than MS-DOS 7.0 gussied up with Windows for Workgroups, the WIN32S DLL's, some 32-bit VxDs, and a new shell. Earlier versions of MS-DOS, with or without Windows 3.1x, are still running on tens of millions of machines. And MS-DOS and its clones have become a popular platform for embedded or dedicated systems, due to the dirt-cheap Intel 16-bit CPUs, a ready supply of DOS programmers and inexpensive DOS-based programming tools, and the well-understood DOS file system which makes transporting programs and data in and out of the embedded
system a trivial exercise. (This trend was foreshadowed in Robocop -- one shot from inside the visor shows the cybernetic crimefighter booting back up to a C> prompt after a total system crash.)
So MSDOS still has market-share among the motherboards, but does
it have mind-share among programmers? It's hard to know exactly, since embedded systems programmers (most of whom are actually engineers by profession) rarely cross paths with the PC-oriented programmers that read magazines like BYTE and DDJ, or vice versa. There's one thing us old-timer MS-DOS book authors know for sure -- the market for mainstream MS-DOS programming books completely evaporated after the release of Windows-95, and it had been on terminal life support for at least a couple years prior. Yet here we have a brand-new book about MS-DOS programming, and moreover a book which devotes itself almost completely to the MS-DOS kernel
and defines a whole new genre of such books. How extraordinary!
Pat Villani's FreeDOS Kernel differs sharply from the previous three generations of DOS technical books. The first generation, exemplified by the various (mostly ghostwritten) Peter Norton books such as Inside the IBM PC [1983], consisted mainly of low-brow rehashes of Microsoft and IBM documentation and relied heavily on celebrity marketing. The second generation, which I might say was pioneered by my own Advanced MS-DOS Programming [1986], went the next step beyond to flesh out the Microsoft
documentation and show developers how to build useful programs on top
of the documented MS-DOS APIs. The third generation, whose archetype
was Andrew Schulman's Undocumented DOS [1990], dug into the
muck of DOS and explained how its components fit together and why it
behaved the way it did.
FreeDOS Kernel takes a new approach and stakes out its own territory. It presents an entirely algorithmic, functionally-oriented description of the
DOS kernel and comes complete with a working model: DOS-C. DOS-C is
implemented almost entirely in a high-level language (C) and is basically a stripped-down version of DOS/NT, a reentrant microkernel-based operating system that Villani wrote to support embedded systems projects. The DOS-C kernel makes no pretense at being a complete MS-DOS clone -- it exports the documented MS-DOS API and runs "well-behaved" MS-DOS applications. Structurally, any resemblances between DOS-C and MS-DOS are coincidental; for example, DOS-C uses a completely different boot strategy than MS-DOS. In a
sense, DOS-C is (as the book's cover states) an MS-DOS "emulator," although the kernel and applications are running as native code and not under the supervision of any other program.
How are FreeDOS and DOS-C related? In spite of its title, the book FreeDOS Kernel is really not about FreeDOS per se. FreeDOS is an Internet-based collaborative project to create a completely free MS-DOS- compatible operating system, patterned loosely after the GNU project for UNIX and using the GNU "Copyleft." Pat Villani has donated the DOS-C kernel to the FreeDOS project and it forms the core of the FreeDOS distribution. The diskette that accompanies the book includes a bootable copy of DOS-C, including a
simple command interpreter (COMMAND.COM) written by Villani. The source code on the diskette is intended to illustrate the discussions in the book and is limited to the files needed to rebuild DOS-C. The FreeDOS distribution, on the other hand, includes a more extensive command interpreter written by Tom Norman, a variety of utilities contributed by other authors, and a free C compiler written by Dave Dunfield. More information and source code for FreeDOS components can be found on the FreeDOS web site:
http://sunsite.unc.edu/pub/micro/pc-stuff/freedos/freedos.html.
How will FreeDOS Kernel (the book, not the software) fare on the frantically confused, insanely overcrowded, Java-obsessed trade book scene? The sad truth is that it will probably sell only a few copies. The design and editing are kitchen-table-desktop-publishing quality, and R&D's marketing resources are limited. The embedded systems programmers who could really use this book are unlikely to ever hear about it, unless they stumble on this web page. It's interesting to speculate on what a radically different treatment this book might have received if it had fallen into the hands of Andrew Schulman when he was acquiring books for his Programming Series at Addison-Wesley.--Dr. Dobb's Electronic Review of Computer Books