Protection fault

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
Jerry

Protection fault

Post 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
Jerry

RE:Strange

Post 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..
GT

RE:Strange

Post 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.
Post Reply