Based on my understanding, when an interrupt is fired, the CPU will switch to kernel mode, and when the interrupt is handled, the operating system will switch the CPU back to user mode.
Now my questions are:
- How did the operating system switch the CPU to user mode (what is the assembly instruction used?).
- Is there an assembly instruction that switches the CPU to kernel mode, or does the switch to kernel mode only happens when an interrupt is fired?
syscall
andsysenter
. – Jester