Preface: OS OSX OS
Preface: OS OSX OS
Preface: OS OSX OS
vii
viii Preface
The organization of the text reflects our many years of teaching courses
on operating systems. Consideration was also given to the feedback provided
by the reviewers of the text, along with the many comments and suggestions
we received from readers of our previous editions and from our current and
former students. This Tenth Edition also reflects most of the curriculum guide-
lines in the operating-systems area in Computer Science Curricula 2013, the most
recent curriculum guidelines in undergraduate degree programs in computer
science published by the IEEE Computing Society and the Association for Com-
puting Machinery (ACM).
Book Material
The book has 21 chapters and 4 appendices. Each chapter and appendix con-
tains the text and all or some of the following enhancements:
Preface ix
The hard copy of the text available in the e-text and print companion bundle
has the same text chapters as the electronic version. It does not, however,
include the appendices, the regular exercises, the solutions to the practice
exercises, the programming problems, the programming projects, and some
of the other enhancements found in this ePub electronic book.
utilization of the CPU and the speed of its response to its users, the com-
puter must keep several processes in memory. There are many different
memory-management schemes, reflecting various approaches to memory
memory-management management, and the effectiveness of a particular
algorithm depends on the situation.
• Storage management. Chapters 11 and 12 describe how mass storage and
I/O are handled in a modern computer system. The I/O devices that attach
to a computer vary widely, and the operating system needs to provide
a wide range of functionality to applications to let them to control all
aspects of these devices. We discuss system I/O in depth, including I/O
system design, interfaces, and internal system structures and functions.
In many ways, I/O devices are the slowest major components of the com-
puter. Because they represent a performance bottleneck, we also examine
performance issues associated with I/O devices.
• File systems. Chapters 13 through 15 discuss how file systems are handled
in a modern computer system. File systems provide the mechanism for on-
line storage of and access to both data and programs. We describe the clas-
sic internal algorithms and structures of storage management and provide
a firm practical understanding of the algorithms used —their properties,
advantages, and disadvantages.
• Security and protection. Chapters 16 and 17 discuss the mechanisms nec-
essary for the security and protection of computer systems. The processes
in an operating system must be protected from one another’s activities.
To provide such protection, we must ensure that only processes that have
gained proper authorization from the operating system can operate on the
files, memory, CPU, and other system resources. Protection is a mechanism
for controlling the access of programs, processes, or users to computer-
system resources. This mechanism must provide a means of specifying
the controls to be imposed, as well as a means of enforcement. Security
protects the integrity of the information stored in the system (both data and
code), as well as the physical resources of the system, from unauthorized
access, malicious destruction or alteration, and accidental introduction of
inconsistency.
• Advanced topics. Chapters 18 and 19 discuss virtual machines and
networks/distributed systems. Chapter 18 provides an overview of
virtual machines and their relationship to contemporary operating
systems. Included is a general description of the hardware and software
techniques that make virtualization possible. Chapter 19 provides an
overview of computer networks and distributed systems, with a focus on
the Internet and TCP/IP.
• Case studies. Chapter 20 and 21 present detailed case studies of two real
operating systems—Linux and Windows 10.
• Appendices. Appendix A discusses several old but influential operating
systems that are no longer in use. Appendices B through D cover in great
detail three older operating systems—Windows 7, BSD, and Mach.
Preface xi
Programming Environments
The text provides several example programs written in C and Java. These
programs are intended to run in the following programming environments:
• POSIX. POSIX (which stands for Portable Operating System Interface) is a set
of standards implemented primarily for UNIX-based operating systems.
Although Windows systems can also run certain POSIX programs, our
coverage of POSIX focuses on Linux and UNIX systems. POSIX-compliant
systems must implement the POSIX core standard (POSIX.1); Linux and
macOS are examples of POSIX-compliant systems. POSIX also defines sev-
eral extensions to the standards, including real-time extensions (POSIX.1b)
and an extension for a threads library (POSIX.1c, better known as Pthreads).
We provide several programming examples written in C illustrating the
POSIX base API, as well as Pthreads and the extensions for real-time pro-
gramming. These example programs were tested on Linux 4.4 and macOS
10.11 systems using the gcc compiler.
• Java. Java is a widely used programming language with a rich API and
built-in language support for concurrent and parallel programming. Java
programs run on any operating system supporting a Java virtual machine
(or JVM). We illustrate various operating-system and networking concepts
with Java programs tested using Version 1.8 of the Java Development Kit
(JDK).
• Windows systems. The primary programming environment for Windows
systems is the Windows API, which provides a comprehensive set of func-
tions for managing processes, threads, memory, and peripheral devices.
We supply a modest number of C programs illustrating the use of this API.
Programs were tested on a system running Windows 10.
ing the gcc and Java compilers. Most of the programming assignments in the
book can be completed using this virtual machine; the exception is assignments
that require the Windows API. The virtual machine can be installed and run on
any host operating system that can run the VirtualBox virtualization software,
which currently includes Windows 10 Linux, and macOS.
Major Changes
The Tenth Edition update encompasses much more material than previous
updates, in terms of both content and new supporting material. Here, outline
the major content changes in each chapter:
as well. We have added new sections on linkers and loaders, and we now
discuss why applications are often operating-system specific. Finally, we
have added a discussion of the BCC debugging toolset.
• Chapter 3: Processes simplifies the discussion of scheduling so that it
now includes only CPU scheduling issues. New coverage describes the
memory layout of a C program, the Android process hierarchy, Mach
message passing, and Android RPCs. We have also replaced coverage of
the traditional UNIX/Linux init process with coverage of systemd.
• Chapter 4: Threads and Concurrency (previously Threads) increases the
coverage of support for concurrent and parallel programming at the API
and library level. We have revised the section on Java threads so that it
now includes Futures and have updated the coverage of Apple’s Grand
Central Dispatch so that it now includes Swift. New sections discuss fork-
join parallelism using the fork-join framework in Java, as well as Intel
thread building blocks.
• Chapter 5: CPU Scheduling (previously Chapter 6) revises the coverage of
multilevel queue and multicore processing scheduling. We have integrated
coverage of NUMA-aware scheduling issues throughout, including how
this scheduling affects load balancing. We also discuss related modifica-
tions to the Linux CFS scheduler. New coverage combines discussions of
round-robin and priority scheduling, heterogeneous multiprocessing, and
Windows 10 scheduling.
• Chapter 6: Synchronization Tools (previously part of Chapter 5, Process
Synchronization) focuses on various tools for synchronizing processes.
Significant new coverage discusses architectural issues such as instruction
reordering and delayed writes to buffers. The chapter also introduces lock-
free algorithms using compare-and-swap (CAS) instructions. No specific
APIs are presented; rather, the chapter provides an introduction to race
conditions and general tools that can be used to prevent data races. Details
include new coverage of memory models, memory barriers, and liveness
issues.
• Chapter 7: Synchronization Examples (previously part of Chapter 5,
Process Synchronization) introduces classical synchronization problems
and discusses specific API support for designing solutions that solve
these problems. The chapter includes new coverage of POSIX named and
unnamed semaphores, as well as condition variables. A new section on
Java synchronization is included as well.
• Chapter 8: Deadlocks (previously Chapter 7) contains minor updates,
including a new section on livelock and a discussion of deadlock as an
example of a liveness hazard. The chapter includes new coverage of the
Linux lockdep and the BCC deadlock detector tools, as well as coverage
of Java deadlock detection using thread dumps.
• Chapter 9: Main Memory (previously Chapter 8) includes several revi-
sions that bring the chapter up to date on memory management on modern
computer systems. We have added new coverage of the ARMv8 64-bit
architecture, updated the coverage of dynamic link libraries, and changed
xiv Preface
• Chapter 20: The Linux System (previously Chapter 18) has been updated
to cover the Linux 4.i kernel.
• Chapter 21: The Windows 10 System is a new chapter that covers the
internals of Windows 10.
• Appendix A: Influential Operating Systems has been updated to include
material from chapters that are no longer covered in the text.
Supporting Website
When you visit the website supporting this text at http://www.os-book.com/
OS10, you can download the following resources:
• Errata
• Bibliography
Notes to Instructors
On the website for this text, we provide several sample syllabi that suggest var-
ious approaches for using the text in both introductory and advanced courses.
xvi Preface
Notes to Students
We encourage you to take advantage of the practice exercises that appear at the
end of each chapter. We also encourage you to read through the study guide,
which was prepared by one of our students. Finally, for students who are unfa-
miliar with UNIX and Linux systems, we recommend that you download and
install the Linux virtual machine that we include on the supporting website.
Not only will this provide you with a new computing experience, but the open-
source nature of Linux will allow you easily to examine the inner details of this
popular operating system. We wish you the very best of luck in your study of
operating systems!
Contacting Us
We have endeavored to eliminate typos, bugs, and the like from the text. But,
as in new releases of software, bugs almost surely remain. An up-to-date errata
list is accessible from the book’s website. We would be grateful if you would
notify us of any errors or omissions in the book that are not on the current list
of errata.
We would be glad to receive suggestions on improvements to the book.
We also welcome any contributions to the book website that could be of use
to other readers, such as programming exercises, project suggestions, on-line
labs and tutorials, and teaching tips. E-mail should be addressed to os-book-
authors@cs.yale.edu.
Acknowledgments
Many people have helped us with this Tenth Edition, as well as with the
previous nine editions from which it is derived.
Preface xvii
Tenth Edition
• Rik Farrow provided expert advice as a technical editor.
• Jonathan Levin helped out with coverage of mobile systems, protection,
and security.
• Alex Ionescu updated the previous Windows 7 chapter to provide Chapter
21: Windows 10.
• Sarah Diesburg revised Chapter 19: Networks and Distributed Systems.
• Brendan Gregg provided guidance on the BCC toolset.
• Richard Stallman (RMS) supplied feedback on the description of free and
open-source software.
• Robert Love provided updates to Chapter 20: The Linux System.
• Michael Shapiro helped with storage and I/O technology details.
• Richard West provided insight on areas of virtualization research.
• Clay Breshears helped with coverage of Intel thread-building blocks.
• Gerry Howser gave feedback on motivating the study of operating systems
and also tried out new material in his class.
• Judi Paige helped with generating figures and presentation of slides.
• Jay Gagne and Audra Rissmeyer prepared new artwork for this edition.
• Owen Galvin provided technical editing for Chapters 11 and 12.
• Mark Wogahn has made sure that the software to produce this book (LATEX
and fonts) works properly.
• Ranjan Kumar Meher rewrote some of the LATEX software used in the pro-
duction of this new text.
Previous Editions
• First three editions. This book is derived from the previous editions, the
first three of which were coauthored by James Peterson.
• General contributions. Others who helped us with previous editions
include Hamid Arabnia, Rida Bazzi, Randy Bentson, David Black, Joseph
Boykin, Jeff Brumfield, Gael Buckley, Roy Campbell, P. C. Capon, John
Carpenter, Gil Carrick, Thomas Casavant, Bart Childs, Ajoy Kumar Datta,
Joe Deck, Sudarshan K. Dhall, Thomas Doeppner, Caleb Drake, M. Rasit
Eskicioğlu, Hans Flack, Robert Fowler, G. Scott Graham, Richard Guy,
Max Hailperin, Rebecca Hartman, Wayne Hathaway, Christopher Haynes,
Don Heller, Bruce Hillyer, Mark Holliday, Dean Hougen, Michael Huang,
Ahmed Kamel, Morty Kewstel, Richard Kieburtz, Carol Kroll, Morty
Kwestel, Thomas LeBlanc, John Leggett, Jerrold Leichter, Ted Leung, Gary
Lippman, Carolyn Miller, Michael Molloy, Euripides Montagne, Yoichi
Muraoka, Jim M. Ng, Banu Özden, Ed Posnak, Boris Putanec, Charles
xviii Preface
Book Production
The Executive Editor was Don Fowley. The Senior Production Editor was Ken
Santor. The Freelance Developmental Editor was Chris Nelson. The Assistant
Developmental Editor was Ryann Dannelly. The cover designer was Tom Nery.
The copyeditor was Beverly Peavler. The freelance proofreader was Katrina
Avery. The freelance indexer was WordCo, Inc. The Aptara LaTex team con-
sisted of Neeraj Saxena and Lav Kush.
Personal Notes
Avi would like to acknowledge Valerie for her love, patience, and support
during the revision of this book.
Preface xix
Peter would like to thank his wife Carla and his children, Gwen, Owen,
and Maddie.
Greg would like to acknowledge the continued support of his family: his
wife Pat and sons Thomas and Jay.