OK, I have some sudden problems in my ATA driver that are really frustrating me. It worked 2 days ago, and then I made some changes to my driver management code and suddenly nothing is working anymore.
The current problem is that I can't read data off the drive - I just get a full sector of NULLs (see the pic below). I have no idea why it doesn't work and I've tried everything. Still, I cannot read in the sector. I'll restart my PC and load up Bochs and see if I can get a bit more information, but if anyone can give any hints that'd be great.
ATA Driver Problems
I would be able to help if I could look at the source code of your procedure/function but the problem that I used to have was that I was not setting the "L" bit (that is the 6th bit) of the Device/Head register in order to enable LBA addressing. When you are reading in LBA more, the value 0x00000040 (L BIT) must be mixed with Device/Head Register's default value (compliant with ATA-1 but not of any use with ATA-4 and forth) 0x000000A0.
There are also a lot of other things that you have to consider before attempting to read from the Data Register of either the primary or the secondary IDE controller like checking the BSY/DRQ bits of the Status Register. Also make sure that the DRV bit in the Device/Head register is set to 0 for Drive0 and set to 1 for Drive1 of that IDE Controller you are working with.
Again, I could help more if I had the source code to your procedure/function that doesn't work.
There are also a lot of other things that you have to consider before attempting to read from the Data Register of either the primary or the secondary IDE controller like checking the BSY/DRQ bits of the Status Register. Also make sure that the DRV bit in the Device/Head register is set to 0 for Drive0 and set to 1 for Drive1 of that IDE Controller you are working with.
Again, I could help more if I had the source code to your procedure/function that doesn't work.
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.