Goal: move OS functionality to user level

u-kernels

⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠ You can decompress Drawing data with the command palette: ‘Decompress current Excalidraw file’. For more info check in plugin settings under ‘Saving’

Excalidraw Data

Text Elements

App

OS

Monolithic OS

u- Kernel

VM

FS

Schd

App

Servers

Mach 90s

u-Kernel

OS

App

Mach v2, L4

OS

App

Mach, co-located (dev in user level, run in kernel level)

OS

u-kernel

Exokernel

libOS

APP

libOS

APP

Exokernel

Link to original
Benefits of uKernels:

  • Easy to update
  • Easy to debug
  • Run many OSes

Drawbacks:

  • messaging overhead

L4

Goals

  • Design a uKernel with good performance - 5-10% slower
    • can we do better than Mach?
  • Run a standard OS on a uKernel
  • Do we need colocation? - no, perf. is good enough
    • efficiency
  • Specialization, extensibility - specialization: pipes, extensibility: cache partitioning, user-level pagers
    • by specialization: customize existing service
    • by extensibility: add new features

Key Abstraction

  • Threads
  • Address space
  • IPCs

L4 Architecture

⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠ You can decompress Drawing data with the command palette: ‘Decompress current Excalidraw file’. For more info check in plugin settings under ‘Saving’

Excalidraw Data

Text Elements

App

Linux

L4 uKernel

System calls monolithic OS: read() libc syscall kernel extra messages in L4 add overhead interrupts, exceptions, page faults

libc

read()

Page Tables (2 sets: one user, one kernel)

Shadow page tables

Link to original

Memory Management

  • Hierarchical address spaces
  • Linux delegates memory to apps
  • L4 grants memory to Linux
  • user-level pagers

Page Faults

  • trap to ukernel
  • ukernel sends a msg to Linux

Page Tables

  • 2 sets of page tables:
    • one in user level
    • one in kernel level (B/c kernel can’t trust user programs to run well)
  • drawbacks of shadow page tables
    • overheads for updates
    • extra memory for duplicate copies
  • Question: (is there shadow pages that only shadow the shadow pages kernel to reduce size of user level page table and only change if page is dirty)

L4 Linux Implementation

  • Modify libraries (e.g. syscalls)
  • Modify arch-dependent portions of Linux

L4 Summary

  • design of modern microkernel
  • perf. approaches monolithic kernels
  • opportunities for specialization, extensions

Exokernel

Goals:

  • Security
  • Efficiency
  • expose hardware to user level
  • push all OS user-level

exokernel

⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠ You can decompress Drawing data with the command palette: ‘Decompress current Excalidraw file’. For more info check in plugin settings under ‘Saving’

Excalidraw Data

Text Elements

Exokernel

libOS

App

libOS

App

read()

Page Table

trap

upcall

PTE

Soft. TLB

Cache TLB that is maintained at kernel level (perf. reasons)

ASH

eBPF

Link to original
Example:

  • PTE - check before installing in TLB (this is the secure binding)
  • ask for physical page
  • tables - physical pages per process

Benefits

  • lower overhead
  • easy to specialize + extend
    • can remove FS if wanted, modular, for APP

User-level management of hardware resources

  • how to provide protection?

3 Main Functions

  • protection via secure bindings decouple authorization from use
  • resource revocation & abort protocol
  • track resource ownership

Memory Management

Adoption

  • inspired approaches to virtual machines
  • high performance settings

Exokernel Summary

  • untrusted library operating systems - manage HW resources directly
  • protection using secure bindings