5 ms·
86-DOS was modeled after CP/M, with separate BIOS (hardware drivers) and BDOS (filesystem) modules. What was translated from Z80 is likely the BIOS code, since
by rep_lodsb 3y ago
86-DOS was modeled after CP/M, with separate BIOS (hardware drivers) and BDOS (filesystem) modules. What was translated from Z80 is likely the BIOS code, since SCP already had written that before the 8086 CPU card existed.
And all versions supported both CALL 5 and INT 21h for system calls (not 5, which was reserved by Intel, though IBM didn't care about that when they designed the PC and used it for "print screen"). That doesn't mean the implementation was based on leaked CP/M code, let alone literally translated.
- anonymousiam 3y agoCP/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.
- 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... )