没有合适的资源?快使用搜索试试~ 我知道了~
首页Operating Systems Three Easy Pieces(OSTEP)(已带书签).pdf
Operating Systems Three Easy Pieces(OSTEP)(已带书签).pdf
需积分: 30 576 浏览量
更新于2023-06-03
评论 2
收藏 8.21MB PDF 举报
亲测好用 威斯康辛大学研究生操作系统课本,但其实适合具有一般英语水平的本科生阅读,因为全书对词汇量要求不多,且生动有趣。 本书已带完美版书签
资源详情
资源评论
资源推荐

Preface
To Everyone
Welcome to this book! We hope you’ll en j oy readin g it as much asweenjoyed
writing it. The book is called Operating Systems: Three Easy Pieces,andthetitle
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 undoubt-
edly 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 operatingsystems(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.Indiscussing
these concepts, we’ll end up discussing most of the importantthingsanoperating
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 into a set of chapters, most of which present a
particular problem and then show how to solve it. The chaptersareshort,andtry
(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, what was, and
what will be more clearly. In this case, seeing how the sausagewasmadeisnearly
as important as understanding what the sausage is good for
1
.
There are a couple devices we use throughout the book which areprobably
worth introducing here. The first is the 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.
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; t ips tend to be general lessons that can be
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 did act ic met h ods, the dialogue,throughoutthebook,
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 will see), as well as
to review material every now and then. They are also a chance towriteinamore
1
Hint: eating! Or if you’re a vegetarian, running away from.
iii

iv
humorous style. Whether you find them useful, or humorous, well, that’s another
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
operating systems, so we encourage you to do so when you can.
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 download the home-
works, and run them to quiz yourself. The homework simulatorshavethefollow-
ing feature: by giving them a different random 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 powerful language that
underlies most operating systems, and thus worth adding to your tool-chest of
languages. Two types of projects are available (see the online appendix for ideas).
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, allxv6programming,or
amixofboth.
OPERATING
SYSTEMS
[VERSION 0.80] WWW.OSTE P.ORG

v
To Educators
If you are an instructor or professor who wishes to use this book, please feel
free to do so. As you may have noticed, they are free and available on-line from
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, Inc.
May, 2014 (Version 0.8)
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.Crammingthe
course into a 10-week quarter probably requires dropping some detail from each
of the pieces. There are also a few chapters on virtual machinemonitors,whichwe
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, atopicatthefront
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 15 years, students have a hard time understanding h ow 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 thatariseduetothem
becomes rather easy, or at least, easier.
You may h ave noticed there are no slides t h at go hand-in-hand with the book.
The major reason for this omission is that we believe in the most old-fashioned
of teaching methods: chalk and a blackboard. Thus, when we teach the course,
we come to class with a few major ideas and examples in mind and use the board
to present them; handouts and live code demos sprinkled are also useful. In our
experience, using too many slides encourages students to “check out” of lecture
(and log into facebook.com), as they know the material is there for them to digest
later; using the blackboard makes lecture a “live” viewing experience and thus
(hopefully) more interactive, dynamic, and enjoyable for the students in your class.
If you’d like a copy of the notes we use in preparation for class, please drop us
an email. We have already shared them with many others around the world.
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 (over1millionchapters
downloaded in the past few years!) and also ensures students get the latest and
greatest version.
c
2014, ARPA CI-DUSSEAU
THREE
EASY
PIE CES

vi
To Studen t s
If you are a student reading this book, thank you! It is an honorforusto
provide some material to help you in your pursuit of knowledgeaboutoperating
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 hav e noticed this book is free and available on line. There is one major
reason for this: textbooks are generally too expensive. Thisbook,wehope,is
the first of a new wave of free materials to help those in pursuitoftheireducation,
regardless of which part of the world they come from or how muchtheyarewilling
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 t o 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 pulledoutoftheair;they
come from smart and hard-working people (including numerousTuring-award
winners
2
), and thus we should strive to celebrate those ideas and people where
possible. In doing so, we hopefully can better un derstand therevolutionsthat
have taken place, instead of writing texts as if those thoughts have always been
present [K62]. Further, perhaps such references will encourage you to dig deeper
on your own; reading the famous papers of our field is certainlyoneofthebest
ways to learn.
2
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 0.80] WWW.OSTE P.ORG

vii
Acknowledgments
This section will contain thanks to those who h elped us put thebooktogether.
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 befamous!Or,
at least, have your name in some book.
The people who have helped so far include: Abh irami Senthilkumaran*, Adam
Drescher, Adam Eggum, Ahmed Fikri*, Ajaykrishna Raghavan, Alex Wyler, Anand
Mundada, B. B rahmananda Reddy (Minnesota), Bala Subrahmanyam Kambala,
Benita Bose, Biswajit Mazumder (Clemson), Bobby Jack, Bj ¨orn Lindberg, Bren-
nan Payne, Brian Kroth, Cara Lauritzen, Charlotte Kissinger, Chien-Chung Shen
(Delaware)*, Cody Hanson, Dan Soendergaard (U. Aarhus), David Hanle (Grin-
nell), Deepika Muthukumar, Dorian Arnold (New Mexico), Dustin Metzler, Dustin
Passofaro, Emily Jacobson, Emmett Witchel (Texas), Ernst Biersack (France), Finn
Kuusisto*, Guilherme Baptista, Hamid Reza Ghasemi, Henry Abbey, Hrishikesh
Amur, Huanchen Zhang*, Jake Gillberg, James Perry (U. Michigan-Dearborn)*, Jay
Lim, Jerod Weinman (Grinnell), Joel Sommers (Colgate), Jonathan Perry (MIT), Jun
He, Karl Wallinger, Kaushik Kannan, Kevin Liu*, Lei Tian (U. Nebraska-Lincoln),
Leslie Schultz, Lihao Wang, Martha Ferris, Masashi Kishikawa (Sony), Matt Rei-
choff, Matty Williams, Meng Huang, Mike Griepentrog, Ming Chen (Stonybrook),
Mohammed Alali (Delaware), Murugan Kandaswamy, Natasha Eilbert, Nathan
Dipiazza, Nathan Sullivan, Neeraj Badlani (N.C. State), Nelson Gomez, Nghia
Huynh (Texas), Patricio Jara, Radford Smith, Ripudaman Singh, Ross Aiken, Rus-
lan Kiselev, Ryland Herrick, Samer Al-Kiswany, Sandeep Ummadi (Minnesota),
Satish Chebrolu (NetApp), Satyanarayana Shanmugam*, Seth Pollen, Sharad Punuganti,
Shreevatsa R., Sivaraman Sivaraman*, Srinivasan Thirunarayanan*, Suriyhaprakhas
Balaram Sankari, Sy Jin Cheah, Thomas Griebel, Tongxin Zheng, Tony Ad kins,
Torin Rudeen (Princeton), Tuo Wang, Varun Vats, Xiang Peng, Xu Di, Yue Zhuo
(Texas A&M), Yufui Ren, Zef RosnBrick, Zuyu Zhang. Special thanks to those
marked with an asterisk above, who have gone above and beyond in their sugges-
tions for improvement.
Special thanks to Professor Joe Meehean (Lynchburg) for his detailed notes on
each chapter, to Professor Jerod Weinman (Grinnell) and his ent ire class for t heir
incredible booklets, and to Professor Chien-Chung Shen (Delaware) for his invalu-
able and detailed reading and comments about the book. All three have helped
these authors immeasurably in the refinement of the materialsherein.
Also, many thanks to the hundreds of students who have taken 537 over the
years. In particular, the Fall ’08 class who encouraged the first written form of
these notes (they were sick of not having any kind of textbook to read – pushy
students!), and then praised them enough for us to keep going (including one hi-
larious “ZOMG! You should totally write a textbook!” commentinourcourse
evaluations that year).
Agreatdebtofthanksisalsoowedtothebravefewwhotookthexv6 project
lab course, much of which is now incorporated into the main 537course. From
Spring ’09: Justin Cherniak, Patrick Deline, Matt Czech, Tony Gregerson, Michael
Griepentrog, Tyler Harter, Ryan Kroiss, Eric Radzikowski, Wesley Reard an, Rajiv
Vaidyanathan, and Christopher Waclawik. From Fall ’09: NickBearson,Aaron
Brown, Alex Bird, David Capel, Keith Gould, Tom Grim, JeffreyHugo,Brandon
Johnson, John Kjell, Boyan Li, James Loethen, Will McCardell, Ryan Szaroletta, Si-
c
2014, ARPA CI-DUSSEAU
THREE
EASY
PIE CES
剩余623页未读,继续阅读















安全验证
文档复制为VIP权益,开通VIP直接复制

评论0