Solutions to exercises in the original book from Nick Blundell
Look into git tag before-kernel-reorg
for exercises before kernel code organization.
Writing a Simple Operating System — from Scratch (WASOS) by Nick Blundell is incomplete 😭. This is an attempt at completing it 🎉.
Actually there are existing step-by-step guides for developing an x86 UNIX-like OS. But, as nothing beats learning-by-doing, this guide is yet another documentation of the process, with lots of references and details.
We mostly follow the excellent hux-kernel from Guanzhou Hu and xv6-x86, with additions or modifications from other sources. In the end, the result much ressembles a Frankenstein OS.
Admittedly, writing this tutorial is somewhat of a nostalgic enterprise. It seeks to understand how computers were functioning in the end 1990's, beginning 2000's.
- 6.3 Handling Interrupts
- 6.4.1 Keyboard Driver
- 6.4.2 Timer Driver
- 7 Memory Management
- 7.1 Interlude: Building and Utilities
- 7.2 Physical Memory Management
- 7.3 Virtual Memory
- 7.4 Heap Allocator
- 7.5 Higher half kernel
- 7.6 Interlude — Spin Locks
- 8 Processes
- 8.1 Process Creation
- 8.2 Interlude — Serial Console
- 8.3 Process Scheduling
- 8.4 User Mode Execution
- 8.5 User System Calls
- 9 Storage
- 9.1 IDE Driver
Note the original remaining chapters from WASOS were outlined as:
- 6.3 Handling Interrupts
- 6.4 Keyboard Driver
- 6.5 Hard-disk Driver
- 6.6 File System
- 7 Implementing Processes
- 7.1 Single Processing
- 7.2 Multi-processing
- 8 Memory management
Hux-kernel somewhat follows a different order inspired by the excellent Operating Systems: Three Easy Pieces (OSTEP):
- Memory
- Processes
- Filesystem
A few inspirational sources: