FreeDOS Spec

This document maintained by
Jim Hall, Morgan Toal


This document will be updated periodically by the maintainers listed above. Maintenance will likely occur once every 12 months, with input from the members of the FreeDOS community. If you would like to see a particular change be made to the FreeDOS Manifesto, please contact either of the maintainers, and your suggestion will be considered.

You are also encouraged to use the FreeDOS mailing list as a public forum for comments and suggestions about FreeDOS. The mailing list is currently found at www.freedos.org.


Design Goals

The goal of the FreeDOS Project is to create another implementation of MS-DOS. DOS is a popular system, and there is plenty of PC hardware already available that is ready to support it. Microsoft will not develop DOS forever, and one cannot count on third-party commercial entities to continue DOS. I feel it is then up to those on the Internet to develop their own DOS (FreeDOS) and I feel there is a lot of support for this type of project.

We intend to write a free replacement for MS-DOS; therefore, our first goal must be to achieve MS-DOS compatibility. We have chosen to become compatible with MS-DOS 3.3, because it is our opinion that MS-DOS 4.x, 5.x, and 6.x are really just improvements upon MS-DOS 3.3. Expanded memory support was improved, and some other things fixed, but on the whole the underlying DOS kernel didn't change that much.

The MS-DOS 3.3 compatibility extends only to the FreeDOS kernel. FreeDOS programs should be compatible with MS-DOS 6.22, because those are the features that users will be most familiar with.

FreeDOS should not be targetted towards certain users. That is, the end product should be something that programmers and non-programmers may both enjoy and find useful.

CPU's To Be Supported

The FreeDOS kernel and all FreeDOS programs (utilities, drivers, compilers, etc.) should run on all levels of PC hardware. FreeDOS should operate on processors as low as the 8088 (XT) with as little memory as 640k.

I do not think there is a problem to distribute optimized versions of the FreeDOS or FreeDOS programs for the 80386 and above. Any FreeDOS program may choose to take advantage of a '386 or other enhancement if detected, but the program should still run on low-end hardware such as the XT.

Exceptions to the XT rule are programs like EMM386, which were originally specified by MS-DOS to run on a '386 or better. Only if a program that was originally distributed with MS-DOS, that specifically says it will run on a certain PC architecture, may be written to support only that PC architecture.

Properties Of FreeDOS

FreeDOS Kernel

The FreeDOS Kernel (DOS-C) must respond properly to all recognized DOS kernel interrupts. The de-facto standard reference for DOS interrupts is Ralf Brown's Interrupt List.

Refer to the Appendix, DOS Kernel Interrupts (extracted with permission from Ralf Brown's Interrupt List, release 58) for the complete list of DOS kernel interrupts that must be accepted by our kernel.

Config.sys Entries

All Config.sys entries must be 100% compatible with MS-DOS usage. Other entries may be added; this is not an exhaustive list.

Refer to the Appendix, Config.sys for more detail.

FreeDOS Commands

All FreeDOS programs must be 100% compatible with MS-DOS commands out-of-the-box. Any additional features may be added as extensions, or using different command line options or config files.

Commands may be implemented either as internal to the shell or as external programs; no restrictions will be set specifying which commands must be internal and which must be external, with the exception of a few batch commands. This is a variation from MS-DOS, but we feel it is worthy.

Refer to the Appendix, Commands Behavior for more detail. The Spec only addresses those commands that reproduce the functionality of MS-DOS.

Date Format

All FreeDOS programs must be able to correctly handle the Year2000. Ideally, all programs should use and report 4-digit years, and the year range must extend into 20yy.

For compatibility with some existing software, the programmer may choose to use a 4-digit or 2-digit year. We recommend you avoid using 2-digit years. If a 2-digit year must be used, the year must be in the range 00-99. If the year is yy:00-79, assume 20yy. If yy:80-99, assume 19yy.

The date must be read and displayed in the format that is specified by the country code. American standard is usually mm/dd/yyyy. If you do not know how to use different date formats depending on the country setting, then please use the American standard.

Dates may be delimited by periods (.), hyphens (-), or slashes (/).

Language To Use

[This should affect only the MS-DOS stuff.]

[Use of any language when writing extensions is implied although we strongly recommend that you stick with either C or assembly.]

All of the FreeDOS utilities that reproduce MS-DOS functionality are to be written in either C or Assembly, to facilitate maintenance. Please refer to the Programming Tools section, below, for the reference standard compiler and assembler to use.

Programming Tools To Be Used

Our reference standard for a C compiler will be Borland C 3.1. Our reference standard for Assembly will be Microsoft MASM. Borland C 3.1 was chosen as the reference standard because this is the compiler used to build the FreeDOS kernel. Microsoft MASM was chosen as the reference standard because of the free availability of MASM-compatible assemblers. The existing code base was also a deciding factor in choosing a reference standard.

Because these tools are commercial does not mean that everyone must purchase these tools before they may contribute to FreeDOS. That would be counterproductive, as many users cannot affort or otherwise locate these commercial programs. Rather, this means that any C code must be compilable on Borland C 3.1, and all Assembly must be assemble-able on Microsoft MASM. Good programming habits such as wise use of #ifdef statements will allow you to do this.

If you do not have access to an assembler, we recommend the Arrow Assembler, which is a free assembler that is a superset of Microsoft MASM.

Borland (Inprise) has released their older C compilers for free from their Community Museum web site. You can download Turbo-C (2.1) for free from here. Any C program you write using TC21 will compile under BC31, so you will automatically be following the FreeDOS Spec.

The [free] Pacific C compiler, by HTSoft, seems to be a nice sub-set of the Borland C compiler. I found a few differences with inline assembly, and some API has changed (note: findfirst and findnext are implemented in a slightly different way) but otherwise Pacific C seems to be very compatible with Borland. This is good, because that means that it agrees with the FreeDOS Spec. If you write straight C using Pacific C, then most of your code should compile fine under the reference standard compiler. Use of #ifdef statements will allow you to work around any incompatibilities.

How To Report Bugs

We welcome your comments, suggestions, and problem reports. When reporting a bug in FreeDOS, email the program maintainer if possible. Provide a complete description, including how to reproduce the bug, and always include your return email address so the author can contact you if more information if needed

Refer to the Appendix, Reporting Bugs for more detail.

How To Contribute

Anyone who wants to join the FreeDOS Project should first read the FreeDOS Maintainers Lists. This lists the software that has already been written for the FreeDOS Project. Looking at this list first will help prevent duplicated effort.

People who are interested in writing programs for FreeDOS may be interested in subscribing to the FreeDOS Developer mailing list, fd-dev. You can join this by visiting the link on www.freedos.org. The mailing list is where most of the discussion about FreeDOS happens these days. Programmers talk about their ideas here. We get a chance to review new changes, new libraries, new programs, and everyone has the opportunity to suggest improvements.

But you don't have to be able to write programs to contribute to the FreeDOS Project. There are many things that still need to done, which do not require programming experience.

There is a list of suggestions for people who are interested in getting involved with FreeDOS.

Copyright Status

Any effort that goes into writing a FreeDOS would, of course, be redistributed in both binary and source code form. Therefore, we urge programmers to release their software under a distribution agreement, such as the GNU General Public License (GPL), which says in part from its Preamble:

The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.

When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.

Restrictions Or Rules For Distribution

Anyone may sell a GPL'd operating system (such as FreeDOS) so long as there is a distinction made as to what the customer is actually buying. That is, it must be made clear that the distributor is not claiming that they own or wrote the GPL program, and that they don't reserve any rights to the GPL program.

The GNU GPL says:

To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.

For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.

Additionally, the distributor must understand that any changes they make to the GPL program must be identifed and must be released under the GNU GPL. For example, if someone adds FAT32 support into the FreeDOS kernel, then the patched kernel falls under GPL and must be freely available. However, if they add FAT32 support as a .SYS file and simply bundles the .SYS file with the FreeDOS kernel, then they can charge for that piece of code only.

The idea is to protect the free software and their authors. No one else should be able to take their code and misrepresent it, or worse, illegally or unethically profiting from it.

Additionally, they can sell their own proprietary (i.e. closed-source) app, bundled with FreeDOS, and charge for their distributed work as long as their work does not make any changes to the GPL code we wrote and maintain. They must follow the GPL and give us credit for our work, offer the GPL'd source with their distribution or extend an offer to supply the source for a reasonable cost.

Persons interested in distributing copies of FreeDOS should download a copy of the GNU GPL and see how it applies to your specific situation. Read it carefully and have it reviewed by a lawyer, just as you would any other license you would consider for software redistribution; the GNU GPL is a legal document.


Changes to this document

Oct 1999: Removed the footnote from the section about bundling FreeDOS with a proprietary program, and added extra text to replace the footnote.

Jan 1999: Added comments about Pacific C being a suitable replacement for Borland C. Some other minor changes.

Sep 1998: Rather than write an entirely new spec, I have decided to update the Manifesto, and provide detail where it is needed. The content has been shifted around, and perhaps reworded, but this is still the FreeDOS Manifesto that was originally made available in 1994. Additional information has been pulled from various sources, and added in the appendices.

21 Apr 1998: Annotations added. Body of document remains the same. The SunSITE ftp area is still there, but now FreeDOS has its own domain name and web page, at www.freedos.org. The Coordinator's email address has also changed. Hannibal Toal is the new Coordinator. Most FreeDOS discussion these days happens on the FreeDOS mailing list, which you can subscribe to from the web page. But many users on comp.os.msdos.misc and comp.os.msdos.programmer are generally knowledgeable about FreeDOS.

16 Oct 1994: First draft of document posted on comp.os.msdos.misc An ftp site is now available for downloading FreeDOS at SunSITE. Email the FreeDOS Coordinator about that. A discussion forum has opened up on comp.os.msdos.misc. This is where we plan to discuss our projects and our goals. Please feel free to contribute to the discussion.

July 1994: FreeDOS was announced as PD-DOS around the beginning of July, 1994, as another implementation of DOS.


Copyright © 1998 Jim Hall

Unless otherwise stated, FD-DOC HOWTO documents are copyrighted by their respective authors. FD-DOC HOWTO documents may be reproduced and distributed in whole or in part, in any medium physical or electronic, as long as this copyright notice is retained on all copies. Commercial redistribution is allowed and encouraged; however, the author would like to be notified of any such distributions.

All translations, derivative works, or aggregate works incorporating any FD-DOC HOWTO documents must be covered under this copyright notice. That is, you may not produce a derivative work from a HOWTO and impose additional restrictions on its distribution. Exceptions to these rules may be granted under certain conditions; please contact the FD-DOC HOWTO coordinator at the address given below.

In short, we wish to promote dissemination of this information through as many channels as possible. However, we do wish to retain copyright on the HOWTO documents, and would like to be notified of any plans to redistribute the HOWTOs.

If you have any questions, please contact the FD-DOC coordinator at jhall1@isd.net.

Hosted by uCoz