Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 09 Jul 1997 08:35:19 +0200
From:      Poul-Henning Kamp <phk@critter.dk.tfs.com>
To:        bde@freebsd.org, sos@freebsd.org, doc@freebsd.org
Subject:   wisdom on IDE devices
Message-ID:  <4313.868430119@critter.dk.tfs.com>

next in thread | raw e-mail | index | archive | help

Dunno if this is useful to any og you guys:

From: mevans@qntm.com (Mark Evans)
Subject: C/H/S and LBA Calculation Rules
To: t13@dt.wdc.com

     Hello all,
     
     I am still a little confused (maybe a lot confused) about the rules for CHS 
     and LBA values in IDENTIFY DEVICE data and in the Task File for commands.  
     Soooo, I updated the rules that Dan Colgrove and I put together a couple of 
     months ago including what I think is said in Dan's latest revision of his 
     SET MAX proposal, and Curtis Steven's proposal for modification of Annex B. 
     Could you all take a look at this and see if I, a) got what's here correct, 
     and b) left anything out?
     
     Please call me or send an email to me if you have any questions or 
     comments.
     
     Thanks in advance,
     
     Mark Evans
     Quantum Corporation
     500 McCarthy Boulevard
     Milpitas, CA 95035 USA
     Tel: 408-894-4019
     FAX: 408-894-4990
     email: mevans@qntm.com
     
     
     C/H/S and LBA Calculation Rules
     
     I.  General Rules
     
     1)  The following is a list of variables and constants and their maximum 
     values from IDENTIFY DEVICE data used in these rules:
     
     C  =  Word 1 (# of default logical cylinders, if I6061 <= 16,515,072 then C 
     <= 16,383, if I6061 > 16,515,072 then C = 16,383)
     H  =  Word 3 (# of default logical heads, <= 16, may be = 15 if C > 8191)
     S  =  Word 6 (# of default logical sectors, <= 63)
     Cip  =  Word 54 (# of cylinders in the current translation, <= 65,535)
     Hip  =  Word 55 (# of  heads in the current translation, <= 16)
     Sip  =  Word 56 (# of sectors in the current translation, if I6061 <= 
     1,032,192 then Sip <= 255, if I6061 > 1,032,192 then Sip <= 63)
     I5758  =  Words 57-58 (current capacity in sectors, <= 16,515,072)
     I6061  =  Words 60-61 (total # of user addressable sectors, <= 267,382,800)
     
     2)  All results of divisions are integers with the remainder discarded.
     
     3)  If a SET MAX ADDRESS command specifies the C/H/S mode, then the logical 
     cylinder, head and sector values set by the host in the task file for the 
     command specify the maximum ADDRESS to be used by the device for C/H/S.  
     These ARE NOT the specific maximum cylinder, head and sector values to be 
     used by the device.
     
     4)  Devices may access any address requested by the host in CHS mode so 
     long as:  
     
     a)  The requested cylinder value is <= 65,535
     b)  The requested head value is <= (Hip - 1)
     c)  The requested sector value is <= Sip
     d)  The product of the requested cylinder*head*sector values is <= I6061
     
     5)  Devices may respond with an "ID NOT FOUND" or an "ABORTED COMMAND" 
     error to any command with a CHS address request where:
     
     a)  The requested cylinder value is > Cip
     b)  The requested head value is > (Hip - 1)
     c)  The requested sector value is > Sip
      
     II.  Rules for IDENTIFY DEVICE information
     
     1)  At power on Cip = C, Hip = H and Sip = S 
     2)  I5758 = Cip * Hip * Sip
     3)  I6061 >= I5758
     
     III.  Rules for after a successful INITIALIZE DEVICE PARAMETERS
     
     1)  C, H, S and I6061 are unchanged
     2)  Hip and Sip are as specified in the IDP command, where:
          a)  Hip <= 16
          b)  Sip <= 255 if I6061 <= 1,032,192, or <= 63, if I6061 > 1,032,192
     3)  Cip = I6061 / (Hip * Sip) or 65,535, whichever is less
     4)  I5758 = Cip * Hip * Sip
     
     IV.  Rules for after a successful SET MAX ADDRESS using CHS addressing
     
     1)  H, S, Hip and Sip, are unchanged
     2)  C is as specified in the SET MAX command (and is <= 16,383)
     3)  I6061 = C * H * S
     4)  Cip = I6061 /  (Hip * Sip) or 65,535, whichever is less
     
     V.  Rules for after a successful SET MAX ADDRESS using LBA addressing
     
     1)  H, S, Hip and Sip, are unchanged
     2)  I6061 is as specified in the SET MAX command
     3)  C = I6061 / (H * S) or 16,383, whichever is less
     4)  Cip = I6061 / (Hip * Sip) or 65,535, whichever is less
     5)  I5758 = Cip * Hip * Sip
     
     VI.  Rules for READ NATIVE MAX ADDRESS after a successful IDP
     
     1)  Returns Native C, H and S in CHS addressing mode 
     2)  Returns Native I6061 in LBA addressing mode

------- End of Forwarded Message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4313.868430119>