Close

PIP

A project log for Z80 Computer

Yet another Z80 computer.

james-otsJames Ots 06/26/2017 at 19:480 Comments

Now CP/M actually works. I'm not sure if it was a problem with the SD card loading code, or a problem with the disk parameter blocks. It may have been a bit of both. Certainly, if I create a DPB for a disk which is too big then CP/M won't start, so I currently have it with just an 8Mb disk.

Yesterday I also fiddled around with the SD card reading and writing code. I managed to speed up writing about 10 times by using an OTIR instruction, and not checking to see if the SPI bus is busy — it never is because sending a byte over the SPI takes a little less time than one loop of an OTIR instruction. I also fixed some bugs, so some of that stuff might also have made CP/M work.

When CP/M has started, I don't have any files on the disk. One way I could get files there would be to write them directly to the SD card from linux, but I'd have to mess around with the CP/M file format (and get the tools to recognise that I'm only storing 128 bytes in each 512 byte sector). The other way is to load a programme into memory at $100, start CP/M and use the SAVE command to save the memory to disk.

A slight problem is that if I load anything at $100 it overwrites my ROM monitor, so I added a routine which copies memory from $8000 to $100 and then starts CP/M directly without returning to the monitor. And here we have PIP.COM saved and working. Probably. I'd forgotten how to use PIP as it's about 30 years since I last used it.

Discussions