I know that on Linux there are two types of stack: a user stack for each user thread and Kernel Stack for kernel threads (but 1 process). Interrupts, more precisely, interrupt procedures, are bridges between these two modes, the kernel (0) and the user (3). The interrupt vector table allows the processor to load the right instruction address into the PC register, but how does the stack pointer register change when it switches in kernel mode? Subroutines indicate where is the kernel stack before its first instruction? Or does the processor use two stack pointer registers (do I really doubt it)?
How does “return from interrupt” know where to return? Is the circuit board stored on the kernel stack or elsewhere?
Please feel free to fix it, I said it is true.
Many thanks for your help.
source
share