devc1 wrote:
Great, so now I'm not making anything wrong but, How to report that I only received some specific bits in Command Issue, do I need a mutex if it is multi processor.
I don't understand this question.
devc1 wrote:
And what do PORTxSATA_ACTIVE.
Do you mean PxSACT? That's the register that tracks queued command completion. Before you write to PxCI to issue a NCQ command, you write the same value to PxSACT to tell the HBA you're going to issue a queued command. When you receive an IRQ for command completion after issuing NCQ commands, you read PxSACT to see which queued commands have completed instead of reading PxCI.
Keep in mind you may not be able to use all 32 bits of PxSACT, depending on the HBA and drive capabilities.
devc1 wrote:
Another question, how PIO works (with AHCI).
PIO works the same as DMA, but there are some limitations: the HBA may not support more than one DRQ block per command, and DRQ blocks can't be bigger than 8kB.
devc1 wrote:
And how to send an IDENTIFY_DEVICE with PIO and how to get data from the IO Ports.
Sending the IDENTIFY DEVICE command works exactly the same as sending any other non-queued read command. IDENTIFY DEVICE always uses one 512-byte DRQ block, so the AHCI PIO limitations won't get in the way. There are no I/O ports involved.