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

DID I GET IT RIGHT? Answer: NOT QUITE. Here is updated algorithm...

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

The updated/corrected algorithm would look like this (and 
I added Sector Count too):

if ( 48-bit_command )
{
   write bits 15-8 of sector count to Sector Count;
   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 40H (LBA=1) OR'ed with DEV to Drive/Head;
}
write bits 7-0 of sector count to Sector Count;
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 DEV 
       OR'ed with bits 3-0 of offset 3
          to Drive/Head (LBA 27-24);
}

I think this is "more correct"?


***  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