A New OS is Born
In the following text, the term “DOS” applies to the Microsoft/IBM Disk Operating System shipped with the IBM PC and compatible systems, unless otherwise noted.
It is not an exaggeration to say that DOS is an accident of history. In the late 1970s when the Intel 8086/8088 processor was introduced, the dominant microcomputer operating system was Digital Research’s CP/M (whose name was a pun on IBM’s naming and stood for Control Program/Monitor). CP/M ran on 8-bit microprocessors such as the Zilog Z-80 or Intel 8080. Application developers expected that Digital Research would port CP/M to the 8086. However, that took much longer than expected.
In 1979, Seattle Computer Products (SCP) was one of the first companies building 8086-based systems. SCP’s system, based on the S-100 bus, faced the same problem most new systems face: lack of applications. The only software SCP could offer was Microsoft’s Stand-alone Disk BASIC, a version of BASIC which was loaded from a floppy disk (rather than being supplied in the system’s ROM) and included floppy disk file management logic.
SCP was planning to develop its own advanced operating system, but Tim Paterson, a young employee of SCP, suggested developing a stopgap product to fill the immediate need for some kind of OS. To reflect the nature of the system, it was called QDOS for Quick and Dirty Operating System.
In order to make the porting of existing applications as easy as possible, Paterson decided to implement the CP/M system call interface in QDOS. A mechanical translation tool was envisioned which would automate much of the porting process, since the 8086 instruction set was already designed allow straightforward conversion from the 8080. In the end, the CP/M compatibility in DOS had little practical use, yet was the source of much controversy.
While DOS provided a CP/M compatible system call interface, there were also significant differences. Perhaps the biggest of those was in the area of disk management.
Paterson had experience with CP/M as well as several other disk operating systems (e.g. North Star DOS) and wasn’t particularly impressed with their performance. The commonly used microcomputer disk operating systems in the late 1970s typically had serious deficiencies that seem incomprehensible a few decades later.
In some cases (North Star DOS), files had to be stored contiguously; that meant performance could not deteriorate too much, but it was easy to fragment free disk space such that new files beyond certain size could not be created even though the disk was far from full. CP/M, on the other hand, could handle fragmented files, but had performance problems with large (relatively speaking) files. Each 16KB file extent required a separate directory entry. Since the directory entries for a single file were not linked, the operating system had to perform linear directory searches, with extremely poor worst case performance.
DOS used a different disk managed strategy, named File Allocation Table (FAT) after its core structure. The FAT filesystem was designed by Microsoft’s Marc McDonald in 1977 for the Stand-alone Disk BASIC. Tim Paterson was familiar with the technology and adopted it for DOS with small modifications.
The idea behind FAT was that the complete information about file allocation on the entire disk was stored in a single structure called the File Allocation Table (often with a secondary copy stored on disk). The FAT was designed to be small enough that it could be always kept in memory, even on the very memory-limited systems of circa 1980. Entries in the FAT were chained together, with a file’s directory entry (stored in a separate structure) pointing to the first element. This scheme made locating any part of a file quite fast, since no disk reads were usually needed.
The FAT was suited for floppy disks with a capacity of a few hundred KB and performed well, although it had a tendency to fragment files as the free space on a disk became non-contiguous.
One important feature of the FAT filesystem is that it is entirely independent of the underlying disk structure. Allocation units (clusters of one or more sectors) are addressed linearly, with no regard to the geometry of an underlying disk. On the one hand, that perhaps caused the FAT filesystem to miss out on certain disk-specific optimizations. On the other hand, the FAT disk structures and code were kept simple, and the system could be easily extended first to fixed disks and later to non-rotational media (Compact Flash cards and later solid-state disks).
In 1980, IBM embarked on a secret “Project Chess” headed by Don Estridge. The objective of Estridge’s small team was to define the requirements for a computer suitable for small business use. The product had to be relatively cheap to enable IBM to sell the computer at a price that was acceptable for a mass (relatively speaking) market. The end result was the Personal Computer.
IBM was soon looking for an operating system for its upcoming PC (code-named Acorn). Much like QDOS, the IBM PC was developed as a temporary throwaway product, intended to be replaced by some better designed product in the near future. IBM was using largely off-the-shelf hardware components for the PC, and the software was no different. IBM decided to outsource the software development, in part as a way to protect against potential lawsuits. If, for example, someone had claimed that DOS infringed their patents, it would be Microsoft’s responsibility, not IBMs. At that point (1980), Microsoft was not a significant target of patent lawsuits (since the company was so small), unlike IBM.
Around 1980, Microsoft was the premier supplier of microcomputer language products. First and foremost, that was Microsoft’s BASIC, which IBM decided to build into the ROMs of nearly all of its PC and PS/2 machines built before 1990. IBM also contracted Microsoft to supply an assembler, linker, plus Pascal, FORTRAN, and COBOL compilers.
However, while BASIC was going to be built into the PC’s ROM, the other tools required an operating system, which IBM didn’t have. Microsoft suggested that IBM contact Digital Research and work out a port of CP/M. But the early negotiations fell through and IBM came back to Microsoft.
On September 28th, 1980 Microsoft (Bill Gates, Paul Allen, and Microsoft VP Kay Nishi) decided to supply an operating system to IBM as well. The thinking was that the tools they already signed up to deliver would total about 400KB of (binary) code, and an OS would only add at most another 20KB. Microsoft already had Paterson’s QDOS in mind, now sold under the name 86-DOS. Microsoft was also worried that if it took IBM much longer to find a suitable operating system, it would make Microsoft’s job of porting its language products to the PC much harder and perhaps impossible to complete on time.
Porting 86-DOS to the IBM PC
In late 1980, Microsoft started bringing up SCP’s 86-DOS (nee QDOS) on the prototype IBM PC. The primary developer on this project was Robert O’Rear, whose name is immortalized in the PC DOS 1.0 boot sector.
The porting process was not easy because both the PC hardware and its ROM BIOS were still under development. To make matters more complicated, 86-DOS supported 8″ disks, while the IBM PC had 5¼” drives. In late 1980 and early 1981, Tim Paterson made several improvements to 86-DOS and implemented additional features requested by Microsoft. In May 1981, Paterson joined Microsoft and finally learned the identity of the mystery OEM customer.
86-DOS vs PC DOS
The port was completed on schedule and PC DOS was not substantially different from 86-DOS. In fact many 86-DOS executables could be run on PC DOS and MS-DOS.
The above screenshot ostensibly shows 86-DOS in a version from late April 1981. However, it was created by taking a PC DOS 1.0 image, copying 86-DOS on it (overwriting COMMAND.COM etc. in the process) and booting the resulting image in VirtualBox. In other words, 86-DOS COMMAND.COM runs on top of IBMBIO.COM and IBMDOS.COM from PC DOS 1.0 (August 1981), a true cross-breed operating system.
There EDLIN and DEBUG utilities should be familiar to any user of the early DOS versions. SCP’s assembler is not—presumably Microsoft decided not to ship the assembler with DOS and sell their own MASM (licensed to IBM) as a separate product.
The 86-DOS executables were slightly smaller than their PC DOS 1.0 counterparts, and the set was different. Note that in the above screenshot, the files dated 08-04-81 are from PC DOS, while files dated 04-18-81 are from 86-DOS. In fact it’s not so obvious that the screenshot isn’t PC DOS. The next one is:
The CHKDSK message changed slightly, from “total system RAM” to “total memory”, the latter presumably being easier to understand. But the telling difference was the command prompt, which changed from A: to A> at IBM’s request.
It should be clear that PC DOS (and MS-DOS) is more or less 86-DOS and Tim Paterson is rightfully called the author of DOS.