Page 1 of 1

detecting ata version

Posted: Wed Jun 08, 2011 3:33 am
by RaffoPazzo
Since 1994 up till todays 8 standards of the ATA interface (eventually with the Packet Interface since version 4) have been released.

Quick search did not end up showing how detect which version the controller is compliant to. Is there a way to achieve such a detection? Do you use different drivers for different ATA versions or just a big and (very) smart driver able to handle every controller?

Re: detecting ata version

Posted: Wed Jun 08, 2011 11:09 am
by Brynet-Inc
They're all revisions of the same specification, introducing only new features.. possibly depreciating others, no radical redesigns.

For the most part the t10/t13 specifications define only the electrical conventions used by ATA and not how a controller should be exposed to programmers.

The "PCI IDE Controller Specification" and "Programming Interface for Bus Master IDE Controller" guides are useful for writing generic drivers, as well as datasheets from particular vendors.

You can find them on Google in your preferred format.

Re: detecting ata version [ solved ]

Posted: Thu Jun 09, 2011 2:02 am
by RaffoPazzo
Brynet-Inc wrote:They're all revisions of the same specification, introducing only new features.. possibly depreciating others, no radical redesigns.
"Introducing new features and depreciating other" is the issue. An ATA-6 driver expecting some features to be implemented (or not) wouldn't optimize performances on a ATA-1 device or even not be able to get the device working, just because the feature is not implemented. What I mean is: ATA version does really matter, it's not just a cosmetic revision of a couple of bits.

I guess to have found how detect wich ATA version the device is compliant to. For each version the Identify Command result has to be parsed.

ATA-1: Bit 1 of word 53 have to be 0, because reserved.
ATA-2: Bit 1 of word 53 have to be 1, meaning that words 64-70 are valid (previously reserved in ATA-1)
ATA-3 through (future) ATA/ATAPI-14 have dedicated bits in word 80. If bit 3 is set, ATA-3 is supported. If bit 4 is set ATA/ATAPI-4 is supported and so on till bit 14 for (future) ATA/ATAPI-14. Be careful on this anyway, because strange things happen in the specification. Infact, word 80 in ATA-3 and ATA/ATAPI-4 define bit 1 and 2 to be set if the device supports, respectively, ATA-1 and ATA-2 but, later on, bit 1, 2 and 3, became progressively obsolete, respectively, in ATA/ATAPI-5, ATA/ATAPI-6 and ATA/ATAPI-7.

Re: detecting ata version

Posted: Fri Jun 10, 2011 2:35 am
by RaffoPazzo
berkus wrote:You can put this into Deprecated article on OSdev Wiki.
Ok, i know i'm going to be pointed as an idiot but i can't find the Deprecated articles section :D
The only thing related to "Deprecated" that i can find is http://wiki.osdev.org/Deprecated, do you mean that?