[solved] Buggy ATA PIO read
Posted: Mon Apr 06, 2020 2:10 am
Here's my ATA PIO read code: https://gist.github.com/iProgramMC/a02c ... fff0189b31
I am wondering if what I'm doing is right. Reading the boot sector works just fine, however, reading the FAT (in my case at sector 0x20FE, for some reason) does not work. It skips two bytes. I've tried this code in qemu, not sure about VirtualBox and others.
I've checked that the FAT actually exists at the address - it does.
I've compressed the hard drive image so that you can see if it works. (Warning: it is 256 MB.) Here it is. (the domain is weird because I couldn't be bothered to upload anywhere else)
update: ReadPort is inportb, ReadPortW is inportw, WritePort is outportb and WritePortW is outportw.
Thanks
I am wondering if what I'm doing is right. Reading the boot sector works just fine, however, reading the FAT (in my case at sector 0x20FE, for some reason) does not work. It skips two bytes. I've tried this code in qemu, not sure about VirtualBox and others.
I've checked that the FAT actually exists at the address - it does.
I've compressed the hard drive image so that you can see if it works. (Warning: it is 256 MB.) Here it is. (the domain is weird because I couldn't be bothered to upload anywhere else)
update: ReadPort is inportb, ReadPortW is inportw, WritePort is outportb and WritePortW is outportw.
Thanks