Copying information into faster storage system; main memory can be viewed as a cache for secondary storage
Part 3/4
Everything else (apps, GUIs, utilities) runs on top of the kernel
Process Management
Memory Management
I/O and Device Management
Storage Management
Protection & Security
Why?
Part 4/4
Needs resources:
Many processes run concurrently:
Concurrency achieved by multiplexing CPUs among processes/threads
The OS is responsible for:
Relationships form a process tree:
A program becomes a process when loaded into memory
As a process runs, it changes state:
Scheduler picks which ready process gets the CPU
May occur when a process:
In cases (1) & (4): no choice (must switch)
In (2) & (3): scheduler has a choice
Non-preemptive:
Preemptive:
All modern OS (Windows, Linux, macOS, UNIX) use preemptive scheduling
| Process | Time |
|---|---|
| P1 | 24 |
| P2 | 3 |
| P3 | 3 |
Schedule:
Processes arrive: P2, P3, P1
Much better than previous case
But… how do we know the burst length?
| Process | Time |
|---|---|
| P1 | 6 |
| P2 | 8 |
| P3 | 7 |
| P4 | 3 |
Average waiting time = (3+16+9+0)/4 = 7