4.2.2 · D3Operating Systems

Worked examples — OS structure — monolithic, microkernel, hybrid

3,865 words18 min readBack to topic

First: what exactly is "one crossing"?

Before counting anything, we must earn the number we count — and pin down exactly one meaning for it so every example agrees.

Figure — OS structure — monolithic, microkernel, hybrid

The scenario matrix

Every worked example below is tagged with the cell it fills. Together they cover the whole grid. The middle column names the case class; the right column says what makes that case tricky.

Cell Case class What makes it tricky
A Simple request, monolithic baseline: proving the "" claim
B Simple request, microkernel (2 servers) the "" case, chained servers
C Same request, hybrid which servers are in-kernel?
D Zero-crossing / degenerate input request needs no privileged service
E Growth case: many servers (limiting, large ) grows linearly — the microkernel wall
F Limiting case: push all servers into kernel microkernel → monolithic in the limit
G Real-world word problem web server serving a file, multi-syscall path
H Exam twist: "smaller kernel = faster?" the trap the parent warned about
I Reliability edge case: a driver crashes what survives, per structure
J Fast-path edge case: shared-memory IPC when a "crossing" doesn't occur

Worked examples

Figure — OS structure — monolithic, microkernel, hybrid
Figure — OS structure — monolithic, microkernel, hybrid
Figure — OS structure — monolithic, microkernel, hybrid

Recall Quick self-test on the counting rule

Master formula: what is in terms of (user-mode servers visited)? ::: — a fixed app bracket of 2, plus 2 per user-mode server. A microkernel request visits 3 user-mode servers. Using , what is ? ::: . On a monolithic kernel, a request making 4 separate system calls (each internal, ) costs how many crossings? ::: (each syscall is its own bracket; internal hand-offs are free). A hybrid keeps FS in-kernel but driver in user space () — what is for a file read? ::: , between mono () and pure micro (). If , which structure is fastest? ::: All three tie — pure user-space work ( and no trap) never crosses the border, so kernel structure is irrelevant. Does a shared-memory IPC fast path raise or lower ? ::: It lowers : the data hand-off pierces no border, so those crossings drop out, pushing the microkernel cost toward the monolithic floor.