Comparing CP/M-86 and MS-DOS

MS-DOS was a faulty clone of CP/M created by Tim Patterson of Seattle Computer Products. I say that it’s a faulty clone because the attempt was to make an exact duplicate of CP/M for 8086-based processors. Although the 8086 was the successor of the Intel 8080, it wasn't compatible per se. The purpose, according to Patterson, was due to Digital Research being too slow to create a CP/M variant for the 8086. In order to start selling Seattle’s 8086 computer kits, they had to offer an operating system. This is why Patterson decided to create QDOS (Quick and Dirty DOS), which because 86-DOS, which became MS-DOS/PC-DOS.

Why do I say it was a faulty clone? It was, mainly, because it incorrectly implemented several of the function calls. For instance, MS-DOS lacked the ability to make rich, full screen color applications without going directly to the hardware. CP/M function 9, “Display String”, had no ability to handle escape codes. Escape codes are the precursor to the “ANSI Escape Sequences” that became popular later on. Escape codes allow you to place the cursor anywhere on the screen, change the output color, delete characters and turn on the clock display (another feature which MS-DOS lacked).

Why is that such a big deal? Let’s just say that something like a word processor needs to be able to write data to the screen at different positions, and not just print information sequentially. You could write a word processor using CP/M without any knowledge of the computer’s hardware. You could not do this with MS-DOS. In MS-DOS, you would have to use BIOS calls to place the cursor on the screen and to write characters with different colors. You could, alternatively, write directly to the screen buffer. Both of these things require the software to know what kind of hardware your program is running on. That defeats the spirit of why Gary Kildall wrote CP/M in the first place. Gary wanted to provide a complete interface for software developers to write software independently of the user’s hardware.

Since this article is to compare CP/M-86 and MS-DOS, we need to look at the OS that Digital Research released in 1981. CP/M-86 gave software developers much more flexibility in creating software, taking advantage of the 8086 segmented architecture. MS-DOS did not do this. The MS-DOS “executable” file contained a lookup table. When MS-DOS loads the executable, any place where the segment is dependent on where the program is loaded into memory, DOS looks finds it in the lookup table and changes the value in RAM. Every DOS application assumes that it owns the all of the memory in the PC.

CP/M-86 did this in a much more intelligent way. A program will tell CP/M-86 how much RAM is mandatory for each program or data segment, and it also allows a program to request more memory, if available. In addition to the normal segment registers, a CP/M-86 program can access up to 16 of these segment registers. To the casual person, this may not mean much. However, this allowed CP/M-86 to manage memory effectively. This way, a program need only use the amount of memory it actually needed. This was important because Digital Research was moving to multitasking operating systems. In a multitasking OS, a program cannot just assume it owns all the RAM. MS-DOS had no facility to accommodate this.

This came to light when Digital Research released DOS Plus in 1985. DOS Plus was a precursor to DR DOS, which was a full MS-DOS clone. DOS Plus gave you the best of both worlds. It can read MS-DOS and CP/M-86 disks and it can run programs created for either OS. It can also multitask up to four CP/M-86 programs. However, only one MS-DOS program can run. This is due to the reasons already given. This showed how Digital Research was forward thinking in its approach to operating system design. Microsoft never saw MS-DOS as a long-term solution. For years, Microsoft wanted XENIX (a UNIX variant for the 8086 processor) to be their future.

However, XENIX was not compatible with MS-DOS, and it was really too slow to be accepted as a platform at the time. Digital Research continued to enhance CP/M, and eventually had variants of CP/M that provided multitasking, multiuser and other facilities that made it far superior to anything that Microsoft was selling at the time.