The CF card I had been using was 512MiB, which I have learned is incompatible with my hardware setup... thus the errors. After getting a 128 MiB CF card, I tried an IDE/CF driver for Z80 I had downloaded a while back. I read the first sector and got the os name at offset 3, then sent it via serial:
I used the 'dir' command because there is no fs yet, so we can't list files. But as you can see, it clearly responds with 'MSDOS5.0', meaning reading sector zero actually worked. Yay! now lets make a FAT driver...
First tests of this FAT driver made the computer simply stop, endlessly waiting for the drive to be ready. I knew the drive had errored, but why? What piece of code caused the error? Time to make a stack tracer.
I put strings before each function call which could lead to an error, then made a program trace any drive error. We can see that the problematic code is at 0x489, where the filesystem is loaded. More specifically, where the root directory is loaded into memory.
I got the drive error code: 0x10, like last time, that the sector wasn't found. So I guess I tried to access a sector that isn't on the card...
That is the next thing to fix.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.