3 ms·
CP/M consists of three parts, CCP = Console Command Processor, BDOS = Basic Disk Operating System, BIOS = Basic Input Output System. SCP copied the CCP and BDO
by anonymousiam 3y ago
CP/M consists of three parts, CCP = Console Command Processor, BDOS = Basic Disk Operating System, BIOS = Basic Input Output System.
SCP copied the CCP and BDOS. The BIOS would be the most hardware-centric part of CP/M, and would probably not be copied between platforms. Also, the BIOS was the only "open" part of CP/M.
You are correct that DOS uses INT 21 and not INT 5. Sorry for my typo. The INT 21 vs CALL 5 APIs are effectively identical aside from the calling mechanism.
I never did it, but I think it would have been interesting to run the SCP cross-assembler on the leaked CP/M CCP and BDOS. (They would need to be translated from Intel mnemonics into Zilog ones, but there are tools for that too.) After using the automated tools, I believe the resulting x86 assembly source would be "substantially similar" to the early DOS source.
- wvenable 3y agoIf 86-DOS was copied it would be easy to tell -- you could probably read all the source code for both products in a single day. Even reading the decompiled code wouldn't be hard. It's no secret that 86-DOS was modelled on CP/M and designed to be compatible. But it would still have probably been easier to write it from scratch then to copy it. Also the Z80 and 8086 are not similar enough that it would make sense to directly translate one from the other in general (one is an 8bit CPU and the other is 16bit).
- anonymousiam 3y agoI agree that it would be pretty easy to tell, but AFAIK, nobody has taken the approach that I mentioned above. x80 and x86 have quite a lot in common. Did you look at the link of the SCP Z-80-to-8086 cross-assembler manual that I posted?
- zozbot234 3y ago8080 asm source can be auto-translated to 8086 but Z80 is an independent extension of the 8080, there's no direct compatibility.
- anonymousiam 3y agoYou are correct, but CP/M was written for the 8080 CPU, and the Intel 8080 is a subset of the Zilog Z-80, so a direct translation is entirely possible. The Z-80 is not hardware compatible. (E.g. it cannot be plugged into a system to replace an 8080.) The Z-80 is however 100% software compatible with the 8080. Anything that will run on an 8080 will run on a Z-80 without modification. So the process to reproduce DOS would be: 1) Convert the 8080 assembly mnemonics in the leaked CP/M BDOS and CCP into Z-80 mnemonics. I remember that there are tools to do this under CP/M, but I haven't run CP/M for nearly 40 years, so I don't remember their names. 2) Run the Z-80-to-x86 cross assembler (conveniently written by the same company that "wrote" DOS -- SCP) on the Z-80 assembler files you've just produced. 3) Change all occurrences of CALL 5 to INT 21. 4) Integrate with BIOS for your x86 hardware. 5) Done!
- wvenable 3y ago> Run the Z-80-to-x86 cross assembler That's not what that assembler does. From the manual: The Seattle Computer Products Z80/8086 Cross Assembler runs on the Z80 processor under CP/M or its derivatives. It accepts as input a text file of 8086 source code using mnemonics similar or identical to Intel's ASM-86. (Emphasis mine) ... Why a Cross Assembler? During the early life of a new processor, a cross assembler offers the user certain advantages over a resident assembler. Chief among these is the ready availability of low cost software for the older host computer. For the Z-80, this software includes editors, operating systems, and utility packages. Using a cross assembler also enables the user to write machine language code for the new processor even before the hardware is available.
- anonymousiam 3y agoOkay, so I tagged the wrong product. I know there was a Z-80 to x86 cross assembler for CP/M because I had a copy of it. I think it was called something like xlt86.com. XLT86 is mentioned here: https://en.wikipedia.org/wiki/CP/M https://en.wikipedia.org/wiki/CP/M I see that this one is a translator for Intel mnemonics and isn't for Z-80, so that would make the task of porting even simpler. I know that there was a translator for Z-80 to x86 though. Sorry I cannot remember everything from 40 years ago in precise detail. I also remember ZCPR, which was a Z-80-only CCP replacement for the CP/M CCP. If you had a Z-80-based CP/M computer, you could replace your CCP and gain some new command line intrinsics. ZCPR was circulated on the CP/M BBS circuit (RCP/M). Digital Research couldn't do much about it because the author was not identified, and it was not distributed for profit.
- wvenable 3y ago> Did you look at the link of the SCP Z-80-to-8086 cross-assembler manual that I posted? It's an assembler that takes 8086 mnemonics and produces 8086 binaries but the assembler runs on a Z80 computer. It's a common type of assembler -- all the assemblers I use these days run on x64 Windows or Linux but assemble for other architectures (6502, Z80, SC61860, ARM). > x80 and x86 have quite a lot in common. They do. But they also have some pretty massive differences. If you're trying to run 8080 programs on an 8086 you can translate but you're still getting an 8080 program with it's limitations. You wouldn't write an OS for 8086 that way! It wouldn't make sense at all. I think you need a better understanding of the technologies involved here before you try and defame Tim Patterson.
- andrewf 3y agoThis presentation doesn't do exactly what you suggest, but it does allege a forensic deep dive into the two. https://www.youtube.com/watch?v=lB0qq5xc5aw https://www.youtube.com/watch?v=lB0qq5xc5aw You may also be interested in Tim Paterson's account of backporting MS-DOS to the Z80 as MSX-DOS. https://www.msx.org/wiki/The_History_of_MSX-DOS https://www.msx.org/wiki/The_History_of_MSX-DOS (My own view is, given that Intel themselves published tools and docs to automatically convert an 8080 program to an 8086 program, "implement the interface a translated CP/M program would expect" is a reasonable goal regardless of whether you want to copy the implementation. http://www.bitsavers.org/pdf/intel/ISIS_II/9800642A_MCS-86_Assembly_Language_Converter_Operating_Instructions_for_ISIS-II_Users_Mar79.pdf http://www.bitsavers.org/pdf/intel/ISIS_II/9800642A_MCS-86_A... )