I'm studying the linux kernel right know with O'Reilly's Understanding Linux Kernel and lately covered the signal and interrupt handling chapter sticking to some basic 2.4 linux version and diving into code as far as I can understand.
Yet, I couldn't explain to myself nor finding an answer elsewhere, what is the instruction flow that occurs when, let's say, a
ctrl + c is pressed for a process which runs in the shell.
what I did figured out so far:
- once keyboard pressed APIC raises IRQ line to the cpu
- if interrupts are not maskable, cpu loads the corresponding int. handler from IDT
- than, some critical int. handler code is invoked ,handling further the
charpressed from the keyboard device's register in the APIC to other registers
from here it's vague for me.
I do understand though, that interrupt handling is not in the process context while exception is, so it was easy to figure out how exception updates
current->thread.trap_no finally invoking
force_sig. Yet, once an interrupt handler is executed, as in the example above, how does it finally gets into context with the desirable process and generating the signal?