3 ms·
CP/M is modular and incredibly low in requirements. You don't even need interrupts. All you need is more than about 16kB of RAM, mapped at 0x0000, and enough ha
by david-given 7y ago
CP/M is modular and incredibly low in requirements. You don't even need interrupts. All you need is more than about 16kB of RAM, mapped at 0x0000, and enough hardware for a console and disk. (Obviously the more the better. You won't get much done in 16kB.)
The command shell, the CCP, and the kernel, the BDOS, are completely platform independent. The only actual architecture-specific bit is the BIOS, which the rest of the system talks to via a set of very simple entry points. There's documentation here: http://www.gaby.de/cpm/manuals/archive/cpm22htm/ch6.htm#Section_6.6 http://www.gaby.de/cpm/manuals/archive/cpm22htm/ch6.htm#Sect...
That is, literally, it. There's a little subtlety in the warm boot / cold boot stuff (every time you exit to the shell CP/M literally reboots and loads itself off disk! But it's so quick you don't notice), and the 128-byte CP/M sector size is a total pain which requires buffering for modern hardware with 512-byte sectors, but it's all exceptionally well documented. If your system is simple enough, you can hack up a BIOS in an evening.
If you're not using a serial terminal you need to implement a terminal emulator in the BIOS, and deal with display memory etc. That can rapidly eat away your RAM, so having a banked system helps. The NC200 port divides the 128kB of RAM into two halves, one for userspace, and one for a 'supervisor' which does all the I/O. The BIOS is just a stub which calls the supervisor. There was loads left over in the supervisor address space so I added a massive disk buffer, allowing me to read and write complete tracks in a single disk revolution. It's really quick (for CP/M).