Purpose

Reading notes on the exokernel paper. The note records the architecture, the case for pushing abstractions out of the kernel, the reported performance wins, and my doubts about why the idea never took over.

Citation

Problem

Monolithic kernels prescribe the interfaces of key OS abstractions like virtual memory and the file system, and applications pay for those prescriptions in performance. An application cannot modify or optimize the abstractions for its needs, so it works within a one-size-fits-all implementation that favors generality over performance for any specific workload. Databases fighting the file system and networking stacks that force copies are the classic symptoms.

Main idea

Shrink the kernel’s job to securely multiplexing hardware and leave the abstractions to the client. The key move is separating resource protection from resource management. The exokernel provides secure bindings that grant access to a device or a physical page without needing to understand how it will be used. Management, meaning the actual VM policy, file system, or network stack, lives in a library operating system the application links against and can swap or specialize.

The interface the kernel exposes should sit as close to the hardware as possible, using physical names like physical addresses directly. The paper also lets applications download code into the kernel to shortcut the user-kernel boundary, which reads a lot like an early version of what eBPF does today.

The same abstractions exist in both architectures; the exokernel just moves them above the protection boundary:

flowchart TD
    subgraph MONO[Monolithic]
        APP1[Application]
        K1[Kernel with VM policy, file system, network stack, protection]
        HW1[Hardware]
        APP1 --> K1
        K1 --> HW1
    end
    subgraph EXO[Exokernel]
        APP2[Application]
        LIB[Library OS with VM policy, file system, network stack]
        XK[Exokernel, secure bindings and protection only]
        HW2[Hardware]
        APP2 --> LIB
        LIB --> XK
        XK --> HW2
    end
    style LIB fill:#e8f5e9,stroke:#2e7d32
    style XK fill:#e3f2fd,stroke:#1565c0

Why this helps

General-purpose kernel abstractions carry overhead in two ways. First, resources are so thoroughly abstracted that applications cannot manage them at all; exposing hardware-level names gives that control back. Second, applications constantly cross into the kernel for operations that could run in user space, and the context switches add up.

Keeping the kernel interface small also pays for itself in design terms. A kernel that does little can optimize what it does aggressively. Less code means less to maintain and less to break. And new functionality lands as a library OS rather than a kernel change, which is a much easier path to extensibility.

Evidence

The authors built Aegis, an exokernel, plus ExOS, a library OS, and measured primitive operations against Ultrix, a mature Unix on the same hardware. Many primitives, including exception handling, virtual memory operations, and IPC, ran one to two orders of magnitude faster than Ultrix, and some beat contemporary state-of-the-art implementations. The wins come from reduced context switching, low-overhead multiplexing of hardware, and specialized user-space implementations of the affected subsystems.

Assumptions and limits

Compatibility work gets kicked up into user space. Every application developer or library OS maintainer now owns problems the kernel used to solve once, which likely costs stability and reliability. Third-party library OSes are hard to trust, and unless standards for user-space OS components are both developed and widely adopted, fragmentation is a real risk. Porting is also harder. An application depends on its library OSes, and all of them need porting to bring the application to a new exokernel.

Open questions

  • Why didn’t this work out? I was fully bought in by the end of the paper, but exokernels were never adopted.
  • Can the approach be applied to modern workloads, particularly in datacenters?
  • How can malicious or destructive library OSes be prevented?

Sources