Beruflich Dokumente
Kultur Dokumente
Command
3C0 - 3DFh
30
Command
3E0 - 3FFh
31
Command Table Structure
00h
CFIS: 31 23 15 7 0
Command FIS
DBA: Data Base Address 0
(up to 64 bytes)
DBAU: Data Base Addr Upper 32-bits
Item 0
Reserved
40h
ACMD: I Reserved DBC: Byte Count 1
ATAPI Command DBA: Data Base Address 0
(12 or 16 bytes) DBAU: Data Base Addr Upper 32-bits
50h Item 1
Reserved
Reserved I Reserved DBC: Byte Count 1
80h
PRDT: DBA: Data Base Address 0
Physical Region
DBAU: Data Base Addr Upper 32-bits
Descriptor Table Item CHz[PRDTL]-1
Reserved
I Reserved DBC: Byte Count 1
(up to 65,535
entries)
PIO Example
CFIS
Command 0
ACMD
Command 1
Operating
Command 2 Reserved
System
Command 3
PRD Table
OS presents new Command 31
command
HBA Port 0 HW
SATA
AHCI CI = 0000
Driver/BIOS
SATA
Device
PIO Example
CFIS
Command 0
ACMD
Command 1
Operating
Command 2 Reserved
System
Command 3
PRD Table
Command 31
Driver places in next available
slot (slot 0) filling out the PRD
table and CFIS fields
HBA Port 0 HW
SATA
AHCI CI = 0..000
Driver/BIOS
SATA
Device
PIO Example
CFIS
Command 0
ACMD
Command 1
Operating
Command 2 Reserved
System
Command 3
PRD Table
Command 31
HBA Port 0 HW
SATA
AHCI CI
CI==0..0100
0..000
Driver/BIOS
SATA
Device
Driver/BIOS updates CI bit to
indicate valid command
PIO Example
CFIS
Command 0
ACMD
Command 1
Operating
Command 2 Reserved
System
Command 3
PRD Table
Command 31
HBA Port 0 HW
SATA
AHCI CI = 0..0100
Driver/BIOS
SATA
Device
HBA fetches command, and
transmits CFIS to device
PIO Example
CFIS
Command 0
ACMD
Command 1
Operating
Command 2 Reserved
System
Command 3
PRD Table
Command 31
HBA Port 0 HW
SATA
AHCI CI = 0..0100
Driver/BIOS
SATA
Device
Device and HBA initiate transfer
through PRD table
PIO Example
CFIS
Command 0
ACMD
Command 1
Operating
Command 2 Reserved
System
Command 3
PRD Table
Command 31
HBA Port 0 HW
SATA
AHCI CI = 0..0000
0..0100
Driver/BIOS
SATA
Device
Transfer completes, HBA clears
CI bit to free command slot
Native Command Queuing
Example Command 0
Command 1
Operating
Command 2
System
Command 3
OS presents new Command 30
command Command 31
HBA Port 0 HW
SATA CI = 00..000
SATA
Queued
Device
Native Command Queuing
Example Driver places
command in Command 0
available slot (0)
Command 1
Operating
Command 2
System
Command 3
Command 30
Command 31
HBA Port 0 HW
SATA CI = 00..000
SATA
Queued
Device
Native Command Queuing
Example
Command 0
Command 1
Operating
Command 2
System
Command 3
OS presents 2 Command 30
new commands Command 31
HBA Port 0 HW
SATA CI = 00..001
00..000
Command 30
Command 31
HBA Port 0 HW
SATA CI = 00..000
00..001
SATA
HBA sends command 0 to Queued
device, device accepts, HBA Device
clears CI bit
Native Command Queuing
Example
Command 0
Command 1
Operating
Command 2
System
Command 3
Command 30
Command 31
HBA Port 0 HW
SATA CI = 01..100
00..000
SATA
Driver updates SACT and CI to Queued
indicate valid commands Device
Native Command Queuing
Example
Command 0
Command 1
Operating
Command 2
System
Command 3
Command 30
Command 31
HBA Port 0 HW
SATA CI = 00..000
01..100
01..000
SATA
HBA sends commands 2 & 30 to Queued
device, device accepts, HBA Device
clears CI bits
Native Command Queuing
Example
Command 0
Command 1
Operating
Command 2
System Active command
Command 3
Command 30
Command 31
HBA Port 0 HW
SATA CI = 00..000
SATA
Device sends DMA Setup FIS, Queued
indicating transfer ready for slot Device
2
Native Command Queuing
Example
Command 0
Command 1
Operating
Command 2
System Active command
Command 3
Command 30
Command 31
HBA Port 0 HW
SATA CI = 00..000
SATA
Queued
Data transfer occurs from PRD Device
table in slot 2
Native Command Queuing
Example
Command 0
Command 1
Operating Command Available
Command 2 (DSTS[2], CI[2]
System Activecleared)
command
Command 3
Command 30
Command 31
HBA Port 0 HW
SATA CI = 00..000
SATA
Queued
SDB FIS sent by device at end Device
of transfer, clears DSTS[2]
Native Command Queuing
Example
Command 0
Command 1
Operating
Command 2
System
Command 3
Command 30 Active command
Command 31
HBA Port 0 HW
SATA CI = 00..000
SATA
Device sends DMA Setup FIS, Queued
indicating transfer ready for slot Device
30
Native Command Queuing
Example
Command 0
Command 1
Operating
Command 2
System
Command 3
Command 30 Active command
Command 31
HBA Port 0 HW
SATA CI = 00..000
SATA
Queued
Data transfer occurs from PRD Device
table in slot 30
Native Command Queuing
Example
Command 0
Command 1
Operating
Command 2
System
Command 3
Command 30 Command Available
Active command
(DSTS[30], CI[30]
Command 31 cleared)
HBA Port 0 HW
SATA CI = 00..000
SATA
Queued
SDB FIS sent by device at end Device
of transfer, clears SACT[30]
Native Command Queuing
Example
Command 0 Active command
Command 1
Operating
Command 2
System
Command 3
Command 30
Command 31
HBA Port 0 HW
SATA CI = 00..000
SATA
Device sends DMA Setup FIS, Queued
indicating transfer ready for slot Device
0
Native Command Queuing
Example
Command 0 Active command
Command 1
Operating
Command 2
System
Command 3
Command 30
Command 31
HBA Port 0 HW
SATA CI = 00..000
SATA
Queued
Data transfer occurs from PRD Device
table in slot 0
Native Command Queuing
Example
Command 0 Command Available
Active command
(DSTS[0], CI[0]
Command 1
Operating cleared)
Command 2
System
Command 3
Command 30
Command 31
HBA Port 0 HW
SATA CI = 00..000
SATA
Queued
SDB FIS sent by device at end Device
of transfer, clears SACT[0]