Thursday, November 22, 2007

 

FreeDOS: Lost in the Sauce

For all US readers, Happy Thanksgiving. For non US readers, today is a day in which tradition dictates that you get together with family, and stuff your face. You eat turkey, stuffing, trimmings and pie. Tradition also dictates that you do nothing but eat left overs for several days afterwards. And let's not forget "Black Friday," the day after Thanksgiving where everybody runs out and does their Holiday shopping, because Thanksgiving is traditionally the start of the "Holiday Season." This is signaled by the traditional Thanksgiving Day Parade where Santa Claus comes down and greets all the parade watchers after many floats and balloons of popular cartoon and comic figures, as well as other pop culture icons.

Fact is that Thanksgiving is a day of giving thanks. The original settlers started this in 1619 to thank God for their arrival to the new colonies where they could enjoy freedom unavailable to them in their original homeland. Fact is that in the nearly four centuries that have followed this first day of giving thanks, the original meaning of the celebration has become somewhat obscured.

Seems that the same is true of FreeDOS. For those readers who do not know who I am, FreeDOS began to take shape in 1994 after I donated a version of my original commercial operating system to the project. The first version of FreeDOS was quite literally written by me. It consisted of the kernel, a loader subsystem that was derived from a multiboot loader used in the commercial version, a command.com shell and a sys program to make bootable disks. The commercial version was portable among many different platforms, most notably 8086, 80386/486 and 680X0 processors. A lot of care went into the design of this commercial operating system which was used either in part or in whole in various applications such as FAA Flight Inspection systems, telephone switching systems and other embedded applications.

Over the years since that first code was released, many more of what I had termed "MS-DOS Warts" were written into the operating system, my command.com was abandoned in favor of another version that was written from scratch by other project members, and many new device drivers and utilities were added to make it not only a true MS-DOS look alike but extends it with a distribution that truly makes it a usable operating system for small systems. Unfortunately, it is no longer portable as much of the code base was either changed to save 3 bytes here and there, processor specific code is no longer contained in a few files, and special types defined in portab.h meant to make the code portable are either improperly used or not used at all.

Unfortunately, this makes moving the design forward to new platforms very difficult, if not nearly impossible. There is no way that you can simply recompile many of the files and expect it to operate properly on another platform, much less a non-Intel processor. I'm not saying you can't back out some changes and rewrite others. What I am saying is that it is a much bigger project than I had hoped for.

Here's some insight into the original design: the original FreeDOS kernel was an embedded operating system kernel surrounded by two compatability layers. The upper most layer implemented the DOS API and the lower layer was the machine interface, which included processor support code as well as virtual machine (VM) and I/O support. The embedded OS was highly influenced by Unix, as is apparent by the use of an fnode, which was modeled after the the Unix inode. Same is true of separate block and character I/O, also part of the design of Unix V7. The VM support was replaced by macros MK_FP and friends, although some of the original code such as fbcopy() remained. This was because the original memory manager was replaced in the FreeDOS version of DOS-C by one that implemented the MS-DOS linked list. The use of weird macros COUNT, BYTE, etc., were meant to make various types transparent, allowing me to keep objects such as bytes, signed and unsigned 16 bit integers, etc., straight across target processors.

Now, I don't want you to walk away from this thinking that I am criticizing what Jim Hall and the FreeDOS team have done since I stopped actively participating. I just wanted to shed some insight into where I have been and where I'm heading next. I will have to make certain decisions, such as whether or not to use any or all of the FreeDOS code in my new project. It may be easier to just use my original code and write extensions to handle virtual DOS tasks within the new OS. I may also go back to a POSIX compatability layer instead of DOS, given some recent discussions I've had with folks about FreeDOS and the availability of new DOS applications, but that's material suitable for another article. Suffice it to say that I found it interesting how, over the years, some of the original design goals were "lost in the sauce," just like the meaning of Thanksgiving. Now let me take the dog for a walk because the Thanksgiving Day Parade will be on TV shortly and I'd like to catch some of it before heading out to my sister-in-law's house for Thanksgiving Dinner.

Comments: Post a Comment





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]

Copyright Pasquale J. Villani