Preface
Building a computer operating system is like weaving a fine tapestry. In each
case, the ultimate goal is a large, complex artifact with a unified and pleasing design,
and in each case, the artifact is constructed with small, intricate steps. As in a tapestry,
small details are essential because a minor mismatch is easily noticed — like stitches in
a tapestry, each small piece added to an operating system must fit the overall design.
Therefore, the mechanics of assembling pieces forms only a minor part of the overall
process; a masterful creation must start with a pattern, and all artisans who work on the
system must follow the pattern.
Ironically, few operating system textbooks or courses explain underlying patterns
and principles that form the basis for operating system construction. Students form the
impression that an operating system is a black box, and textbooks reinforce the
misimpression by explaining operating system features and focusing on how to use
operating system facilities. More important, because they only learn how an operating
system appears from the outside, students are left with the feeling that an operating sys-
tem consists of a set of interface functions that are connected by a morass of mysterious
code containing many machine-dependent tricks.
Surprisingly, students often graduate with the impression that research on operating
systems is over: existing operating systems, constructed by commercial companies and
the open source community, suffice for all needs. Nothing could be further from the
truth. Ironically, even though fewer companies are now producing conventional operat-
ing systems for personal computers, the demand for operating system expertise is rising
and companies are hiring students to work on operating systems. The demand arises
from inexpensive microprocessors embedded in devices such as smart phones, video
games, wireless sensors, cable and set-top boxes, and printers.
When working in the embedded world, knowledge of principles and structures is
essential because a programmer may be asked to build new mechanisms inside an
operating system or to modify an operating system for new hardware. Furthermore,
writing applications for embedded devices requires an appreciation for the underlying
operating system — it is impossible to exploit the power of small embedded processors
without understanding the subtleties of operating system design.
This book removes the mystery from operating system design, and consolidates the
body of material into a systematic discipline. It reviews the major system components,
and imposes a hierarchical design paradigm that organizes the components in an order-
ly, understandable manner. Unlike texts that survey the field by presenting as many al-
ternatives as possible, the reader is guided through the construction of a conventional
process-based operating system, using practical, straightforward primitives. The text
begins with a bare machine, and proceeds step-by-step through the design and imple-