Page 1 of 1
Protection fault
Posted: Sun Jul 04, 2004 11:00 pm
by Jerry
This is kinda weird.. some times when I start my OS I get General Protection Fault after I´ve enabled the interrupts again (after disabling them, remapping the PIC, set up the IDTR and all that)... this allways occurs when I try to enable interrupts.. and only sometimes, mabye one of ten times.. Thought it mabye could be wrong to enable interrupts when some device isnt "ready", I have no code that waits for any "status to be ok", I just proceed
RE:Strange
Posted: Sun Jul 04, 2004 11:00 pm
by Jerry
If I mask all IRQs immediately after I´ve remapped the IRQ (in the same function), it doesnt happen... but if I remap the PIC and then calls a new function that maskes the IRQs, I get the error sometimes..
RE:Strange
Posted: Tue Jul 06, 2004 11:00 pm
by GT
You should disable interrupts whenever you're reprogramming the PIC, and don't reenable them until you're done messing with the PIC, setting the masks, setting the IRQ bases, installing interrupt handlers, etc.