ahci controller acts as a data movement engine between system memory and SATA devices. Take read operation for example, the rough sequence is as follows:
- software "builds" command in memory(command header, command table, and corresponding PRDs)
- software issues this command by configuring Port register, PxCI(and PxSACT if NCQ)
- AHCI controller fetch and process this command(including data transfer...)
- software interrupt service get called to process the command completion
- software read the PRDs to get device content
PRD entries are created/allocated by software(driver) and can be located/retrieved via command table, that is, hardware can locate the command table then retrieve all PRD entries. Besides, ahci spec defines both the PRD address and byte count to be WORD-aligned(minimum)