ATAPI Questions
Posted: Sat Sep 11, 2010 1:35 pm
Lately I've been bothered by some questions regarding ATAPI. I would appreciate it if someone could shed some light on the situation. The ATAPI specification contains 'flows' that specify how to go about reading PIO data from the device and writing data to it. The specific section I'm curious about is section 5.8 (from the ATAPI CD-ROM Specification, page 25). According to the specification, as soon as data is available to the host and it has placed data in the cylinder low and cylinder high registers, it sends an IRQ (they call it 'INTRQ'). My question is actually if this only counts for actual PIO data reads (so reading data from sectors), or does it also count for commands such as 'Read Capacity', 'Start/Stop', etc. The other commands also involve sending a packet string and 'receiving data', but usually of a smaller size (for Read Capacity, that would be 8 bytes according to the spec). So do we wait for an IRQ there too? The spec seems a little vague about this situation.
I would also appreciate it if anyone could point out things that may behave strangely or I need to look out for. The reason is that I've had a working ATA/ATAPI implementation for quite some time now... except for that it only seems to work in the emulator. At first I could read anything from ATAPI devices (even finding the name of the device failed), but I seem to have reached a point where only the capacity of the device is wrong (but the sector size in 8-byte packet from Read Capacity is correct) and my ATAPI read commands seem to constantly get aborted (DRQ = 0 after receiving IRQ, it should be set to 1 according to the spec to indicate I may continue reading data).
EDIT: I also found in the ATAPI specification that some devices may need to read media for a command to be successfully executed. Does this imply that the ATAPI device itself will read the media and I only have to wait a bit longer before timing out to allow the drive to spin up, or does it mean that I explicitely have to start the motor or read from the device?
Thanks in advance,
Creature
I would also appreciate it if anyone could point out things that may behave strangely or I need to look out for. The reason is that I've had a working ATA/ATAPI implementation for quite some time now... except for that it only seems to work in the emulator. At first I could read anything from ATAPI devices (even finding the name of the device failed), but I seem to have reached a point where only the capacity of the device is wrong (but the sector size in 8-byte packet from Read Capacity is correct) and my ATAPI read commands seem to constantly get aborted (DRQ = 0 after receiving IRQ, it should be set to 1 according to the spec to indicate I may continue reading data).
EDIT: I also found in the ATAPI specification that some devices may need to read media for a command to be successfully executed. Does this imply that the ATAPI device itself will read the media and I only have to wait a bit longer before timing out to allow the drive to spin up, or does it mean that I explicitely have to start the motor or read from the device?
Thanks in advance,
Creature