reading atapi device

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
raz0r
Posts: 19
Joined: Sat Apr 30, 2011 6:02 pm

reading atapi device

Post 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-
RaffoPazzo
Posts: 23
Joined: Tue Apr 05, 2011 11:34 am

Re: reading atapi device

Post by RaffoPazzo »

Did you install the interrupt handler setting ide_irq_invoked to 1?
Did you clear nIEN?
Does your interrupt handler been invoked?
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: reading atapi device

Post by bluemoon »

Did you tell the compiler ide_irq_invoked is volatile? Otherwise it may try to over-optimize it.
Post Reply