Preface#

In late 2021 Jonathan Appavoo started discussing with us his vision of creating open source interactive educational materials. You can see an early talk on this here. Somehow, we found ourselves committing to writing an operating system textbook, and here we are. You will eventually find in the repository three kinds of information:

  1. This textbook which will largely be static content.

  2. Lab materials which will include significant amounts of interactive content.

  3. Lecture slides

Right now, we are focused only on the textbook portion of this materials. It can be largely read statically; and you can even download a PDF. However, we strongly recommend using it online going back and forth between different materials via the provided links. We provide a companion container (an OS concept we will discuss which we strongly recommend you keep open alongside the material and use to run exercises. The lab materials are intended to execute in the container. Moreover, the container has the curated set of tools that we expect you to use for the course, and provides the same environment as the assignments; you are likely to run into problems if you work on the assignments outside of the container environment and don’t expect TAs to help you if you do that.

Please see here for the list of contributors. This text was originally developed for the Boston University course EC 440 Operating Systems. You can view this text online or view the source.

Our motivation#

Our motivation to write this book is three fold. First, our students pay way too much money for textbooks. At one point, students could buy used textbooks, although even then publishers would constantly churn editions to get students to buy new versions. Increasingly, textbooks contain interactive materials, that force students to buy the most recent edition; again its about the money. Free online books (FOB) provide us the opportunity to address this cost issue, while also enabling frequent revisions and extensive linking between different materials. The motivation for FOB for operating systems is described in the excellent blog by Remzi Arpaci-Dusseau. Moreover, the excellent operating system FOB titled “Operating Systems: Three Easy Pieces[ADAD18], is enormously better than our effort today. So why are we developing another FOB? That leads to our next two reasons.

Second, we have found students think in many different ways and repetition at multiple different levels of detail is incredibly important to understand operating systems. The Three Easy pieces FOB does a great job of interlinking materials, enabling students to approach the material in multiple ways. However, with jupyter book and containers we can go much further; enabling dynamic content that is deeply connected to the book. Our own experience as OS developers and researchers is that we don’t understand anything until we have played with code; we hope that the model we are developing based on Jonathans OPE will enable us to give students more of that experience. In fact, as Jonathan articulates so well in the talk referenced above, students today have grown up with so many levels of software complexity obscuring the systems they are using that this interactive experience is critical to enable systems to be approached.

Third, as operating system researchers and developers that have experienced the entire growth of open source; we believe that it can be an enormously powerful tool for educational materials. While we respect Remzi’s perspective from [ADAD18] that “a book should have a single voice”, at the same time our own frustration of teaching from materials developed by others is that we want others to be able to modify any part of our content to teach operating systems in a way that reflects their background, their community of students, and their own biases. Feel free to fork our book at make it your own. We do hope that people will be motivated to offer their changes back to us; and they can do so using the same mechanisms used by community projects like Linux. Textbooks get out of date soon after they are written; and this is especially the case in operating systems which are one of the most rapidly evolving technical areas. We believe that only an open source community will be able to create educational materials that evolve as fast as the topics they cover. Hopefully, we can do a good job and create standards and a community such that the material has a coherent single voice; if not, perhaps someone that is better at it will fork our book and create such a community.

Philosophy#

This book is not intended to teach you how to program. It assumes you have mastered programming skills including data structures, algorithms, the C programming language, make, git, debuggers, test driven development, how loaders work, shell scripting and other tools. It is also not intended to teach you computer architecture; you should know what an interrupt is, multiprocessors, caches, page tables, …

However, long experience teaching the course has demonstrated that our expectation on background is seldom met. While students have taken programming courses in the past that covered much of the background; it is covered it as a academic material; when writing the fairly simple code for many courses you could get away without properly writing tests, using a debugger, or even writing a proper makefile. Moreover, often students have been able to get away with using some GUI that tries to hide what is going on from you.

We have found that students only really understand operating system concepts if they have the experience of writing code that illustrates the concepts and are directly using the low-level programming tools that real system developers use. This code is complicated, don’t even try to get by without understanding these materials.

The book Under the Covers: The Secret Life of Software is a companion book, and in a perfect world would be used for a system’s course that is a prerequisite for an operating systems course based on this book. Given that that is not always the case, we will cover some of the same material briefly and refer to the corresponding part of his material for more detail. This includes:

Our focus in this book is on operating systems; not on how to be a systems programer. To succeed in this course, we strongly advice covering the above material in more depth than we can as a small part of this course.

Book Overview#

For detailed instructions on how to read this book and launch the container associated with it, please refer here. The book is divided into multiple sections, each with small chapters that should hopefully be relatively fast reads. The first part, Getting Started, gives an overview of the entire book and the tools operating system developers like you will need to know. The next three parts describe three of the core services of operating systems, namely Scheduling, Memory Management, and file systems. The next part, concurrency, introduces some of the most complicated aspects of operating systems to deal with the parallelism of todays platforms, namely threads, synchronization, and deadlock. We have lumped a bunch of important topics that are typically only covered briefly in an introductory OS book, including security, virtualization, a bit on the history of operating systems and alternative OS structures. Finally the appendices have chapters on how to read and contribute to this book.

Warning

This book is a work in progress, most parts are today just scaffolding, and a community is working hard to try to get materials in place as we are actively reading it. We hope you will consider contributing to this effort by reporting issues you find.