IDE knowledge anyone?
Paul Berger
phb.hfx at gmail.com
Wed Dec 30 13:20:49 CST 2015
On 2015-12-30 3:01 PM, Oliver Lehmann wrote:
> I checked now with MS-DOS and issuing a simple "DIR D:\" command with
> a power cycled disk:
>
> Command: C4h (Read Multiple)
> -> 51h, 51h -> 04h
>
> Command: 10h (Obsolete???)
> -> 50h, 50h -> 04h
>
> Command: 91h (Initialize Drive Parameters)
> -> d0h, d0h, d0h, .... 50h
>
> Command: C6h (Set Multiple Mode)
> -> 50h
>
> Command: C4h (Read Multiple)
> -> 58h
>
> The first C4h Command returns the same error, but
> after this it seems like the drive is "initialized"
> and then the 2nd C4 command afterwards works! Great.
> I guess C6h is only needed because read multiple is
> used, so I probably have to do only the 10h and
> 91h stuff... just need to find out more about it.
>
> Does anyone know what command 10h is? The documentation
> I have only states "obsolete".
>
>
> Oliver Lehmann <lehmann at ans-netz.de> wrote:
>
>> OK,
>>
>> detatching the power cord of the disk from my PC while
>> running FreeBSD and reattaching it also brings up error
>> code 4 on the next access. This does not happen with
>> other drives. So it must be some sort of initialisation
>> the OS or BIOS does which readies up the drive.
>>
>>
>> Oliver Lehmann <lehmann at ans-netz.de> wrote:
>>
>>> OK, I just got my Logic Analysator and traced the
>>> communication on my PC while forcing it to do PIO
>>> instead of DMA.
>>> I then changed my AVR code to do the exact same
>>> commands and nearly the same timings and... nothing
>>> changed - the drive still responds with error code
>>> 0x04 after the read sector 0x20 command is issued.
>>>
>>> On the PC:
>>> I noticed a time frame of 115,230ns between the
>>> 0x20 Command and the first alternate status register
>>> read. during that time, INTRQ goes high so the drive
>>> "is done" and wants the host to interact with it
>>> again. IORDY is the whole time high from the host.
>>> The status read is 0x58 on the PC.
>>>
>>> On the AVR:
>>> IORDY is the whole time low (it is not connected),
>>> INTRQ stays low the whole time, and the first status
>>> read back is 0xD0 for a long time and then it goes to
>>> 0xD1 and then 0x59.
>>>
>>> Things I plan to try next:
>>>
>>> - power down the drive on the pc, power it up and then
>>> try to access sector 1 again and see what happens.
>>> Maybe some magic "initialization" is done on bootup
>>> what I don't do.
>>> - make IORDY high on my AVR too
>
>
According to my book "The SCSI Bus and IDE Interfaces Protocols,
Applications and Programming" 0x10 to 0x1F are "Recalibrate" "All
opcodes between 10h and 1Fh are interpreted as a RECALIBRATE command,
whereupon the disk drive seeks track 0. If it is not found, TK0NF will
be set in the error register. RECALIBRATE is often used when trying to
recover from an error situation. For example when a sector cannot be
found, a RECALIBRATE should be tried. If this works, a sector access
can be tried again. Otherwise, it is a fatal disk error."
Paul.
More information about the cctech
mailing list