News for hackers. Stuff that matters.
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.