CSE Roadmap

Core tier · about 2 hours · 8 parts

Part 8 of 8 · 3 min read

Exercises

Easy

Easy 1: Match services (20 minutes)

Match each task to a service: copying a photo, stopping an app from reading another app's data, recording how much memory a program used, starting a game.

Done when: file system, protection and security, accounting, and program execution.

Hint

Think of the nine services in section 1.

Easy 2: Count the boundaries (20 minutes)

A request passes down through 5 layers and back up. Each boundary costs 0.2 microseconds. Give the number of boundaries and the total cost.

Done when: you write 10 boundaries and 2 microseconds.

Hint

Down and back up doubles the layers.

Easy 3: Message cost (20 minutes)

A microkernel read needs 4 messages at 2 microseconds each. Give the extra cost compared with a monolithic read.

Done when: you write 8 microseconds.

Hint

4 × 2.

Medium

Medium 1: Percentage overhead (30 minutes)

A device read takes 50 microseconds. Find the percentage overhead of a microkernel read with 4 messages at 1.5 microseconds each. Then do it for a read that takes 500 microseconds.

Done when: you write 12 per cent and 1.2 per cent.

Hint

Extra cost divided by the device time.

Medium 2: Driver bugs (30 minutes)

A kernel has 12 million lines, 65 per cent drivers. With one serious fault per 8,000 lines, give the expected faults in drivers. Then give the number if drivers moved to user mode and only 3 million lines stay in the kernel.

Done when: you write 975 expected driver faults, and 375 faults left in the kernel.

Hint

12,000,000 × 0.65 / 8,000.

Medium 3: Read lsmod (30 minutes)

On a Linux machine, run lsmod and uname -r. Pick three modules and say what each is probably for.

Done when: three module names with a one-line purpose for each, found with modinfo or a search.

Hint

modinfo <name> prints a description.

Hard

Hard 1: Draw four designs (60 minutes)

Draw the monolithic, layered, microkernel and module designs for the same small OS with a file system, a disk driver and a network driver. Mark which parts run in kernel mode.

Done when: four diagrams with the kernel and user mode parts labelled.

Hint

A module sits in kernel mode, a microkernel server in user mode.

Hard 2: Break-even point (60 minutes)

A microkernel read costs 6 microseconds more than a monolithic read. A monolithic kernel crashes once a year on average because of a driver bug, and each crash costs 30 minutes of downtime. How many reads a second would the machine have to serve before the extra cost exceeds the downtime saved? Treat the extra cost as lost processor time and show your assumptions.

Done when: a calculation with stated assumptions that reaches about 9.5 reads a second (1,800 / (6 µs × 31,536,000 s)).

Hint

Seconds in a year are 31,536,000.

Hard 3: Pick for a product (60 minutes)

Choose a design for a smartwatch, a web server and a car's brake controller. Give one reason for each choice.

Done when: three choices with reasons that name speed, safety or ease of change.

Hint

Safety comes first for the brake controller.