Page 2 of 2

Posted: Tue Jun 10, 2008 1:51 am
by mduft
pcmattman wrote:You should also note that it's not the same for exceptions. At least, not if I remember correctly. They are affected by the IF.

This though is where it gets a bit hazy, and I've got way too much schoolwork tonight to be able to test it right now.
hehe, no problem.

i tended to think the same, but i did a quick test by triggerind a div/0 exception (not with "int 0" but with faulty code of course :)) just _before_ enabling interupts, and it triggered my just set-up exception handler, so it seems that those are unaffected by the IF too...(To be sure i did a "cli" just before that too)?. maybe only the fault/abort exceptions? of course manually doing "int 0" is the same as doing "int 32" and delivers an interupt as expected.

Posted: Tue Jun 10, 2008 2:45 am
by Combuster
IF only has effect on external interrupts (i.e. those from devices).

Consider this: if you have interrupts disabled and the kernel crashes, you still want to be able to produce an error message via the interrupt handler. Same for INT xx instructions, you can call the bios even with interrupts disabled. If interrupts wouldn't happen when IF is cleared, then why would the bios documentation say "Interrrupts are enabled when necessary"

Posted: Tue Jun 10, 2008 2:53 am
by pcmattman
Thanks for the clarification, Combuster. I had a feeling I was wrong :D.