Page 1 of 1

Accessing Secondary IDE Devices

Posted: Fri Jan 03, 2003 12:00 am
by DaveHK
Does anyone have any experience with accessing secondary IDE devices. I am developing my OS on a PC with a hard drive on primary master and a CD on secondary master. I can access the hard drive fine, but when I try to access to CD, I get nothing, even an identify device command gives me no response.
I was assuming it was as simple as substitute all the 1Fx port accesses for the relative 17X port access, but that doesn't seem to do the trick - anyone got any ideas ?

RE:Accessing Secondary IDE Devices

Posted: Fri Jan 03, 2003 12:00 am
by jamethiel
You too, huh?

My CD is actually the secondary -slave-, with no master, which is nastier. The sample detect code I found won't find it.

A CD device will not respond to the ATA Identify Device command (well, it -does- respond, but with an abort), you need to send the Identify Packet Device command (0xa1, if memory serves) instead (and don't forget to read all 512 bytes of identification data).

I haven't yet managed to persuade my CD drive to do anything else yet, but hope springs eternal.

RE:Accessing Secondary IDE Devices

Posted: Fri Jan 03, 2003 12:00 am
by DaveHK
Oh yeah, look at that, I realised I was getting an error, but if I had bothered to read the ATA spec (hangs head in shame) properly, it returns a specific code in the cylinder registers etc. Using identify packet device (you are right, it is a1) does indeed return all the juicy details - so it was not a primary v secondary issue after all - thanks for that !