Operating System in 1,000 Lines - Overview

  1. Intro
  2. Getting Started
  3. RISC-V 101
  4. Overview
  5. Boot
  6. Hello World!
  7. C Standard Library
  8. Kernel Panic
  9. Exception
  10. Memory Allocation
  11. Process
  12. Page Table
  13. Application
  14. User Mode
  15. System Call
  16. Disk I/O
  17. File System
  18. Outro

Features in 1K LoC OS

In this book, we will implement the following major features:

Features not implemented

The following major features are not implemented in this book:

Source code structure

We'll build from scratch incrementally, and the final file structure will look like this:

├── disk/     - File system contents
├── common.c  - Kernel/user common library: printf, memset, ...
├── common.h  - Kernel/user common library: definitions of structs and constants
├── kernel.c  - Kernel: process management, system calls, device drivers, file system
├── kernel.h  - Kernel: definitions of structs and constants
├── kernel.ld - Kernel: linker script (memory layout definition)
├── shell.c   - Command-line shell
├── user.c    - User library: functions for system calls
├── user.h    - User library: definitions of structs and constants
├── user.ld   - User: linker script (memory layout definition)
└── run.sh    - Build script

In this book, "user land" is sometimes abbreviated as "user". Consider it as "applications", and do not confuse it with "user account"!