I'm trying to get a deeper understanding of how system calls and hardware interrupts are implemented, and something that keeps confusing me is how they differ with respect to how they're handled. For example, I am aware that one way a system call (at least used to) be initiated is through the x86 INT 0x80
instruction.
Does the processor handle this the exact same way as if, say, a hardware peripheral would have interrupted the CPU? If not, at what point do they differ? My understanding is they both index the IDT, just with different indices in the vector.
In that same sense, my understanding is there's this idea of a
softirq
to handle the "bottom half" processing, but I only see this form of "software interrupt" in reference to being enqueued to run by physical hardware interrupts. Do system call "software interrupts" also triggersoftirq
s for processing? That terminology confuses me a bit as well, as I've seen people refer to system calls as "software interrupts" yetsoftirq
s as "software interrupts" as well.
int
instruction. When the CPU finds one, it operates like if it is a hardware interrupt. In Linux, kernel implements the IDT table to map interrupts with the code that "honors" the interrupt.