/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
#
#
#
#ident "%Z%%M% %I% %E% SMI"
#
may be wrong or too small.
In despair at reading the specs, I asked the x3t13 reflector
how one is supposed to calculate capacity:
==
X-Authentication-Warning: mage.dt.wdc.com: majordom set sender to owner-t13@dt.wdc.com using -f
Date: Thu, 11 Feb 1999 19:16:39 -0800 (PST)
From: Dan Mick <dan.mick@West>
Subject: Capacity?
To: t13@dt.wdc.com
reliably calculate the capacity of an ATA drive, but I can't make
1,3,6,53,54-58,60-61
the "ATA FAQ" from Wehman and den Hahn, and I still don't understand
56, for instance...
==
drives. David_S_Thompson@notes.seagate.com said "read section
6.2.1 of ATA-4, rev 17 or above", which does help a bit. But
>sense of the IDENTIFY DEVICE results, words
>
>1,3,6,53,54-58,60-61
>
>Is the right algorithm for making sense of all this written down
>how this can be so nondeterministic.
>
>Even assertions in the specs seem to be ignored; I have a drive for
>which words 57-58 do *not* represent the product of words 54, 55, and
>56, for instance...
this feature is not being used or it is being used and implemented
correctly...
If you have no need to use CHS mode, then just ignore words 1, 3, 6 and
53:58. Words 60:61 are the drive capacity. But even if you must use CHS
mode, words 60:61 are still the true drive capacity but words 57:58 are
the capacity that the current CHS geometry can address and [57:58] must be
<= [60:61]. Oh yea, if you find that 57:58 are big endian then 60:61 are
probably big endian too.
a different heads and sectors and repeat this step.
- No, then go to 2b).
2b) Does the drive support LBA and is [1]*[3]*[6] <= [60:61]?
- Yes, assume 60:61 are correct, and go to 2c)
- No, go to 2d)
2c) Issue a Init Drv Params and set your favorite heads and sectors.
Compute the number of cylinders:
num-cyl = [60:61] / (favorite heads) * (favorite sectors)
The drive capacity is (num-cyl)*(favorite heads)*(favorite sectors).
And this value should be in 57:58 now. You are done.
2d) Now you got a problem... 60:61 are no good, 53:58 are no good.
have to say bad things about the documents published by some of my friends
a few years ago!).
reflector that will just bore you to near death!
+---------------+---------------------------+
| Hale Landis | hlandis@ibm.net |
| Niwot, CO USA | hlandis@sugs.talisman.com |
+---------------+---------------------------+
| !! Coming soon: www.talisman.com/sugs !! |
+-------------------------------------------+