没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Preface
To Everyone
Welcome to this book! We hope you’ll enjoy reading it as much as we enjoyed
writing it. The book is called Operating Systems: Three Easy Pieces (available
at http://www.ostep.org), and the title is obviously an homage to one of the
greatest sets of lecture notes ever created, by one Richard Feynman on the topic of
Physics [F96]. While this book will undoubtedly fall short of the high standard set
by that famous physicist, perhaps it will be good enough for you in your quest to
understand what operating systems (and more generally, systems) are all about.
The three easy pieces refer to the three major thematic elements the book is
organized around: virtualization, concurrency,andpersistence. In discussing
these concepts, we’ll end up discussing most of the important things an operating
system does; hopefully, you’ll also have some fun along the way. Learning new
things is fun, right? At least, it should be.
Each major concept is divided i nto a set of chapters, most of which present a
particular problem and then show how to solve it. The chapters are short, and try
(as best as possible) to reference the source material where the ideas really came
from. One of our goals in writing this book is to make the paths of history as clear
as possible, as we think that helps a student understand what is,whatwas,and
what will be more clearly. In this case, seeing how the sausage was made is nearly
as important as understanding what the sausage is good for
1
.
There are a couple devices we use throughout the book which are probably
worth introducing here. The first is t he crux of the problem. Anytime we are
trying to solve a problem, we first try to state what the most important issue is;
such a crux of the problem is explicitly called out in the text, and hopefully solved
via the techniques, algorithms, and ideas presented in the rest of the text.
In many places, we’ll explain how a system works by showing its behavior
over time. These timelines are at the essence of understanding; if you know what
happens, for example, when a process page faults, you are on your way to truly
understanding how virtual memory operates. If you comprehend whattakesplace
when a journaling file system writes a block to disk, you have taken the first steps
towards mastery of storage systems.
There are also numerous asides and tips throughout the text, adding a little
color to the mainline presentation. Asides tend to discuss something relevant (but
perhaps not essential) to the main text; tips tend to be general lessons that can be
1
Hint: eating! Or if you’re a vegetarian, running away from.
iii
iv
applied to systems you build. An index at the end of the book lists all of these tips
and asides (as well as cruces, the odd plural of crux) for your convenience.
We use one of the oldest didactic methods, the dialogue, throughout the book,
as a way of presenting some of the material in a different light. These are used to
introduce the major thematic concepts (in a peachy way, as we willsee),aswellas
to review material every now and then. They are also a chance to write in a more
humorous style. Whether you find them useful, or humorous, well, that’sanother
matter entirely.
At the beginning of each major section, we’ll first present an abstraction that an
operating system provides, and then work in subsequent chapters on the mecha-
nisms, policies, and other support needed to provide the abstraction. Abstractions
are fundamental to all aspects of Computer Science, so it is perhaps no surprise
that they are also essential in operating systems.
Throughout the chapters, we try to use real code (not pseudocode)wherepos-
sible, so for virtually all examples, you should be able to type them up yourself and
run them. Running real code on real systems is the best way to learn about operat-
ing systems, so we encourage you to do so when you can. We are also making code
available at https://github.com/remzi-arpacidusseau/ostep-code for
your viewing pleasure.
In various parts of the text, we have sprinkled in a few homeworks to ensure
that you are understanding what is going on. Many of these homeworks are little
simulations of pieces of the operating system; you should downlo ad the home-
works, and run them to quiz yourself. The homework simulators have the follow-
ing feature: by giving them a different ra ndom seed, you can generate a virtually
infinite set of problems; the simulators can also be told to solve the problems for
you. Thus, you can test and re-test yourself until you have achieved a good level
of understanding.
The most important addendum to this book is a set of projects in which you
learn about how real systems work by designing, implementing, and testing your
own code. All projects (as well as the code examples, mentioned above) are in
the Cprogramminglanguage[KR88]; C is a simple and po werful language that
underlies most operating systems, and thus worth adding to your tool-chest of
languages. Two types of projects are available (see the onlineappendixforideas).
The first are systems programming projects; these projects are great for those who
are new to C and UNIX and want to learn how to do low-level C programming.
The second type are based on a real operating system kernel developed at MIT
called xv6 [CK+08]; these projects are great for students that already have some C
and want to get their hands dirty inside the OS. At Wisconsin, we’ve run the course
in three different ways: either all systems programming, all xv6 programming, or
a mix of both.
We are slowly making project descriptions, and a t esting framework, avail-
able. See https://github.com/remzi-arpacidusseau/ostep-projects
for more information. If not part of a class, this will give you a chance to do these
projects on your own, to better learn the material. Unfortunately, yo u d on’t ha ve
a TA to bug when you get stuck, but not everything in life can be free (but books
can be!).
OPERATING
SYSTEMS
[VERSION 1.00] WWW.OSTEP.ORG
v
To Educators
If you are an instructor or professor who wishes to use this book,pleasefeel
free to do so. As you may have noticed, they are free and availableon-linefrom
the following web page:
http://www.ostep.org
You can also purchase a printed copy from lulu.com.Lookforitontheweb
page above.
The (current) proper citation for the book is as follows:
Operating Systems: Three Easy Pieces
Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau
Arpaci-Dusseau Books
August, 2018 (Version 1.00)
http://www.ostep.org
The course divides fairly well across a 15-week semester, in which you can
cover most of the topics within at a reasonable level of depth. Cramming the
course into a 10-week quarter probably requires dropping some detail from each
of the pieces. There are also a few chapters on virtual machine monitors, which w e
usually squeeze in sometime during the semester, either right at end of the large
section on virtualization, or near the end as an aside.
One slightly unusual aspect of the book is that concurrency, a topic at the front
of many OS books, is pushed off herein until the student has built an understand-
ing of virtualization of the CPU and of memory. In our experience in teaching
this course for nearly 20 years, students have a hard time understanding how the
concurrency problem arises, or why they are trying to solve it, if they don’t yet un-
derstand what an address space is, what a process is, or why context switches can
occur at arbitrary points in time. Once they do understand these concepts, how-
ever, introducing the notion of threads and the problems that arise due to them
becomes rather easy, or at least, easier.
As much as is possible, we use a chalkboard (or whiteboard) to deliver a lec-
ture. On these mo re conceptual days, we come to class with a few majorideas
and examples in mind and use the board to present them. Handouts are useful
to give the students concrete problems to solve based on the material. On more
practical days, we simply plug a laptop into the projector and show real code; this
style works particularly well for concurrency lectures as well as for any discus-
sion sections where you show students code that is relevant fortheirprojects.We
don’t generally use slides to present material, but have now made asetavailable
for those who prefer that style of presentation.
If you’d like a copy of any of these materials, please drop us an email. We
have already shared them with many others around the world, and others have
contributed their materials as well.
One last request: if you use the free online chapters, please just link to them,
instead of making a local copy. This helps us track usage (over 1 million chapters
downloaded in the past few years!) and also ensures students getthelatest(and
greatest?) version.
c
2008–18, ARPACI-DUSSEAU
THREE
EASY
PIECES
vi
To Students
If you are a student reading this book, thank yo u! It is an honor for us to
provide some material to help you in your pursuit of knowledge about operating
systems. We both think back fondly towards some textbooks of our undergraduate
days (e.g., Hennessy and Patterson [HP90], the classic book on computer architec-
ture) and hope this book will become one of those positive memories for you.
You may have noticed this book is free and available online
2
. There is one major
reason for this: textbooks are generally too expensive. This book, we hope, is the
first of a new wave of free materials to help those in pursuit of their education,
regardless of which part of the world they come from or how much they are willing
to spend for a book. Failing that, it is one free book, which is better than none.
We also hope, where possible, to point you to the original sources of much
of the material in the book: the great papers and persons who have shaped the
field of operating systems over the years. Ideas are not pulled out of the air; they
come from smart and hard-working people (including numerous Turing-award
winners
3
), and thus we should strive to celebrate those ideas and people where
possible. In doing so, we hopefully can better understand the revolutions that
have taken place, instead of writing texts as if those thoughts have alwa ys been
present [K62]. Further, perhaps such references will encourageyoutodigdeeper
on your own; reading the famous papers of our field is certainly one of the best
ways to learn.
2
A digression here: “free” in the way we use it here does not mean open source, and it
does not mean the book is not copyrighted with the usual protections – it is! What it means is
that you can download the chapters and use them to learn about operating systems. Why not
an open-source book, just like Linux is an open-source kernel? Well, we believe it is important
for a book to have a single voice throughout, and have worked hard to provide such a voice.
When you’re reading it, the book should kind of feel like a dialogue with the person explaining
something to you. Hence, our approach.
3
The Turing Award is the highest award in Computer Science; it is like the Nobel Prize,
except that you have never heard of it.
OPERATING
SYSTEMS
[VERSION 1.00] WWW.OSTEP.ORG
vii
Acknowledgments
This section will contain thanks to those who helped us put the book together.
The important thing for now: your name could go here! But, you have to help. So
send us some feedback and help debug this book. And you could be famous!Or,
at least, have your name in some book.
The people who have helped so far include: Aaron Gember (Colgate), Aashrith
H Govindraj (USF), Abhinav Mehra, Abhirami Senthilkumaran*, Adam Drescher* (WUSTL),
Adam Eggum, Aditya Venkataraman, Adriana Iamnitchi and class (USF), Ahmad Jarara, Ahmed
Fikri*, Ajaykrishna Raghavan, Akiel Khan, Alex Curtis, Alex Wyler, Alex Zhao (U. Colorado at
Colorado Springs), Ali Razeen (Duke), Alistair Martin, AmirBehzad Eslami, Anand Mundada,
Andrew Mahler, Andrew Valencik (Saint Mary’s), Angela Demke Brown (Toronto), Antonella
Bernobich (UoPeople)*, Arek Bulski, B. Brahmananda Reddy (Minnesota), Bala Subrahmanyam
Kambala, Bart Miller, Ben Kushigian (U. Mass), Benita Bose, Biswajit Mazumder (Clemson),
Bobby Jack, Bj
¨
orn Lindberg, Brandon Harshe (U. Minn), Brennan Payne, Brian Gorman, Brian
Kroth, Caleb Sumner (Southern Adventist), Cara Lauritzen, Charlotte Kissinger, Cheng Su,
Chien-Chung Shen (Delaware)*, Christian Stober, Christoph Jaeger, C.J. Stanbridge (Memorial
U. of Newfoundland), Cody Hanson, Constantinos Georgiades, Dakota Crane (U. Washington-
Tacoma), Dan Soendergaard (U. Aarhus), Dan Tsafrir (Technion), Danilo Bruschi (Universita
Degli Studi Di Milano), Darby Asher Noam Haller, David Hanle (Grinnell), David Hartman,
Deepika Muthukumar, Demir Delic, Dennis Zhou, Dheeraj Shetty (North Carolina State), Do-
rian Arnold (New Mexico), Dustin Metzler, Dustin Passofaro, Eduardo Stelmaszczyk, Emad
Sadeghi, Emil Hessman, Emily Jacobson, Emmett Witchel (Texas), Eric Freudenthal (UTEP),
Eric Johansson, Erik Turk, Ernst Biersack (France), Fangjun Kuang (U. Stuttgart), Feng Zhang
(IBM), Finn Kuusisto*, Giovanni Lagorio (DIBRIS), Glenn Bruns (CSU Monterey Bay), Glen
Granzow (College of Idaho), Guilherme Baptista, Hamid Reza Ghasemi, Hao Chen, Henry
Abbey, Hilmar G
´
ustafsson (Aalborg University), Hrishikesh Amur, Huanchen Zhang*, Huseyin
Sular, H ugo Diaz, Ilya Oblomkov, Itai Hass (Toronto), Jackson “Jake” Haenchen (Texas), Ja-
gannathan Eachambadi, Jake Gillberg, Jakob Olandt, James Earley, James Perry (U. Michigan-
Dearborn)*, Jan Reineke (Universit
¨
at des Saarlandes), Jason MacLafferty (Southern Adven-
tist), Jason Waterman (Vassar), Jay Lim, Jerod Weinman (Grinnell), Jhih-Cheng Luo, Jiao Dong
(Rutgers), Jia-Shen Boon, Jiawen Bao, Jingxin Li, Joe Jean (NYU), Joel Kuntz (Saint Mary’s),
Joel Sommers (Colgate), John Brady (Grinnell), John Komenda, Jonathan Perry (MIT), Joshua
Carpenter (NCSU), Jun He, Karl Wallinger, Kartik Singhal, Katherine Dudenas, Katie Coyle
(Georgia Tech), Kaushik Kannan, Kemal Bıc¸akcı, Kevin Liu*, Lanyue Lu, Laura Xu, Lei Tian
(U. Nebraska-Lincoln), Leonardo Medici (U. Milan), Leslie Schultz, Liang Yin, Lihao Wang,
Looserof, Manav Batra (IIIT-Delhi), Manu Awasthi (Samsung), Marcel van der Holst, Marco
Guazzone (U. Piemonte Orientale), Mart Oskamp, Martha Ferris, Masashi Kishikawa (Sony),
Matt Reichoff, Mattia Monga (U. Milan), Matty Williams, Meng Huang, Michael Machtel
(Hochschule Konstanz), Michael Walfish (NYU), Michael Wu (UCLA), Mike Griepentrog, Ming
Chen (Stonybrook), Mohammed Alali (Delaware), Mohamed Omran (GUST), Murugan Kan-
daswamy, Nadeem Shaikh, Natasha Eilbert, Natasha Stopa, Nathan Dipiazza, Nathan Sulli-
van, Neeraj Badlani (N.C. State), Neil Perry, Nelson Gomez, Nghia Huynh (Texas), Nicholas
Mandal, Nick Weinandt, Patel Pratyush Ashesh (BITS-Pilani), Patricio Jara, Pavle Kostovic,
Perry Kivolowitz, Peter Peterson (Minnesota), Pieter Kockx, Radford Smith, Riccardo Mut-
schlechner, Ripudaman Singh, Robert Ord
´
o
˜
nez and class (S outhern Adventist), Roger Watten-
hofer (ETH), Rohan Das (Toronto)*, Rohan Pasalkar (Minnesota), Rohan Puri, Ross Aiken, Rus-
lan Kiselev, Ryland Herrick, Sam Kelly, Sam Noh (UNIST), Samer Al-Kiswany, Sandeep Um-
madi (Minnesota), Sankaralingam Panneerselvam, Satish Chebrolu (NetApp), Satyanarayana
c
2008–18, ARPACI-DUSSEAU
THREE
EASY
PIECES
剩余736页未读,继续阅读
资源评论
cl2048
- 粉丝: 0
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功