📰 newsreader

twostopbits score 0.16 好み 0.50 en

MS-DOS 2への道

原題: The Road to MS-DOS 2 (substack.com)

ms-dosunixoperating systemsmicrosoftibm pc86-dosxenixfat file system
原文 ↗
原文(英語)を表示

The Road to MS-DOS 2

One little step toward UNIX

MS-DOS was an unwanted child. Tim Paterson developed its predecessor 86-DOS only because he urgently needed some kind of operating system for the 8086-based CPU board his employer Seattle Computer Products (SCP) had already released. He really wanted to create a “proper” multitasking system, and knew how to do it, having developed something similar for the Z80 as a school project1. However, the system was needed quickly, so he and his boss agreed to start with something “quick and dirty” that would resemble Digital Research’s CP/M - a minimal operating system developed in 1974 for Intel 8080 based computers with very little memory.

Microsoft’s founders Paul Allen and Bill Gates were also getting ready for 16-bit microprocessors. Unsurprisingly, they decided to bet on a system popular on 16-bit minicomputers: UNIX, developed by AT&T’s Bell Labs in the early 1970s and freely distributed to universities. In February 1980, Microsoft licensed UNIX V7 source code from Western Electric (AT&T’s manufacturing arm). The name was not licensed, so on August 25, 1980, Microsoft announced its own UNIX-based product named XENIX.

Initially, Allen and Gates had a lot of confidence that the portability and flexibility of UNIX would make XENIX the standard operating system on 16-bit microcomputers. Once they actually had the UNIX source code, it turned out it was a poor fit for the current generation of microprocessors, especially the Intel 8086. Worse, it was a memory hog; it grew a lot since Ken Thompson developed the first version in 1969 on a PDP-7 minicomputer. Soon, Microsoft made an arrangement with SCO, a small company specialized in UNIX consulting, to take over most of the work on porting XENIX to target platforms.

When IBM revealed its plan to develop an Intel 8088 based personal computer that would start with only 16 KB of RAM, it was obvious that there was no way XENIX could be squeezed into such a constrained environment. Like it or not, IBM needed something like CP/M, and after an unsuccessful attempt to license it from Digital Research, they went back to Microsoft, which in turn acquired 86-DOS from SCP. The operating system was adjusted for the IBM PC, somewhat polished, renamed PC-DOS and shipped in August 1981. Microsoft retained the rights to sell it to other customers under the name MS-DOS.

Yet, there was a nagging feeling that a single-tasking CP/M clone was inadequate for the new generation of personal computers. Digital Research released multi-user, multitasking MP/M-86 in September 1981 and announced the single‑user multitasking Concurrent CP/M in early 1982. In response, Microsoft came up with a plan for tiered approach to its operating systems: single-user/single-tasking MS-DOS at the bottom; multi-user/multitasking XENIX at the top; and in the middle, something called XEDOS: a single-user version of XENIX. This “pyramid of upward-compatible operating systems” was announced in a Byte Magazine editorial in January 1982.

XEDOS was apparently more than a marketing ploy; Microsoft and SCO had tried to remove features from XENIX until it could be usable on the PCs of the era, but with little success. In his 2011 book Idea Man, Paul Allen wrote: “Even a scaled-down version of Unix was too demanding for the 8086 chip”.

In the July 1982 edition of Byte, the second part of an article comparing MS-DOS and CP/M-86 analyzed, among other aspects, the future prospects of the two leading 16-bit operating systems. For CP/M-86, the path was obvious - the next generation Concurrent CP/M-86 had been introduced at the West Coast Computer Faire in March. As for Microsoft, its representatives talked about MS-DOS 2.0 without mentioning XEDOS. It was clear the plan was to extend MS-DOS with new features and “a number of Xenix-derived utilities” rather than scale down XENIX. The upward path from MS-DOS to XENIX was not clear.

The change in plans happened sometime in early 1982, after IBM requested a new version of DOS to ship with its upcoming IBM PC XT model. The XT was a modest incremental improvement over the original PC, and IBM clearly communicated that it expected MS-DOS 2.0 to have similarly restricted scope: supporting the new built-in hard disk was all they really wanted. Keeping the operating system small was much more important to IBM than adding new features. Bill Gates was happy to oblige, but Paul Allen would have none of it: after consulting with lead DOS developers Mark Zbikowski and Aaron Reynolds, Allen became convinced that DOS needed a clean rewrite to support features he felt were essential to keep MS‑DOS relevant.

The first and most important feature was extending the FAT file system to better support hard disks. Allen wanted to replace the flat file system with a hierarchical structure, similar to UNIX, with a root directory and nested sub-directories as the way to organize files on a disk. One of the consequences would be introducing file handlers instead of the CP/M-like File Control Blocks, although the latter were kept for compatibility.

The second feature was dynamically loadable drivers. MS DOS 1.x, used the monolithic BIOS module to access all hardware. Any changes, including new peripherals, required recompiling or at least patching the BIOS. In MS-DOS 2.0, BIOS was to be expanded to read installable drivers without modification. A configuration file would be introduced to point BIOS to installed drivers, and it would load them as needed.

The third major feature was a limited support for background print spooling. The idea was to provide a small utility that would run in the background and take over printer output so applications would no longer have to block while sending data to the printer. Full multitasking, as implemented by UNIX or MP/M was not considered for MS-DOS 2.0.

In addition, a number of features directly inspired by XENIX were added, including find, more, sort and fc, along with utilities needed to support the new hierarchical file system, such as chdir and mkdir. Some form of IO redirection was also to be included, but obviously not in-memory pipes, given the single-tasking nature of MS-DOS.

IBM was not happy with Allen’s ambitious plans:

But it soon became clear that IBM was committed to keeping DOS 2.0 as close as possible to the eight thousand bytes used by DOS 1.1, so as not to disrupt their existing user base. If our new DOS was too memory hungry, IBM feared that smaller PC systems would run out of room for some popular applications. And they weren’t accustomed to contractors going beyond their specs, even if it meant they were getting more for their money.

Paul Allen: Idea Man

Bill Gates was very reluctant to alienate IBM, which he internally called “the customer”. After receiving complaints from Boca Raton, he had a shouting match with Paul Allen (who called IBM “the idiots”) in front of a terrified Mark Zbikowski. Eventually, Gates gave in and let Allen’s team implement the features they wanted, as long as the delivery date was met.

The MS DOS 2.0 team consisted of only six people: Paul Allen, Mark Zbikowski, Aaron Reynolds, Nancy Panners, Chris Peters, and Mani Ulloa2. Neither of the MS-DOS 1.0 developers (Tim Paterson and Bob O’Rear) was involved in the 2.0 development.

The first version of MS-DOS 2.0 shipped with IBM PC XT as PC-DOS 2.0 on March 8, 1983. It required about 20 KB of RAM, far more than MS DOS 1.0, so both versions continued to be sold simultaneously for a while.

To understand the scale of the rewrite, we can compare the sources for MS-DOS 1.25 and 2.0 in the GitHub repository for MS-DOS. Unfortunately, the comparison is not completely straightforward, as some utilities such as chkdsk and sys are available in binary form only in 1.25 but also with source in 2.0. That said, in the 1.25 source tree, we find only 7 files, including tools such the assembler (ASM.ASM), hex2bin (HEX2BIN.ASM) and a Z80 to 8086 translator (TRANS.ASM). Entire DOS kernel source was in a single file (MSDOS.ASM); ditto for BIOS (IO.ASM) and COMMAND.COM (COMMAND.ASM).

The 2.0 source directory (still a single directory) contains 118 ASM files, plus documentation. The kernel, BIOS and COMMAND.COM are split among many files, trying to reflect their structure. Still, some code was directly transferred: routines like FNDCLUS, BUFSEC, BUFRD, BUFWRT, DATE16, and READTIME from the original MSDOS.ASM appear with the same names, same comments, and nearly the same code in other files.

Files called XENIX.ASM and XENIX2.ASM contain implementation of some of the new commands ported from UNIX.

Not all DOS 1.25 functionality was carried on to 2.0. The assembler, the Z80 to 8086 translator and HEX2BIN are present only in the original MS-DOS.

← 一覧に戻る