1 Further study on process switching
Timer Interrupt is a non-cooperative approach to enforce process scheduling. To achieve this, the operating system relies on a hardware timer to generate periodic interrupts, which trigger process switching.
When the timer interrupt occurs, the currently running process is halted, and control is transferred to the OS (kernel). And the scheduler determines whether the current process should continue or if another process should run. If a new process is selected, the OS saves the context (registers, program counter, stack pointer) of the current process and loads the context of the next process.
2 Basic concepts of terminal and shell
image
I use tmux to seperate the terminal.
2. The process is managed by the OS, not the terminal itself. Therefore, we can kill any process run on the OS in different terminal.