
Preface
This
book
(known as CS:APP)
is
for computer scientists, computer engineers, and
others who want to be able to write
better
programs by learning what is going
on
"under the hood'" of.a computer systefn.
Our
aim'is to explain
the
enduring concepts underlying all computer systenls,
and to show you the cohcrete ways that
these
ideas affect
the
correctn'ess;perfSr-
mance,'lmd
utility
of
your
application programs.'Mlmy systems
bob
ks are
1
\vritten
from a
builder's perspective, describing how to implement the hardware
or
th'e sys-
tems software,
inC!uding the operating system, compiler, and network·iiltefface.
Thisbook
is
wrihen from"a progr'dmme""' pefspective,'describing how application
programmers can use
their knowledge
of
a system to write
better
programs.
'Of
course, learning what a system
i§
supposed to do provide&.a good first step
in
learn-
ing how to
build one,'so this book also serves as
a·
valuable introduction to those
who go on to iinplemeht systems hardware and soffware. Most systems books also
tend to focus on just one aspect
of
the system, for example, the•hardware archi-
tecture: the operating system, the compiler,
or
the "network. Tiiis book" spans all
of·these aspects,' with !lie unifying theme
of
a progranfmer's perspective.
If
you·study
ancl-learh>.the-concepts-in-this-!:mok~you-.wiU1:le"on·yoni-wzj>'tcr--
-
becoming the
'rare
power
progranimer'who knows how things
work'and
how
io
fix
them when tbey'bteak. You will· be able to write programs that·make•better
use of the'caP,abiij(ies provided by theloperating systeni'and systellis software,
that operate 'correctly across'1i
wicte'
range
of
operating conditibhs and
run'.-t:llne
parameters,' that
run
faster, and
that
avoid the flaws
that
make·ptogramS vu!Iler-
able
t'6
cybefatt'ack-. You will
be
prepared to delve
deeper
into 'advanced topics
sucn
as
conipilers;'c6mputer architecture, 'operating
sy~tems,
embedded systems,
networking, and cybersecurity.
Assumptions'
abou't
the
Reader's
Backgrourid "
This book focuses on systems that execute x86-64 machine code. x86-64
is
the latest
in an evolutionary
path
followed by Intel and its competitors .that started with the
8086
microprocessor in 1978.
Due
to the naming conventions used by Intel for
its microprocessor line, this class
of
microprocessors
is
referr~d
tq coll9ql'ially as
"x86."
As
semiconductor technology has evolved to allow more transistors to
be
integrated onto a single. chip, these processors have progressed greatly in their
computing.ppwer. and theii:.mel)lory capacity. 'As.part
of,
this ptogression, (hey
have gone from pp,erating on· 16-bit
'XQW,
to.32-bit.words with the; introduction
of IA32 processors, and most recently to 64-bit words with x86-64.
We
consider how these machines execute C programs on Linux. Linux is.one
~
of a
number·of
operating systems·having their heritage in the Unix operating
system developed originally by Bell Laboratories.
Other
members-of this class
xix