I'm not trying to create an OS but I'm learning about WDM & Linux device driver development, and also reading the Intel System Programming Manuals.
Here is what confuses me:
The Intel manuals and also the wiki on this forum and several other places online mention that an Interrupt Gate DISABLES IRQs upon entry and enables them again after leaving the ISR. (pops up the EFLAGS)
However, Linux as well as Windows literature suggests that IRQs can be preempted by other, higher priority, IRQs (sometimes it seems there aren't even real hardware priorities and any IRQ can preempt another but the priority is enforced with software trickery, (I'm not even sure how the whole IRQL business is implemented on Windows) )
So IRQs clearly seem to be nested.
Sample ISRs always take this form though:
Code: Select all
isr:
pusha
push gs
push fs
push es
push ds
[b]; absence of a sti instruction to enable IRQs again, is this even allowed/recommended?[/b]
; do what you want to here :)
pop ds
pop es
pop fs
pop gs
popa
iret