** This is the quasi-official and semi-temporary T13 email list server. **

Confused?

The HOB bit is used only to read back the full 48-bit LBA.  The
HOB bit is not used when writing the LBA to the device.  In fact
the HOB bit is set to 0 by the device on any write to a Command
Block register.

So lets assume you are running on a stupid x86 with little endian
byte ordering and you have the 48-bit LBA in some memory area
(most likely stored in a 64-bit data area) like this:

addr     LBA
offset   bits
------   ----
0        7-0
1        15-8
2        23-16
3        31-24
4        39-32
5        47-40
6        not used
7        not used

I assume the algorithm would look like this:

if ( 48-bit_command )
{
   write offset 3 to Sector Number (LBA 31-24);
   write offset 4 to Cylinder Low (LBA 39-32);
   write offset 5 to Cylinder High (LBA 47-40);
}
write offset 0 to Sector Number (LBA 7-0);
write offset 1 to Cylinder Low (LBA 15-8);
write offset 2 to Cylinder High (LBA 23-16);
if ( 28-bit_command )
{
   write 40H (LBA=1) OR'ed with bits 3-0 of offset 3
       to Drive/Head (LBA 27-24);
}

Did I get it right?


***  Hale Landis  *** [EMAIL PROTECTED] ***
*** Niwot, CO USA ***   www.ata-atapi.com   ***


--
  If you have any questions or wish to unsubscribe send a 
  message to Hale Landis, [EMAIL PROTECTED] To post to
  this list server send your message to [EMAIL PROTECTED]
  
  For questions concerning Thistle Grove Industries or TGI's
  list services please send email to [EMAIL PROTECTED]



Reply via email to