Re: Where is the CHS-LBA translation done? by David
David
Mon Feb 14 17:59:37 CST 2005
That is determined by the mapping given in the ATAPI specifications. There
are two forms, one for the standard LBA modes and another for the new 48-bit
LBA mode. Read the DDK and the ATAPI specifications to see how those
'defined' task registers are used by the drive.
IOW, Microsoft doesn't repeat the ATAPI specs or even show you how to use
them for any modern hard drive. When the port driver is accessing the
drive, the various bytes/words are placed in the task registers just like
you would if you were writing a MS-DOS utility to directly access the
IDE/ATAPI drives.
"MH-2004" <MH2004@discussions.microsoft.com> wrote in message
news:7CE51DFF-72EA-4CAA-BE38-DDA1AF1C3914@microsoft.com...
>
>
> "heinz" wrote:
>
>> > It seems that the TaskFile in ATA_PASS_THROUGH_EX uses CHS
>> representation.
>>
>> LBA's have been used in the task file for the last decade out of
>> necessity as CHS led to the half gigabyte capacity limit. You will
>> notice the "LBA" bit in the task file that changes the meaning of CHS
>> to be an LBA. Note LBA came with a capacity limitation of 137GB so a
>> few years ago they came out with the 48-bit LBA task file commands that
>> require back to back task file writes such as READ SECTORS EXT (command
>> code 24h). You can send some 48-bit LBA commands using the ATA pass
>> through ioctl's.
>>
>
> Yes, that is what I thought. However if you look at the definition of
> CurrentTaskFile in the ATA_PASS_THROUGH_EX, it is still use CHS notion.(
> see
> below for the excerption of definition of ATA_PASS_THROUGH_EX from DDK)
> .............START excerption.....
> CurrentTaskFile
> Specifies the content of the task file register on both input and output.
> On
> input, the array values in CurrentTaskFile map to the task file input
> registers in the following manner. Byte Input Register
> 0 Features register
> 1 Sector count register
> 2 Sector number tegister
> 3 Cylinder low register
> 4 Cylinder high register
> 5 Device/head register
> 6 Command register
> 7 Reserved
>
>
> .........END excerption........
>
> If what you said is true, then how are the CurrentTaskFile fields mapped
> to
> the LAB LOW, LBA Mid, LBA High and Device, fields in Command block
> Registers
> defined in ATA/ATAPI standard? Specifically, is it byte 2->LBA Low, byte
> 3->LBA Mid, byte 4 ->LBA High, part of byte 5 ->Device?
>
>
>
> Thanks!
>