- A program usually executes in user mode and switches to kernel when requesting kernel services using system calls.
- Kernel creates, eliminates, and syncs processes. It is a process MANAGER not a process itself.
- Kernel Threads: Run in kernel address space, do not interact with users, created during startup
Example of execution flow on a uniprocessor system
- System call by user program runs something in kernel mode
- Scheduler interrupts process 1 because it ran too long and allows process 2 to run
- An interrupt was received by the system (eg. keyboard press) and processes tat before returning to process 2
Ways to activate kernel routines
- System calls invoked by user programs
- CPU raises an exception (error)
- Interrupt by something like an I/O device (processed by interrupt handler)
- Kernel threads