1 / 29
2 / 29
3 / 29
Your Program is Never Alone!
4 / 29
What Else is There?
5 / 29
The Hardware Model
6 / 29
Hardware Meets Software
7 / 29
Supervisor (Kernel) v/s User Mode
The CPU runs in two modes:
▶ Supervisor Mode:
• Program running on the CPU has access to all the
hardware: I/O devices & Memory
• Can execute all CPU instructions.
▶ User Mode:
• Program running on CPU is restricted from accessing all
devices or memory.
• Can execute a restricted set of CPU instructions.
8 / 29
Kernel
9 / 29
On Booting-Up
▶ The kernel
• Is loaded into memory at boot.
• Runs, initializes itself and all its data structures
• Runs the first process
▶ Process 0 (init) now has control of the CPU
10 / 29
Processes
11 / 29
Exception/Interrupt
12 / 29
Exception Tables
13 / 29
Exception/Interrupts Execution
14 / 29
During An Interrupt
15 / 29
Purpose Of Interrupts
16 / 29
Programmable Interrupt Timer
17 / 29
Programmable Interrupt Timer
18 / 29
Traps/System Calls
19 / 29
Traps/System Calls
20 / 29
Context Switch 1
21 / 29
Context Switch Preliminaries
22 / 29
23 / 29
24 / 29
25 / 29
26 / 29
27 / 29
28 / 29
29 / 29