- A key requirement for an operating system is to support several activities at once.
- Thus an operating system must fulfill three requirements:
- multiplexing
- isolation
- interaction
Abstracting physical resources
- It’s more typical for application to not trust each other, and to have bugs, so one often wants stronger isolation than a cooperative scheme provides.
- To achieve strong isolation it’s helpful to forbid applications from directly accessing sensitive hardware resources, and instead to abstract the resources into services.
- Similarly, Unix transparently switched hardware CPUs among processes, saving and restoring register state as necessary, so that applications don’t have to be aware of time sharing.
- Strong isolation requires a hard boundary between applications and the operating system.
- To achieve strong isolation, the operating system must arrange that applications cannot modify the operating system’s data structures and instructions and that applications cannot access other processes’ memory.
Kernel organization
- A key design question is what part of the operating system should run in supervisor mode.
monolithic kernel
- OS runs in kernel space
- kernel interface == system call interface
good
- it is easier for different parts of the operating system to cooperate
- one cache shared by file system and virtual memory
bad:
- interfaces between different parts of the operating system are often complex
- it’s easy for operating system developer to make a mistake
- no isolation within
microkernel
- many OS services run as ordinary user programs
- kernel implements minimal mechanism to run services in user space
- kernel interface != system call interface
good
- more isolation
bad
- may be to hard to get good performance