I am currently reading "Understanding the Linux Kernel". I am studying the Interrupts and Exceptions chapter.
I found that when setting up IDT we can use five kinds of gate descriptors in Linux terminology
- Task Gate (DPL: 0)
- Interrupt gate (DPL: 0)
- Trap gate (DPL: 0)
- System Interrupt gate (DPL: 3)
- System gate (DPL: 3)
Now i realize that the ones with DPL 3 can be accessed from the user mode. But what about the ones with DPL 0 ? Particularly, interrupt gate.
If an I/O APIC interrupt occurs in User mode, it wouldn't be able to access the Interrupt gate.
So my question is, How does the user mode the kernel mode switch occur before the Interrupt gate is accessed?