Hi,
As Klakap stated, you need to acknowledge the interrupt by reading from the STATUS register after the read.
Most likely, you are reading from this status register every loop iteration at
Code:
ata_wait_for_rdy(ATA_REGULAR_STATUS_REGISTER_PORT); // Spun up
ata_wait_for_drq(ATA_REGULAR_STATUS_REGISTER_PORT); // Ready for transfer
but after the last sector read, you do not read from it.
The ata_wait_for_rdy (and _drq) should be reading from the ALT Status register, and then you should read from the Status register after the for() loop, checking for errors.
On a side note, the:
Code:
ata_wait_for_rdy(ATA_REGULAR_STATUS_REGISTER_PORT); // Spun up
is not required since your drive should already be spinning. A CD-ROM is most likely an ATAPI device and you can't read from it using this form of read command.
Ben
-
http://www.fysnet.net/osdesign_book_series.htm