I'm reading about an operating system but some concept confuses me.
What doesn't confuse me:
When an interrupt or system call or processor exception occurs, it happens when user mode tries to switch to the kernel mode, the operating system uses PCB(process control block) to save needed stuff, namely - hardware completing previous instructions, saves program counter, stack pointer, registers, changes execution state and so on. For each process has a separate process control block. This seems logical.
What confuses me:
But after several subchapters, I've read that interrupt or system call or processor exception occurs, an operating system needs to save some information - program counter, stack pointer, registers, execution state and so on. But this time saves not in PCB, it saves in "interrupt stack". It also said for each process needs the separate location of "kernel stack".
After that appears a few questions:
Is "interrupt stack" and "kernel stack" the same thing, just different named?
If the operating system already has PCB, why it needs to use "kernel stack. Yes, for each process operating system has separate PCB. And
the separate location for each process in kernel stack.Does the operating system use both kernel stack and PCB? If it does, why not just one of these?
- What difference between PCB and kernel stack, if they are used for the same tasks
P.S Operating System Principles and Practice