Page 1 of 1

reading atapi device

Posted: Wed Jun 08, 2011 6:10 pm
by raz0r
Hi,

I'm trying to read a ATAPI device using -ALL- of the functions that are in: http://wiki.osdev.org/IDE
I'm calling ide_atapi_read() and the problem is in the function ide_wait_irq():

Code: Select all

void ide_wait_irq() {
   while (!ide_irq_invoked)
      ;
   ide_irq_invoked = 0;
}
when this function is called by ide_atapi_read(), the while loops infinite time.
...which could be my problem? the IRQ numbers are the default in my OS and the interrupts i think that are enabled.
Maybe i need put some interrupt/irq extra definition in some part of my os?

pd: i dont have problems with ATA read, my problem is in ATAPI because it uses IRQs....
thanks-

Re: reading atapi device

Posted: Thu Jun 09, 2011 2:07 am
by RaffoPazzo
Did you install the interrupt handler setting ide_irq_invoked to 1?
Did you clear nIEN?
Does your interrupt handler been invoked?

Re: reading atapi device

Posted: Thu Jun 09, 2011 2:50 am
by bluemoon
Did you tell the compiler ide_irq_invoked is volatile? Otherwise it may try to over-optimize it.