NAME
sdahci – AHCI (Advanced Host Controller Interface) SATA (Serial ATA) storage device driver

SYNOPSIS
bind –a #S /dev
/dev/sdctl
/dev/sd
En/ctl
/dev/sd
En/raw
/dev/sd
En/data
...

DESCRIPTION
The sdahci driver provides access to AHCI devices via the sd(3) interface. The AHCI programming interface supports up to 32 hot–swappable SATA disks or ATAPI devices per controller. Controllers are detected automatically and drive letters are assigned from E onward. Intel controllers need to have AHCI enabled in the BIOS. For ich parts this typically means enabling enhanced mode and AHCI. For ESB (Enterprise South Bridge) –based parts, only enhanced mode needs to be enabled.

The top level control file, sdctl, supports the following control messages for AHCI controllers. They toggle flags and unless otherwise mentioned, the default is `off'.
ahci debug     Print debug messages.
ahci aprint    Print verbose ATAPI debugging messages.
ahci idprint   Print drive identification messages. Prints short messages when a drive is identified or removed. Default is on.

The device–level ctl file supports:
flushcache    Send the ATA(PI) FLUSH CACHE command, which may take up to 60 seconds to complete.
identify      Send the ATA(PI) IDENTIFY DEVICE command. If device information has changed, the new size, features and serial will be noted. If changed, I/O on existing file descriptors will result in the error string media or partition has changed.
mode speed     Change the connection speed to one of auto, sata1, sata2, or sata3.
nop          Send the ATA NOP command, if the device supports it. Per standard, the result is always an error.
smartenable   Enable SMART monitoring on the drive. SMART is a persistent property of the drive, and is enabled automatically, if available, when a drive comes on–line.
smartdisableDisable SMART on the drive.
smart         Send the ATA(PI) SMART RETURN STATUS command.
state state    Force a transition to the named state. The states are:
null       ignored (may only be reached manually);
missing    not detected;
new        powered down or newly discovered;
ready      ready for commands;
reset      being reset gently;
portresetbeing fully reset;
offline    device failed portreset (attempted periodically).

For devices present at boot, the transition is from state new to state ready.

SOURCE
/sys/src/9/pc/sdahci.c

SEE ALSO
sd(3)
http://www.lttconn.com/res/lttconn/pdres/201005/20100521170123066.pdf, the SATA spec.
https://www.intel.com/content/dam/www/public/us/en/documents/\ technical–specifications/serial–ata–ahci–spec–rev1_3.pdf, the AHCI spec.
http://www.t13.org/Documents/UploadedDocuments/docs2013/\ d2161r5–ATAATAPI_Command_Set_–_3.pdf, ANSI T13 ATA8–ACS, mainly for SMART.

BUGS
None of enclosure management, LED control and port multipliers are supported.

Intel ich9–based AHCI does not support hot swapping, and each drive must be connected to the lowest–numbered free port.

ATAPI devices may not be reset when they have outstanding commands.

Copyright © 2025 Plan 9 Foundation