xv6

Book

01 Operating system interfaces.pdf 02 Operating system organization.pdf 03 Page tables.pdf 04 Traps and system calls.pdf 05 Interrupts and device drivers.pdf 06 Locking.pdf 07 Scheduling.pdf 08 File system.pdf 09 Concurrency revisited.pdf 10 Summary.pdf

Table of Contents

  • 01 Operating system interfaces (p. 9)
    • Processes and memory (p. 10)
    • I/O and File descriptors (p. 13)
    • Pipes (p. 15)
    • File system (p. 17)
    • Real world (p. 19)
    • Exercises (p. 20)
  • 02 Operating system organization (p. 21)
    • Abstracting physical resources (p. 22)
    • User mode, supervisor mode, and system calls (p. 22)
    • Kernel organization (p. 23)
    • Code: xv6 organization (p. 25)
    • Process overview (p. 26)
    • Code: starting xv6, the first process and system call (p. 27)
    • Security Model (p. 28)
    • Real world (p. 29)
    • Exercises (p. 29)
  • 03 Page tables (p. 31)
    • Paging hardware (p. 31)
    • Kernel address space (p. 34)
    • Code: creating an address space (p. 35)
    • Physical memory allocation (p. 37)
    • Code: Physical memory allocator (p. 37)
    • Process address space (p. 38)
    • Code: sbrk (p. 39)
    • Code: exec (p. 39)
    • Real world (p. 41)
    • Exercises (p. 41)
  • 04 Traps and system calls (p. 43)
    • RISC-V trap machinery (p. 44)
    • Traps from user space (p. 45)
    • Code: Calling system calls (p. 47)
    • Code: System call arguments (p. 47)
    • Traps from kernel space (p. 48)
    • Page-fault exceptions (p. 49)
    • Real world (p. 51)
    • Exercises (p. 51)
  • 05 Interrupts and device drivers (p. 53)
    • Code: Console input (p. 53)
    • Code: Console output (p. 54)
    • Concurrency in drivers (p. 55)
    • Timer interrupts (p. 55)
    • Real world (p. 56)
    • Exercises (p. 57)
  • 06 Locking (p. 59)
    • Race conditions (p. 60)
    • Code: Locks (p. 62)
    • Code: Using locks (p. 64)
    • Deadlock and lock ordering (p. 64)
    • Re-entrant locks (p. 66)
    • Locks and interrupt handlers (p. 67)
    • Instruction and memory ordering (p. 67)
    • Sleep locks (p. 68)
    • Real world (p. 69)
    • Exercises (p. 69)
  • 07 Scheduling (p. 71)
    • Multiplexing (p. 71)
    • Code: Context switching (p. 72)
    • Code: Scheduling (p. 73)
    • Code: mycpu and myproc (p. 74)
    • Sleep and wakeup (p. 75)
    • Code: Sleep and wakeup (p. 78)
    • Code: Pipes (p. 79)
    • Code: Wait, exit, and kill (p. 80)
    • Process Locking (p. 81)
    • Real world (p. 82)
    • Exercises (p. 84)
  • 08 File system (p. 85)
    • Overview (p. 85)
    • Buffer cache layer (p. 87)
    • Code: Buffer cache (p. 87)
    • Logging layer (p. 88)
    • Log design (p. 89)
    • Code: logging (p. 90)
    • Code: Block allocator (p. 91)
    • Inode layer (p. 92)
    • Code: Inodes (p. 93)
    • Code: Inode content (p. 94)
    • Code: directory layer (p. 96)
    • Code: Path names (p. 96)
    • File descriptor layer (p. 97)
    • Code: System calls (p. 98)
    • Real world (p. 99)
    • Exercises (p. 100)
  • 09 Concurrency revisited (p. 103)
    • Locking patterns (p. 103)
    • Lock-like patterns (p. 104)
    • No locks at all (p. 104)
    • Parallelism (p. 105)
    • Exercises (p. 106)
  • 10 Summary (p. 107)

Companion Notes

Agent: GPT-5 Codex, 2026-04-26