FreeDOS Spec

From FreeDOS
Jump to: navigation, search

The FreeDOS Spec was declared official January 2, 1999.

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 support

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


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.


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.


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.


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 (/).

Programming languages

We prefer that all FreeDOS programs be written in either C or Assembly. Certainly all FreeDOS "Base" programs (those programs that reproduce the functionality of MS-DOS) must be written in either C or Assembly.

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

Programming tools

Our reference C compiler is OpenWatcom C. (Borland C 3.1 was originally chosen as the reference standard because this is the compiler used to build the FreeDOS kernel. However, it is preferable to use entirely free tools to create FreeDOS.)

Our reference Assembler is NASM. (Microsoft MASM was the original reference standard because of the general availability of MASM-compatible assemblers, but NASM is now the preferred tool.)

This does not mean that everyone must use these tools to contribute to FreeDOS. That would be counterproductive, as many users may prefer other programs. Rather, this means that any C code must be compilable on OpenWatcom C, and all Assembly must be assemble-able on NASM. Good programming habits such as wise use of #ifdef statements will allow you to do this.

If you are working with the kernel, FreeCOM, Install, or Mem - these projects are hosted in the FreeDOS source code repository, and you should use Subversion to manage this code.

Reporting 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 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 Contribution HOWTO (list of suggestions) for people who are interested in getting involved with FreeDOS.


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.


Anyone may create and sell distributions of 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

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 may place whatever restrictions they like only on the .SYS file.

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.