[Kos-dev] Re: ATA & LBA : new experimentations

Søren Schmidt kos-dev@enix.org
Tue, 12 Feb 2002 12:31:08 +0100 (CET)


It seems thomas.petazzoni@enix.org wrote:
> I made some experimentations about my problem concerning the use of
> LBA.
> 
> First experimentation :
> -----------------------
> Instead of reading sector 0, and then reading sector 64, I did the
> following :
>  * read sector 0
>  * identify drive (to make sure there is something else in the
> controller buffer)
>  * read sector 64
> 
> But read sector 64 still returned the contents of sector 0.
> 
> Second experimentation :
> ------------------------
> 
> I tested if the Error bit was set BEFORE sending the command, and it
> was set. So I added a software reset BEFORE sending the command. I
> don't know why exactly I need to reset the device, but it works much
> more better now.
> 
> Then, AFTER sending the command (for a LBA read, for any sector,
> including sector 0), the Error bit is set, and the Error register is
> set to 0x10, which means IDNF : Requested Sector ID Not Found.
> 
> That's strange because I have
>  sector = 0;
>  cyl_lo = 0;
>  cyl_hi = 0;
>  drive_head = 0xA0     | 0x40 | 0      | 0
>               SETBITS    LBA    HEAD 0   MASTER
> 
> And it returns an error.

Hmm, it could be that you dont get the LBA mode set properly in
all cases, since when you use CHS mode the fist sector is number 1
*not* 0, that would explain the error bit...

-Søren