5 ms·
Live coding an assembler for CP/M
- dukoid 7y ago"This is part of a slowly ongoing project to produce a completely open source CP/M clone which can be distributed with emulators and the like" -- Will this be limited to 8080 / Z80 or platform independent? If the latter, to which extent?
- david-given 7y agoZ80 and 8080 only --- I would like it to be 8080 only but I haven't been able to source an 8080 CP/M kernel and shell which are provably open source. So instead I'm using ZSDOS kernel (GPL) and the ZCPR1 shell (PD). Fun fact: CP/M is modular! You can mix and match kernels, shells and BIOSes as much as you like and everything's still binary compatible! What's more, the original Digital Research distribution contained all the tools necessary to let you do this and port CP/M to a new architecture! Truly, it was a different era. Interested parties may wish to watch https://www.youtube.com/watch?v=FGWshrMZcCc https://www.youtube.com/watch?v=FGWshrMZcCc, where I demonstrate an earlier version of the thing running on a Z80-based Amstrad NC200 laptop, and do some programming on it.
- kragen 7y agoIt's likely that this is contaminated with the copyright of the original — the author admits having had access to the original, and it's likely that some of their code would show "substantial similarity" if examined by a jury, which is sufficient to show copyright infringement under US law. And, notoriously, Caldera has been taken over by shameless criminals even worse than the ones at Oracle — the ones who turned the name "SCO" into an obscenity meaning "to try to steal someone else's work through the courts". It's outrageous and ridiculous that in 2019 we need to worry about possibly infringing the copyright of code written in the 1970s, when copyright arguably didn't even cover software, by a man who died in 1994 and who probably would have approved of the project. Copyright law is a menace to anyone doing preservation or creative work of any kind — note the recent million-dollar verdict in favor of Nintendo against abandonware ROM sites — and should be abolished or at least scaled back to a reasonable term, like five years. On another note, the Z80 isn't as obsolete as you might think — like the 8051, it's used relatively often as an embedded core in modern devices, such as the S1 MP3 player from the 2000s and the TI-73+, TI-83+, and TI-84 calculators SirCmpwn wrote KnightOS for. And, unlike the 8051, the Z80 has reasonable self-hosted development tools, including Turbo Pascal.
- knolax 7y ago> TI-84 calculators I wonder if it would be possible to port CP/M to TI Calculators.
- david-given 7y agoProbably --- CP/M is disturbingly flexible. Whether it'd be useful I don't know. Hardware-wise, you need 16kB or up RAM, preferably starting at 0x0000; a different base address means you won't be able to run standard binaries (they need to be recompiled). But that's all you need. You don't even need interrupts. The way you port it is to write a BIOS containing a few basic routines for console, printer and serial input and output and disk access, link it together with the kernel and the shell, and you're done. It's not a lot of code, particularly if you have simple hardware. You don't need a timer, interrupt based I/O, memory management, or anything like that. If you've got more hardware it's always useful. CP/M 3 had a sophisticated paging system which would let the bulk of CP/M itself be held in a different address space but it's pretty complex and I'm sticking with CP/M 2.2. The biggest problem with a TI calculator is fitting enough text on. I know that recent calculators have bigger screens but my TI-85 has a 128x64 screen, with 21x8 characters with the default font. I don't believe Turbo Pascal will be very happy running with that although the documentation doesn't specify a minimum. My 1982 PX-8 laptop has an 80x8 screen, and that's cramped.
- david-given 7y agoRe copyright contamination: that's pretty doubtful, actually. While it's not a clean room reimplementation it does work quite differently, with a whole set of different bugs, syntactic wibbles and semantic quirks, as well as being in a completely different language. I am actually _right now_ working on the .prn file output, and duplicating the behaviour of the original is essentially impossible as it's very much dependent on how the original parsed the input and mine parses differently. (Try assembling 'foo equ 1 ! mov a, foo' and try and predict what the DR assembler's prn file output is! You'll be surprised.) Also, the IP's not owned by Caldera any more. It got spun off into Lineo, which then folded. Some assets went to Embedix which then got folded into Metrowerks, and the rest reverted to the investor, Canopy Group (he says reading Wikipedia), but I don't know which. It's probably worth approaching them to try and get the license fixed --- the existing one is painfully vague and the CP/M community bickers endlessly about what it actually means, and the encumbrance requiring everything to be distributed through one site is just stupid. Whether they still contain anyone who's heard of CP/M, I don't know.