After the interrupt handler completes its work, there should be return from interrupt.
Return from interrupt:
Pop from stack and restore DS
Restore interrupted procedure state with POPA
Enable interrupts with STI
IRET
In Real-Address Mode, the IRET instruction preforms a far return to the interrupted program or procedure. During this operation, the processor pops the return instruction pointer, return code segment selector, and EFLAGS image from the stack to the EIP, CS, and EFLAGS registers, respectively, and then resumes execution of the interrupted program or procedure.
In Protected Mode, the action of the IRET instruction depends on the settings of the NT (nested task) and VM flags in the EFLAGS register and the VM flag in the EFLAGS image stored on the current stack. Depending on the setting of these flags, the processor performs the different types of interrupt returns.
Comments
Leave a comment