Software engineer Yunhao Zhang has informed us of a major milestone for the egos-2000 project, which teaches core concepts through a custom-built operating system written in just 2,000 lines of code: the release of the supporting EGOS book.
“Recently, my friends and I have finished the first draft of the EGOS book and put it free online,” Zhang tells us via email. “This book contains nine course projects based on egos-2000 and, after doing the hands-on projects, students will finish reading all the code of egos-2000. My friends are currently using this book to teach CS4411 at Cornell and CS6640 at Northeastern.”
The EGOS book is out now, in draft form, offering an undergraduate-to-master level course in operating systems. (π·: Yunhao Zhang)
We first looked at egos-2000, the “Earth and Grass Operating System,” back in May 2023. “This project’s vision is to help every college student read all the code of an operating system,” Zhang explained at the time. “With only 2,000 lines of code, egos-2000 implements every component of an operating system for education.”
Designed for use with RISC-V devices, FPGA cores, or an emulator such as QEMU, egos-2000 is based on the earlier egos-classic β both developed for student use at Cornell University. With exactly 2,000 lines of code, egos-2000 is small enough that it can be easily read through and understood β particularly now Zhang and friends have released the EGOS book.
The operating system is designed to be small enough to read and fully understand, featuring just 2,000 lines of code in total. (π·: Yunhao Zhang)
The online book covers nine lessons that walk through the operating system bit-by-bit: the de rigueur “hello, world” lesson; cooperative threads; preemptive scheduler; system call and protection; virtual memory; serial device driver; file system; Ethernet and TCP/IP connectivity; and multicore and locks. The first six are described as “core projects,” which target the knowledge required for an undergraduate-level course like Cornell’s CS4411; the remaining three target a “master-level OS course” like Cornell’s CS5411.
The EGOS book is now available to read in full on egos.fun, while the egos-2000 source code is available on GitHub under the permissive MIT license.