We ❤️ Open Source
A community education resource
Another open source DOS: A new reference for how MS-DOS worked under the hood
Microsoft has released MS-DOS 4.00 under an open source license.
I got my early start in desktop computing by programming in BASIC on the Apple II computer. But most of my computer experience in the 1980s and into the 1990s was with DOS, the Disk Operating System for the original IBM Personal Computer, dating back to 1981.
What is DOS?
If you haven’t used DOS, it was a 16-bit command line operating system that ran one program or application at a time. DOS was very simple, and did not provide a Hardware Abstraction Layer like other operating systems that followed it. That meant that whenever a DOS program needed to access the hardware to do some task, such as play a sound to the speakers or dial a modem, the program accessed the hardware directly.
DOS was limited by its rushed design from 1981, inheriting several design decisions that made it easier to develop quickly. For example, DOS is famous for its limited memory. You may have heard the phrase 640k ought to be enough for everyone—that refers to the base memory support on DOS, limited to 640 kilobytes of memory.
But DOS and DOS applications made the best use of that limited memory, made better by the addition of Extended Memory, and then Expanded Memory, to allow programs to use more memory installed on the system. DOS programs dominated the personal computing scene in the 1980s, and quickly moved into the office. While uninspiring to today’s minds, DOS spreadsheets and text-only word processors were the daily workhorses in every office. And it seemed there was a DOS application to fit every niche, whether that was databases, utilities, tools, terminals, desktop publishing, games—and an endless list of all kinds of programs.
DOS was also quite simple, which made it easy for beginners to learn what made computers work. The computer booted the DOS kernel, which reads the CONFIG.SYS
file to set parameters. Then the kernel ran a user shell, usually COMMAND.COM
, which in turn read the file AUTOEXEC.BAT
to set up the user environment. After that, the user could run programs from the command line.
And that’s why DOS was such a powerhouse in the 1980s and early 1990s. Its simple architecture and design made it easy to learn and easy to use, and was more than powerful enough to support the applications that people needed to run.
I was so fond of using DOS, and so productive working in it, that when Microsoft announced in 1994 that the next version of Windows would kill DOS, I decided to create an open source version of DOS so I could keep using my favorite desktop operating system rather than move to Windows. FreeDOS is distributed under the GNU General Public License so it will always be free for everyone to use. I’ve been working with FreeDOS ever since—and yes, I still use it to run some of my favorite DOS programs at home.
Open source DOS
FreeDOS hasn’t always been the only open source DOS. In 1996, Caldera announced OpenDOS, a re-release of DR-DOS under a source available license that wasn’t really open source. In 2014, Microsoft partnered with the Computer History Museum to share the source code to MS-DOS 1.1 and 2.0. Unfortunately, that wasn’t very open source either; the license was essentially look but do not touch.
With these missteps, it seemed FreeDOS really was the only open source DOS option.
To everyone’s surprise in 2018, Microsoft released the source code to MS-DOS 1.25 and 2.0 on GitHub. This time, they did it the right way, and adopted the MIT open source license. The MIT license is also known as the Expat license and is compatible with the GNU General Public License. The Free Software Foundation (via GNU) says the Expat license is “a lax, permissive non-copyleft free software license, compatible with the GNU GPL.” That means you can reuse code from an MIT-licensed project in a program that’s distributed under the GNU General Public License.
This was not the first time Microsoft embraced open source. Microsoft has had developers contributing to Linux and other open source projects for years, and earlier in 2018 Microsoft acquired GitHub, a very popular platform for open source projects.
But the 2018 release of the old MS-DOS versions was significant because there was no business model behind it. Microsoft released the source code to MS-DOS 1.25 and 2.0 because they recognized that DOS was a significant milestone in computing. They could have simply released the programs without source code, allowing anyone to experience them for the sake of history. Instead, they released the source code under an open source license, so people could explore the source code to understand how it worked.
Microsoft releases MS-DOS 4.00
On April 25, 2024, Microsoft announced the surprise release of MS-DOS 4.00, complete with source code. This was no easy feat; as the blog post explains, Microsoft partnered with IBM for portions of the code, so releasing the source code required working with Microsoft and IBM to review code and obtain clearances to share the source code under an open source license.
MS-DOS 4.00 was not particularly well received at the time, due to several compatibility bugs and instability. Microsoft released a fixed MS-DOS 4.01 to address these issues. But MS-DOS 4 was significant for several new features, including a DOS shell and a new MEM
command to show you how much (or how little) memory was available to you.
I’m very excited to see this open source release of MS-DOS 4.00. However, don’t get too excited that FreeDOS might be able to copy/paste code from MS-DOS 4.0. While the GNU license allows merging code from the MIT-licensed project, the practical limitation is that most of MS-DOS was written in Assembly, with a few things in C. FreeDOS is the opposite; the FreeDOS kernel is written in C with some Assembly. But some tools and utilities from MS-DOS might be merged into other FreeDOS programs.
Still, it’s important to recognize the big step that Microsoft has taken in releasing the source code to MS-DOS 4.00. The new open source MS-DOS means that we have a new reference for how MS-DOS worked under the hood. This will benefit everyone, not just FreeDOS. Users and developers can now examine this classic version of MS-DOS to understand not just what it does, but how it does it. And that’s a significant step forward. Congratulations to everyone at Microsoft and IBM for this release.
Building MS-DOS 4.00 on FreeDOS
If you get a “line too long” error when trying to do a build of MS-DOS 4.00, this video shows how to work around that and demonstrates a successful build:
The opinions expressed on this website are those of each author, not of the author's employer or All Things Open/We Love Open Source.