*** Kurt Wismer wrote in a message to All:
KW> i'm looking for info on how lba (logical block addressing)
KW> is performed from a low level programming perspective (like
KW> asm)... i'm not looking for code or even pseudo-code, simply
KW> an explanation of the difference (different register
KW> contents, additional steps, etc) that i would need to take
KW> into consideration when addressing some sector X under lba
KW> mode as opposed to the normal bios addressing mode (which i
KW> already know how to do)...
That is handled internally by the BIOS.
If you're accessing the ports directly, LBA mode is identical to CHS mode,
but the same fields are used differently. Sectors is used as bits 7-0 of the
LBA value, cylinder low is used as bits 15-8, cylinder high is used as bits
23-16, heads is used as bits 27-24. The byte that specifies the Heads value
also holds the bit used to distinguish between CHS and LBA. The field is
thus: 1L1DHHHH, where H is the heads value (or bits 27-24 of the LBA), D is
the drive, and L is the LBA indicator.
This is listed in PORTS.LST in Ralf Brown's Interrupt List package, with 533
lines of port and command definitions just for ATA devices. The file not
only lists the commands used for IDE hard drives, but also for IDE CD-ROMs
and for SMART (Self-Monitoring, Analysis, Reporting Technology), which I've
only recently heard of. In my opinion, Ralf Brown's list (the most current
version, of course) is an indispensible reference for any programmer who
isn't exclusively an applications programmer.
There's a lot that I don't understand about accessing IDE devices directly,
even though I've written my own IDE identify program; there were some drives
that my program was not able to access reliably, nor could my program get the
info when the drive was in a certain state, although other programs would be
able to do so. The ATA specs are big on hardware specs but seem to be
lacking in programming details.
--Scott.
--- timEd 1.01
---------------
* Origin: Wizard's, 254-554-2146, Abacus PLUS, 903-3097 (1:395/11)
|