Page 1 of 1

IDENTIFY DEVICE under AHCI problem

Posted: Thu Sep 20, 2012 2:32 pm
by arkady
I'm trying to get disk data using IDENTIFY DEVICE command. For IDE it works fine - in VirtualBox & real hardware. The problem is with AHCI - it works in VirtualBox (VB) but not on my real PC. I'm setting up all the necessary pointers, filling a command header, building a command table with Register H2D FIS and IDENTIFY DEVICE command, starting command list processing and finally issuing a command.

In VB an AHCI controller fills the buffer with disk data and returns FIS Register D2H - Interrupt flag set, Status 0x50, no Error. PRDBC field in command header is set to 0x200 (256 words transferred). I think that's the way it should work, right?

In my PC, however, I get the following: AHCI returns FIS PIO Setup - Interrupt flag set, Direction from device to host, Status 0x58 (DRQ bit set), E_Status 0x50, Transfer count 0x200. No more FISes received, Status remains 0x58. Shouldn't AHCI get that disk data for me and put it into memory like it does that in VB? Or does it expect me to read that data myself? For IDE it was simple read from data port but for AHCI.. how??

I am not using interrupts yet. No bits in port registers indicating any interrupt are set.

Re: IDENTIFY DEVICE under AHCI problem

Posted: Sat Sep 22, 2012 2:02 pm
by arkady
Setting P bit (Prefetchable) in command header did the trick but I still don't know why it doesn't work when the bit is cleared. Now a buffer is filled with IDENTIFY DEVICE data. The problem solved. Kind of...