Accessing Secondary IDE Devices

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
DaveHK

Accessing Secondary IDE Devices

Post 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 ?
jamethiel

RE:Accessing Secondary IDE Devices

Post 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.
DaveHK

RE:Accessing Secondary IDE Devices

Post 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 !
Post Reply