Structure cont #

Simple structure #

Layered structure #

A 5 layered approach:
5. operator
4. user programs
3. IO management
2. communication
1. memory management
0. CPU, support for multi program
This is easier to construct and debug, however there is a communication overhead. It is impractical to divide the kernel into layers.
Microkernel structure #

Microkernels are easier to extend, but there is a lot of communication overhead. This also doesn’t support a hot patch, if we had another feature we have to recompile the kernel.
Modular kernel #

- More flexible than the layered
- More efficient than the microkernel
Processes #
File: 139-processes.pdf

Programs
- passive, on disk
Process
- active, in memory
- one of several states
One program can be executed by multiple processes.
Processes in memory #

Looking at processes #

Process states #

Note: “Waiting time” is the time spent in ready state.

This 5 state model is what we’ll use in this class.
What causes the interrupt transition: running > ready?
- the OS
What causes the scheduler dispatch transition: ready > running?
- the OS
What causes the IO or event wait transition: running > waiting?
- the process itself
What causes the IO or event completion transition: waiting > ready?
- an external process
Process Control Block (PCB) #

Process number = PID
Scheduling #
