/os-dev

Hobby OS dev

Primary LanguageC

Writing a Simple Operating System — from Scratch

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 Continued

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.

Disclaimer

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.

Table of contents

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):

  1. Memory
  2. Processes
  3. Filesystem

Links

A few inspirational sources: