News for hackers. Stuff that matters.
Re:CP/NC – a CP/M-compatible operating system by tombert on Tuesday December 17, 2019 @04:15PM (#21818923)
I've never had a chance to use CP/M; can someone here tell me how it compares to something like Commodore Basic or MS-DOS?
Re:CP/NC – a CP/M-compatible operating system by nils-m-holm on Tuesday December 17, 2019 @04:36PM (#21819150)
If you have used a very early version of MSDOS, its is not very different. File names are 8+3 characters long with a dot in between, upper and lower case is not distinguished. There are only 5 "built-in" commands: DIR, ERA (erase files), REN (rename, but the syntax is REN NEW=OLD), SAVE, and TYPE.

There are no directories, but "user areas" numbered from 0 to 15, so different users can have different files on the same disk. User areas are selected with the USER command. However, most people used user areas as poor-man's directories.

There is no COPY command. Copying files (and much more) is done with a program named PIP (peripheral interchange program). For instance,

    PIP B:=A:*.COM[E]
would copy all files of the type COM from drive A: to drive B: and echo the file names.

What was great about CP/M was that it allowed programs to run on different computers, as long as they were 8080- or Z80-based. It was a thin, but very effective abstraction layer between the hardware and a program.

MSDOS, which was originally based on CP/M, was a step back, really, because everybody tried to program the hardware directly instead of going through the proper interfaces.

Re:CP/NC – a CP/M-compatible operating system by skissane on Tuesday December 17, 2019 @05:08PM (#21819480)
> MSDOS, which was originally based on CP/M, was a step back, really, because everybody tried to program the hardware directly instead of going through the proper interfaces.

That wasn't anything to do with the technical characteristics of MS-DOS versus CP/M. It was about the market conditions – for MS-DOS, the vast majority of users were running it on the IBM PC (and later compatible clones), so developers coded to the IBM PC BIOS and direct hardware access. With CP/M, hardware was far more diverse so developers had an incentive not to do that sort of thing.

Re:CP/NC – a CP/M-compatible operating system by kjs3 on Tuesday December 17, 2019 @07:38PM (#21820675)
It was also about speed. For example, going through BIOS for video was slooooow, so most everyone went straight to the hardware, which buggered up anything that wasn't an MDA/CGA/EGA/VGA video adapter or near identical (like those with a NEC 7220...there were one or two). It meant things like the Wyse 700 (high-res mono video adapter) had to have application specific drivers.
Re:CP/NC – a CP/M-compatible operating system by skissane on Tuesday December 17, 2019 @08:35PM (#21820952)
In theory, they should have written to MS-DOS API, and then if BIOS video is slow, Microsoft (or OEMs) could have changed the MS-DOS console device driver to use direct hardware access. The problem was, everyone just went straight to the hardware so there was little impetus on anyone to write a faster console device driver for MS-DOS.
Re:CP/NC – a CP/M-compatible operating system by abecedarius on Tuesday December 17, 2019 @09:35PM (#21821240)
Iirc the bios interface was inherently slow: output was a character at a time, one bios call each. It’s been a long time, though.
Re:CP/NC – a CP/M-compatible operating system by flyinghamster on Tuesday December 17, 2019 @05:05PM (#21819445)
Not only that, but CP/M itself has a rather DEC-ish flavor to it. PIP was found on RT-11 and RSTS/E (maybe RSX-11 as well?), and the drive identifier with a colon is also a nod to DEC.
Re:CP/NC – a CP/M-compatible operating system by kjs3 on Tuesday December 17, 2019 @07:27PM (#21820611)
It's not a secret that CP/M was influenced by RT-11. Lots of clear similarities. Kildall and his team used DEC machines as cross development machines.
Re:CP/NC – a CP/M-compatible operating system by that_jojo on Tuesday December 17, 2019 @06:29PM (#21820172)
VMS feels like DOS if DOS were actually secretly UNIX

Also, don't forget about OS/8 for the PDP-8 series. Very DOS-y, and released by DEC all the way back in '71.

Re:CP/NC – a CP/M-compatible operating system by icedchai on Tuesday December 17, 2019 @09:19PM (#21821171)
VMS feels like DOS if that DOS was from another dimension. About the only thing they have in common is "DIR" and ".EXE" extensions.
Re:CP/NC – a CP/M-compatible operating system by WorldMaker on Wednesday December 18, 2019 @04:07PM (#21829459)
Which is also why it's so fascinating Windows NT sort of merged both parallel dimensions with its influences directly from both DOS and VMS.
Re:CP/NC – a CP/M-compatible operating system by spc476 on Tuesday December 17, 2019 @11:00PM (#21821647)
And at the system level, all the MS-DOS system calls in version 1.0 were direct copies of system calls in CP/M. Made it very easy to translate CP/M programs to MS-DOS if you wanted.
Re:CP/NC – a CP/M-compatible operating system by mhd on Tuesday December 17, 2019 @04:46PM (#21819257)
The lineage is pretty clear, especially if you're looking at the early DOS versions and the computers it ran on. DOS basically added a few things, and the hardware progressed a lot.

But in the Turbo Pascal 3 era, the differences weren't that high.

"Big" things were:

- no sub-directories

- no relocatable executables (ie. only .COM, no .EXE)

- no common, advanced graphic standard

So if you're running WordStar or TP3 in black-and-white text mode, you might not be able to tell the difference.

If you're thinking of color text modes (TP 5.5, QBASIC, Word 5) or VGA/EGA games when "DOS" is mentioned, then that's the era beyond that.

Re:CP/NC – a CP/M-compatible operating system by skissane on Tuesday December 17, 2019 @04:40PM (#21819187)
CP/M was rather similar to MS-DOS / PC-DOS 1.0 – no subdirectories, only a root directory per a disk.

Later versions of CP/M did add one approximation to directories, each disk contained 16 numbered user areas (0-15), you could switch between them by "USER n" command. But, all files existed in the same physical directory, the user area was just a nibble in the directory entry. Files not in the current user area were hidden.

Some versions of CP/M supported password-protecting individual files (and entire disks). If you set a password on a file/disk, the OS would prompt you for the password before allowing you to read/write it. However, there was no encryption, and the passwords were stored using trivial reversible encryption (XOR with a single byte key), so tools existed to retrieve the password.

CP/M file system did not store exact size of files, only how many 128 byte records they contained. Text files used ^Z character as end of file marker. That is why many DOS programs treated ^Z as an end of file marker, even though unlike CP/M it supported storing file sizes to the byte.

Unlike DOS, earlier versions of CP/M did not store file modification times. Later versions added this.

CP/M only supports 7-bit ASCII in file names since high bit of each file name byte is used to store file attributes (read-only, system, etc). The FAT filesystem stores file attributes in a separate byte, enabling use of 8-bit extended ASCII in filenames (diacritics for European languages, etc)

DOS tended to have friendlier commands. COPY vs PIP (Peripheral Interchange Program)

DOS copied a number of features from CP/M - 8.3 file name format, drive letters, similar system calls – Int 21h started out as a subset of CP/M system calls, but later added many more calls which were not CP/M compatible – .COM as an executable file extension, IO.SYS/MSDOS.SYS split (in CP/M called BIOS vs BDOS – the BIOS of IO.SYS is not the same thing as the system firmware BIOS.) DOS added .EXE file format and FAT filesystem. Starting in DOS 2.0, DOS gained subdirectories and a new Unix-inspired file API.

CP/M most commonly was used on 8080/Z80 systems with maximum 64KB address space, with more memory sometimes accessible through bank switching. MS-DOS ran on 8086 which is much more generous with memory. (However, there were versions of CP/M for other CPUs, including 8086 and 68000, although use of those versions was not very common.)

Re:CP/NC – a CP/M-compatible operating system by atrn on Tuesday December 17, 2019 @08:56PM (#21821048)
> Text files used ^Z character as end of file marker.

But only if the file size wasn't a multiple of the 128-byte block size. Fun!

Re:CP/NC – a CP/M-compatible operating system by cmrdporcupine on Tuesday December 17, 2019 @11:06PM (#21821677)
GEMDOS on the Atari ST (68000) was essentially CP/M 68k with some MS-DOS-like modifications (FAT filesystem, subdirectories, some similar syscalls, etc.) Even used the CP/M 68k relocatable executable format. The GPL'd source for both are out there and very obviously related.
Re:CP/NC – a CP/M-compatible operating system by kabdib on Thursday December 19, 2019 @11:59PM (#21841801)
IIRC GEMDOS was written more less from scratch by Jason Loveman (last I heard he was at Microsoft). While it's possible he might have cribbed a bunch from the CP/M-68K codebase, it started "in his garage" as a private effort that he hoped he'd be able to sell to someone. DRI wound up acquiring it (I wasn't privy to the terms, I hope Jason got a lot of money, though) and we wound up using it on the ST because absolutely nobody liked CP/M-68K, OMG.

I'll have to check out the sources and see if I get the same impression. It's been a while.

Re:CP/NC – a CP/M-compatible operating system by tssva on Wednesday December 18, 2019 @01:26PM (#21827686)
The most popular CP/M platform wasn't strictly a CP/M computer at all but the Apple II with the Microsoft Z80 Softcard installed.
Re:CP/NC – a CP/M-compatible operating system by hakfoo on Friday December 20, 2019 @08:24PM (#21848928)
I thought technically it was the Commodore 128, which would run CP/M "incidentally" because they made an over-the-top promise of compatibility.

The C64 had a CP/M addon cartridge that was flaky at best, and the only way to get equivalent support was to just build a Z80 in.

Re:CP/NC – a CP/M-compatible operating system by jhallenworld on Tuesday December 17, 2019 @10:11PM (#21821422)
You can try it easily from a Linux terminal window if you are interested:

https://github.com/jhallen/cpm

Re:CP/NC – a CP/M-compatible operating system by laumars on Tuesday December 17, 2019 @04:53PM (#21819336)
Commodore BASIC was also a Microsoft product. BASIC and CP/M have basically (no pun intended) nothing in common.

Others have covered the DOS and CP/M comparison.

Re:CP/NC – a CP/M-compatible operating system by jandrese on Tuesday December 17, 2019 @04:33PM (#21819114)
MS-DOS was basically the store brand CP/M.
Re:CP/NC – a CP/M-compatible operating system by tombert on Tuesday December 17, 2019 @04:36PM (#21819146)
I know that, but I was more curious to some notable differences, from someone who knows enough about both to explain.
Re:CP/NC – a CP/M-compatible operating system by zabzonk on Tuesday December 17, 2019 @04:38PM (#21819173)
Well, Commodore Basic allowed you to execute Basic code from outside of a program, at the command-line prompt. CP/M wasn't based on Basic, and didn't let you do that. Neither did MS-DOS.
Re:CP/NC – a CP/M-compatible operating system by jandrese on Tuesday December 17, 2019 @05:26PM (#21819600)
It's almost like CP/M was completely different than Commodore Basic. Fascinating.
Re:CP/NC – a CP/M-compatible operating system by reaperducer on Tuesday December 17, 2019 @04:29PM (#21819056)
MS-DOS is descended from CP/M.