Through the course of time I’ve been going over the IDENTIFY data of various old IDE hard disks. Today I happened to come across a Conner CP30254H drive, apparently made in June 1993 or so.
This is a circa 250 MB drive, but looking at the contents of IDENTIFY words 57-58 (current CHS capacity in sectors), I see the value 2,195,324,935 which just does not look right, as it’d be about a terabyte; completely impossible for a drive without 48-bit LBA support. The drive reports 895/10/55 CHS geometry, so the capacity really should be 492,250 sectors. That’s rather far off from the reported value.
Now, 492,250 decimal is 782DA hex, whereas 2,195,324,935 decimal is 82DA0007 hex. Obviously not a coincidence. So what does the ATA standard say? The ATA-2 standard (1996) is quite clear (section 7.1.15): Some parameters are defined as 32 bit values (e.g., words 57 and 58). Such fields are transferred using two word transfers. The device shall first transfer the least significant bits, bits 15 through 0 of the value, on bits DD15 through DD0 respectively. After the least significant bits have been transferred, the most significant bits, bits 31 through 16 of the value, shall be transferred on DD15 through DD0 respectively.
The Conner drive is clearly doing it wrong. Except… a drive made in 1993 obviously can’t conform to a 1996 standard. So what does the original ATA standard which was finalized (but not yet officially ratified and published) in 1993 have to say about this?
It says nothing. At all. With word-sized values, there was never any question—the data is transferred as words in the first place, and no one was creative enough to do anything but return bit 0 on data pin 0, bit 1 on pin 1, and so on up to bit 15. But the original ATA standard gives no hint as to how double-word values should be transferred.
It is likely that the data was always meant to be transferred low word first, and the ATA-2 standard explicitly says that, but there is no such clarity in the original ATA standard.
And it wasn’t just Conner transferring the high word first. At minimum, Maxtor (seen with 25128 AT drive) and IBM (seen with H3256-A3 and H3342-A4 drives) did it the same way. On the other hand, Quantum (ELS 85A, LPS 170A drives) or Seagate (ST3243A, ST9096A drives) always returned the low word first.
I’m actually having some difficulty understanding why the current capacity in sectors in words 57-58 was even specified at all. It is defined to be the product of words 54, 55, and 56, i.e. current cylinders/heads/sectors per track. The host might as well calculate the product directly, instead of asking the drive. Moreover, if the product calculated by the host does not match what the drive returns, what is the host expected to do?
As it is, one practical use of the current sector count in words 57-58 is that the host can determine whether the drive returned the information with the low word first or high word first. But that alone is not particularly useful.
It is noteworthy that the first ATA standard also already specifies the LBA capacity in sectors, another 32-bit value presented in IDENTIFY words 60-61. The LBA capacity is not necessarily the same as the CHS capacity, and cannot be cross-checked with other data. But so far at least, all drives I have found that return “incorrect” (high word first) data in words 57-58 do not return the LBA capacity at all.
It is possible or even likely that the vendors who supported LBA access early (e.g. a 1994 Quantum ProDrive LPS 170AT) always reported the LBA capacity in words 60-61 with the low word first. I have not seen any hints in the ATA-2 standard that hosts should expect 32-bit LBA capacity values to be returned with the high word first.
I’m not aware of the low word vs. high word first discrepancy causing trouble in practice. I suspect that since words 54-58 (current CHS settings) are optional, most host software did not use them at all, and simply calculated the capacity from the CHS geometry. For LBA-capable drives, the value in words 60-61 would have been critical, but there were probably very few, if any, drives that both supported LBA and returned 32-bit values with the high word first.
In any case, this is a good illustration that standards should strive to be precise and complete. The first ATA standard was not, and clearly some companies understood it such that the high word should be returned first, while others returned the low word first. ATA-2 rectified the situation and unambiguously specified how 32-bit values should be returned in IDENTIFY data.