SATA: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content added Content deleted
No edit summary
No edit summary
 
(7 intermediate revisions by 6 users not shown)
Line 1: Line 1:
'''SATA''' Stands for "Serial AT Attachment", and is the current leading standard for harddrives and optical media, having succeeded the [[ATA|(Parallel) ATA]] interface. Practically all SATA drives can be used using either [[AHCI]] or [[ATA PIO Mode|ATA]].
Apparently, there are three supposedly definitive, conflicting standards for SATA. It may be best to wait for the industry to shake out a little more completely, before trying to write SATA drivers.

If you want to try anyway, then get the ATA7, and ATA8 technical docs from www.t13.org. Then maybe try paying $25 to get the technical specs from www.sata-io.org. Hopefully, the discrepancies between the standards aren't too bad.


==Introduction==
==Introduction==


SATA is a bus interface for communicating with mass storage devices (such as disk drives, optical drives, etc). The composition is mostly identical to PATA, where one controller connects to several devices using SATA cables. SATA wiring is also one-on-one instead of allowing more than one device to be connected to a single cable. When SATA was introduced, almost all host controllers were configured to masquerade as an PATA controller, needing no change from the existing disk drivers. The majority of SATA controllers also support [[AHCI]], which offers connecting more devices than PATA allows, and significant other advantages over the legacy protocol.
SATA, short for Serial ATA, is a new method of connecting disk drives, optical drives, etc. to the motherboard. SATA provides higher transfer rates than PATA and is backward compatible. If an OS does not recognize SATA, it can use drives like ordinary PATA drives with no issues.


Computers that are currently shipped often are [[AHCI]] only, and backwards compatibility mode, if present, has to be manually enabled from the BIOS - a change that often comes with the cost of making the installed OSes unbootable.
==Detection and Initialization==


The actual SATA specification is split into three distinct protocol 'layers'.
Send a standard IDENTIFY command to the drive (0xEC). The drive should respond with an error in the ERR bit of the Status Register, and a pair of "signature bytes". On the Primary ATA bus, you get the signature bytes by reading IO ports 0x1F4 and 0x1F5, and you should see values of 0x3C and 0xC3.


* Physical Layer - Information relating to the physical connectors, etc. Not especially relevant here.
==x86 Examples==
* Link Layer
* Transport Layer


At the time of writing, there were three supposedly definitive, conflicting standards for SATA. It may be best to wait for the industry to shake out a little more completely, before trying to write SATA drivers.
==Comments==

If you want to try anyway, then get the ATA7, and ATA8 technical docs from [http://www.t13.org www.t13.org]. Then maybe try paying $25 to get the technical specs from www.sata-io.org. Hopefully, the discrepancies between the standards aren't too bad.

==Detection and Initialization==

Send a standard IDENTIFY command to the drive (0xEC). The drive should respond with an error in the ERR bit of the Status Register, and a pair of "signature bytes". On the Primary ATA bus, you get the signature bytes by reading IO ports 0x1F4 and 0x1F5, and you should see values of 0x3C and 0xC3.


==See Also==
==See Also==
[[AHCI]]
* [[AHCI]]


===External Links===
===External Links===
*[http://www.sata-io.org/ The Serial ATA International Organization]
* http://www.ata-atapi.com -- Public Domain C driver sourcecode, including SATA, Busmatering DMA, ATAPI -- not perfect, but good.
* http://www.ata-atapi.com -- Public Domain C driver sourcecode, including SATA, Busmatering DMA, ATAPI -- not perfect, but good.
*[http://www.serialata.org The Serial ATA International Organization]


{{stub}}


[[Category:ATA]]
[[Category:ATA]]
[[Category:Disks]]
[[Category:Storage]]
[[Category:Standards]]

Latest revision as of 20:23, 9 July 2023

SATA Stands for "Serial AT Attachment", and is the current leading standard for harddrives and optical media, having succeeded the (Parallel) ATA interface. Practically all SATA drives can be used using either AHCI or ATA.

Introduction

SATA is a bus interface for communicating with mass storage devices (such as disk drives, optical drives, etc). The composition is mostly identical to PATA, where one controller connects to several devices using SATA cables. SATA wiring is also one-on-one instead of allowing more than one device to be connected to a single cable. When SATA was introduced, almost all host controllers were configured to masquerade as an PATA controller, needing no change from the existing disk drivers. The majority of SATA controllers also support AHCI, which offers connecting more devices than PATA allows, and significant other advantages over the legacy protocol.

Computers that are currently shipped often are AHCI only, and backwards compatibility mode, if present, has to be manually enabled from the BIOS - a change that often comes with the cost of making the installed OSes unbootable.

The actual SATA specification is split into three distinct protocol 'layers'.

  • Physical Layer - Information relating to the physical connectors, etc. Not especially relevant here.
  • Link Layer
  • Transport Layer

At the time of writing, there were three supposedly definitive, conflicting standards for SATA. It may be best to wait for the industry to shake out a little more completely, before trying to write SATA drivers.

If you want to try anyway, then get the ATA7, and ATA8 technical docs from www.t13.org. Then maybe try paying $25 to get the technical specs from www.sata-io.org. Hopefully, the discrepancies between the standards aren't too bad.

Detection and Initialization

Send a standard IDENTIFY command to the drive (0xEC). The drive should respond with an error in the ERR bit of the Status Register, and a pair of "signature bytes". On the Primary ATA bus, you get the signature bytes by reading IO ports 0x1F4 and 0x1F5, and you should see values of 0x3C and 0xC3.

See Also

External Links