Hi everyone,
I've got a Z80-based computer that I've built with 256KB of memory (made up of 128KB RAM and 128KB ROM), divided into 16 x 16KB banks that I can map in any combination to the 4 pages accessible by the Z80's 16-bit address bus. It currently runs CP/M 2.2.
As the MMU was a recent addition, I thought my next step should be to get CP/M 3 up and running as it supports banked memory. The plan is to fix the upper 16KB page and allow CP/M to swap the lower 48KB as one block, giving it Bank 0 and Bank 1 (the minimum requirement for CP/M 3.)
My knowledge of CP/M (and assembly - although not programming in general) is extremely limited and I'm learning as I go. From what I can gather from the documents, I need to write a new CPMLDR.COM file with a modified CBIOS in it to allow CP/M 3 to interface with the hardware in my computer (the CompactFlash drive specifically) so it can load CP/M 3 on boot. Makes sense. Then I need to write a more fleshed-out CBIOS for CP/M 3 itself and build a CPM3.COM file for CPMLDR to load into memory and execute. Also makes sense.
However, I'd appreciate a little guidance on how to complete these tasks if possible. I have CP/M 2.2 with a working CBIOS already. I've read in the CP/M 3 System Guide that you can convert the CBIOS from 2.2 to 3. This would obviously make sense as I'll likely be building the CPMLDR and CPM 3 .COM files in CP/M 2.2, and there's no point re-inventing the wheel.
Initially I had a look online to find examples of LDRBIOS assembly files but all I can find relating to the LDRBIOS I need to build CPMLDR are written in 8080. Yes, I know the Z80 can understand 8080 opcodes but I can't (I'm still learning Z80 opcodes!)
The guide talks about extra jump points, which I've added, to the BIOS jump table - I'm about to start working my way through the functions and making sure they do what CP/M 3 expects (though I'm looking initially to create a non-banked version of CP/M 3 first.) But the LDRBIOS.ASM comments talk about 'boot' being null, then elsewhere that it should get its start value from @mxtpa and...
Anyone done this before and can remember what they did? I just need a few pointers really as I don't know enough about the subject to confidently make the edits I need to.
I've attached a zip file with the two .ASM files - CPM3_CBIOS64.ASM is the full CBIOS for CP/M 3 that I'm building based off of the CP/M 2.2 CBIOS, LDRBIOS.ASM is an example BIOS for CPMLDR (stripped down) that I'm trying to convert to work with my system and get CPM 3 running.
Any help would be greatly appreciated!
File Attachment: View attachment BIOS.zip
I've got a Z80-based computer that I've built with 256KB of memory (made up of 128KB RAM and 128KB ROM), divided into 16 x 16KB banks that I can map in any combination to the 4 pages accessible by the Z80's 16-bit address bus. It currently runs CP/M 2.2.
As the MMU was a recent addition, I thought my next step should be to get CP/M 3 up and running as it supports banked memory. The plan is to fix the upper 16KB page and allow CP/M to swap the lower 48KB as one block, giving it Bank 0 and Bank 1 (the minimum requirement for CP/M 3.)
My knowledge of CP/M (and assembly - although not programming in general) is extremely limited and I'm learning as I go. From what I can gather from the documents, I need to write a new CPMLDR.COM file with a modified CBIOS in it to allow CP/M 3 to interface with the hardware in my computer (the CompactFlash drive specifically) so it can load CP/M 3 on boot. Makes sense. Then I need to write a more fleshed-out CBIOS for CP/M 3 itself and build a CPM3.COM file for CPMLDR to load into memory and execute. Also makes sense.
However, I'd appreciate a little guidance on how to complete these tasks if possible. I have CP/M 2.2 with a working CBIOS already. I've read in the CP/M 3 System Guide that you can convert the CBIOS from 2.2 to 3. This would obviously make sense as I'll likely be building the CPMLDR and CPM 3 .COM files in CP/M 2.2, and there's no point re-inventing the wheel.
Initially I had a look online to find examples of LDRBIOS assembly files but all I can find relating to the LDRBIOS I need to build CPMLDR are written in 8080. Yes, I know the Z80 can understand 8080 opcodes but I can't (I'm still learning Z80 opcodes!)
The guide talks about extra jump points, which I've added, to the BIOS jump table - I'm about to start working my way through the functions and making sure they do what CP/M 3 expects (though I'm looking initially to create a non-banked version of CP/M 3 first.) But the LDRBIOS.ASM comments talk about 'boot' being null, then elsewhere that it should get its start value from @mxtpa and...
Anyone done this before and can remember what they did? I just need a few pointers really as I don't know enough about the subject to confidently make the edits I need to.
I've attached a zip file with the two .ASM files - CPM3_CBIOS64.ASM is the full CBIOS for CP/M 3 that I'm building based off of the CP/M 2.2 CBIOS, LDRBIOS.ASM is an example BIOS for CPMLDR (stripped down) that I'm trying to convert to work with my system and get CPM 3 running.
Any help would be greatly appreciated!
File Attachment: View attachment BIOS.zip