Hacker News new | ask | show | jobs
by musicale 426 days ago
QDOS had the advantage of being able to reimplement the CP/M-86 design rather than starting from scratch.

There were lots of disk operating systems created for 8 and 16-bit machines, as well as a number of BASIC + DOS type systems. But CP/M is the one 8-bit OS to rule them all - even running on an Apple II or C64 with a Z-80 CPU card or cartridge.

2 comments

> QDOS had the advantage of being able to reimplement the CP/M-86 design rather than starting from scratch.

CP/M was little different from the PDP-11 operating system, which it used as a model.

CP/M was not as innovative as often thought.

Both CP/M-86 and MSDOS were just an interrupt table and some implementation routines. The 8086 chip was designed around that interrupt table, so of course any OS would use it.

I assume you're talking about RT-11? Do you want to elaborate on the similarities? Although I've never used RT-11 (just CP/M, HDOS, MS-DOS, and VMS), I think they may be more superficial than you're suggesting.

Looking at https://bitsavers.org/pdf/dec/pdp11/rt11/v1_Sep73/DEC-11-ORT... (RT-11 System Reference Manual, DEC-11-ORUGA-A-D, Sept. 1973, Chapter 8, Programmed Requests) I see printing of ASCIZ strings, 16 numbered I/O channels for open files, stream (wordwise) rather than purely blockwise access to those files (though the start position is specified as a block number), an open set of device names, RADIX-50 filenames, the ability to "swap" the "user service routines" into memory temporarily so they don't have to be resident the whole time your program is running, and "tentative files" that automatically replace a permanent file if successfully closed, and asynchronous I/O (.READ and .WRITE as opposed to .READW and .WRITW or .READC and .WRITC); all of these would have been improvements over the design CP/M actually used. On the other hand, it says RT-11 only supported contiguous storage of files (like the p-System), a CRLF is automatically appended to any string you print, and the filenames are 6 characters rather than 8, which are points where CP/M wins.

The whole FCB thing, which is about 80% of CP/M BDOS, seems to have been absent in the RT-11 system call interface. I'm not sure whether it's better or worse (it's substantially more painful to use, but permits your program to allocate space for the number of open files it's actually going to use) but it's certainly a very different approach. RT-11 has .SAVESTATUS and .REOPEN to work around the 16-file limitation when necessary.

Because you can only read or write starting at a block boundary in RT-11, it seems like it usually wouldn't make sense to read less than a block. But the inability to read more than a block was a real bottleneck for I/O in CP/M, as Tim Paterson explains in the blog post I linked from https://news.ycombinator.com/item?id=43729165:

> At least part of the reason CP/M was so much slower was because of its poor interface to the low-level “device driver” software. CP/M called this the BIOS (for Basic Input/Output System). Reading a single disk sector required five separate requests, and only one sector could be requested at a time. (The five requests were Select Disk, Set Track, Set Sector, Set Memory Address, and finally Read Sector. I don’t know if all five were needed for every Read if, say, the disk or memory address were the same.)

(Actually, this is the BIOS interface; I think the BDOS interface was more reasonable, but still only able to read one 128-byte record at a time.)

Even the "Keyboard Monitor" described in Chapter 2 sounds very different from the CP/M command processor, for example, using "." as its prompt, supporting user-defined device names and command abbreviation, being able to make octal dumps of RAM and change its contents byte by byte, requiring an explicit "run" command to run programs, no way to pass command-line arguments to programs, and echoing character deletion in a teletype-friendly fashion\noihsaf\format. Most of the control keys are the same, I guess? And the editor sounds pretty similar to CP/M's benighted ED?

The things like the TYPE command, the DEL command, the 8.3 case insensitive filenames (6.3 for RT-11), the / for switches, the drive:, CRLF, etc. Anyone using RT-11 could pick up MSDOS in about 5 minutes. I know I did (I had an H-11, and bought an IBM PC).

I bought a hard disk drive for my H-11, wire-wrapped an interface board for it, and wrote the device driver for it. It was a fun project, and didn't take much time. It was straightforward. I even got RT-11 to bootstrap off of it.

Sorry, I don't think any of that stuff is a work of genius.

My profile pic on twitter is of the machine:

https://x.com/WalterBright

from before I added the HDD.

It's also been 40 some years since I touched an 11, so my memory of the details needs a refresh :-/

Some of the things you're talking about are features MS-DOS had in common with RT-11 but where CP/M was totally different; specifically, DEL was called ERA on CP/M, and CP/M didn't have switches. (Except PIP, which, bizarrely, wrapped its switches in square brackets: PIP A:=B:*.COM[W]. See https://ia902808.us.archive.org/23/items/osborne-cpm-users-g...) MS-DOS got drive letters from CP/M; on RT-11, as you might remember, instead of A:, B:, C:, etc., you had SY0:, SY1:, and DK:. (HDOS copied that, as well as /switches.) I'm not sure where the 8.3 filenames are from, but CP/M and MS-DOS had them, and, as you say, RT-11 didn't, using 6.3 instead.

So, of the six similarities you listed between CP/M and RT-11, four were actually differences; only two were actually similarities (the TYPE command and the use of CRLF), with a third debatable one (8.3 is like 6.3 in that a three-character file type code forms part of the filename in some contexts).

If CP/M had used RADIX-50 like RT-11 did, it could have had case-insensitive 9.3 filenames in 8 bytes instead of 8.3 filenames in 11 bytes. I think that would have been a big improvement.

So, I don't think any of CP/M's deviations from RT-11 are a "work of genius", but it wasn't just a copy of RT-11, "little different", as you say. It clearly deviated from RT-11 in a lot of ways, to an extent that suggests drawing from some other source. Maybe RSX-11, dunno.

The page you link to just says "Sign in to Twitter". For the sake of courtesy, I'd rather not go into how I feel about that invitation.

The differences such as A: vs SY0:, are differences only in detail. The unix command line is fundamentally different, not just different in detail. BTW, RT-11 used PIP.

> The page you link to just says "Sign in to Twitter". For the sake of courtesy, I'd rather not go into how I feel about that invitation.

It goes to my profile page. Of course, I am logged in to twitter. I had no idea that it was necessary to sign in to twitter to see my profile page. There was no nefarious intent. I am not aware of any benefit that may accrue to me from you signing up for a twitter account.

I agree that Unix was fundamentally different in many ways, but CP/M wasn't a copy of Unix either; if anything, RT-11 was slightly more Unix-like than CP/M was. Because CP/M was evidently worse than RT-11 in many apparently unnecessary ways, I suspect that it was drawing from some other source.

I didn't suspect any nefarious intent, but if I didn't tell you it had happened, you would never have known. My apologies if it sounded like I was blaming you for it.

I broadly agree, but I would quibble on the "-86" part; CP/M-86 uses a different interrupt than MS-DOS, so I suspect that the model for QDOS was CP/M-80. I'm not even sure CP/M-86 had been released when Paterson wrote QDOS.
Paterson claims CP/M-86 wasn't released yet in http://dosmandrivel.blogspot.com/2007/09/design-of-dos.html?...:

> We knew Digital Research was working on a 16-bit OS, CP/M-86. At one point we were expecting it to be available at the end of 1979. Had it made its debut at any time before DOS was working, the DOS project would have been dropped. SCP wanted to be a hardware company, not a software company.