CSE Roadmap

Core tier · about 2 hours · 8 parts

Part 6 of 8 · 2 min read

Design goals

Think of buying a car. Buyers want comfort, speed, safety and a low price, and each one costs something in the others. An OS is judged in the same way. The analogy stops in one place: a car has one owner to please, and an OS serves many programs and users at once.

In plain words: A good OS balances goals that pull against each other: convenient abstractions, speed, protection between programs and reliability. Checking every memory access makes programs safer and a little slower. Design is mostly the choice of such trade-offs.

An OS is judged by a few goals. They pull against each other, so good design is mostly the choice of trade-offs.

  1. Abstraction. Hide messy detail behind simple ideas such as "process", "file" and "address space". Abstraction lets people write a large program in pieces, without thinking about assembly code or logic gates.
  2. Performance. Keep overhead low, in time (extra instructions) and in space (extra memory or disk). Virtualisation is worth its cost only if the cost stays small.
  3. Protection and isolation. A bad or malicious program must not harm other programs or the OS. Keeping processes apart from each other is the key to protection.
  4. Reliability. If the OS fails, every program on it fails. It must run non-stop, which gets harder as the code grows to millions of lines.
  5. Other goals. Energy use, security against attack and mobility (small devices) matter more each year. The right balance depends on the system: a phone, a server and a car controller choose differently.

A worked example.

An example of a trade-off (made up to show the idea). Checking every memory access for permission makes programs safer but slower. Suppose the check adds 2 per cent to run time. A server hosting other people's programs accepts that cost. A tiny controller running one trusted program may leave the check out to save time and chip area.

Read it as

Every OS feature is an answer to one of these goals. When a design looks odd, ask which goal it serves and what it gives up.

Check yourself: 1. Which goal is served by keeping processes separate? 2. Name one cost of virtualisation. 3. Why might a phone and a server weigh the goals differently?