CSAPP English Learning Series: Chapter 1: a tour of computer systems


Reading CSAPP is based onPDF, read and record new English words.

We begin our study of systems by tracing the lifetime of the hello program,
from the time it is created by a programmer, until it runs on a system, prints its
simple message, and terminates. As we follow the lifetime of the program, we will
briefly introduce the key concepts, terminology, and components that come into

Beauty[ ˈ t ɜː rm ɪ ne ɪ t]
Vt. & VI. end; Bring to an end

Beauty[ ˈ bri ː fli]
Adv. briefly; Simply; Briefly; Slightly

Beauty[ ˈ k ɑː nsept]
n. Concept; concept

Beauty[ ˌ t ɜː rm ɪˈ n ɑː l ə d ʒ i]
n. Special terms; Terminology, terminology; Diction

Beauty [k] ə m ˈ po ʊ n ə nt]
n. Component
1.1 Information Is Bits + Context

The representation of hello.c illustrates a fundamental idea: All information in 
a system—including disk fifiles, programs stored in memory, user data stored in
memory, and data transferred across a network—is represented as a bunch of bits.
The only thing that distinguishes different data objects is the context in which
we view them. For example, in different contexts, the same sequence of bytes
might represent an integer, flfloating-point number, character string, or machine

Beauty[ ˌ r ɛ pr ɪ z ɛ n ˈ te ʃə n]
n. Performance; state; Something that represents

Beauty[ ˈɪ l ə stre ɪ t]
v. (illustrate with examples / pictures, etc.)

Beauty[ ˌ f ʌ nd əˈ mentl]
Adj. Basic; Ingrained

Beauty [b] ʌ nt ʃ]
n. A gang; a tuft of; a string

Beauty [D] ɪˈ st ɪŋɡ w ɪʃ]
v. To distinguish from; differentiate; Discern

Beauty[ ˈ si ː kw ə ns]
n. [number] sequence

Beauty[ ɪ n ˈ str ʌ k ʃ n]
n. Instructions; Computer instructions
1.2 Programs Are Translated by Other Programs into Different Forms

Here, the gcc compiler driver reads the source file hello.c and translates it into
an executable object file hello. The translation is performed in the sequence
of four phases shown in Figure 1.3. The programs that perform the four phases
(preprocessor, compiler, assembler, and linker) are known collectively as the
compilation system.

Beauty [P ə r ˈ f ɔː rm]
v. Execution; Play a role in

Beauty[ ˈ si ː kw ə ns]
n. [number] sequence

Beauty [Fe] ɪ z]
n. Stage; period

Beauty[ ˈ f ɪɡ j ə r]
n. Figure, table

Us [pri'pro] ʊ ses ə (r)]
n. Preprocessor

Beauty[ əˈ s ɛ mbl ɚ]
n. Assembler; assembler

Beauty [k] əˈ l ɛ kt ɪ vl ɪ]
Adv. collectively

Beauty[ ˌ k ɑ mp ɪˈ le ɪʃ n]
n. Compilation
1.3 It Pays to Understand How Compilation Systems Work

Optimizing program performance. Modern compilers are sophisticated tools
that usually produce good code. As programmers, we do not need to know
the inner workings of the compiler in order to write efficient code. However,
in order to make good coding decisions in our C programs, we do need a
basic understanding of machine-level code and how the compiler translates
different C statements into machine code. For example, is a switch statement
always more efficient than a sequence of if-else statements? How much
overhead is incurred by a function call? Is a while loop more efficient than
a for loop? Are pointer references more efficient than array indexes? Why
does our loop run so much faster if we sum into a local variable instead of an
argument that is passed by reference? How can a function run faster when we
simply rearrange the parentheses in an arithmetic expression?

Beauty[ ˈɑ pt ɪ ma ɪ z]
Vt. optimize and make as effective as possible

Beauty [S] ə' f ɪ st ɪ ke ɪ t]
Adj. Sophisticated

Beauty[ ɪˈ f ɪʃ nt]
Adj. High efficiency; competent

Beauty[ ˈ o ʊ v ə rhed]
n. Recurring expenses

Beauty[ ɪ n ˈ k ɜː r]
Vt. incur

Beauty[ ˌ ri əˈ rend ʒ]
Vt. rearrangement; Rearrange

Beauty [P əˈ r ɛ n θɪ s ɪ s]
n. Parenthesis; Insertion component

Beauty[ əˈ r ɪθ m ə t ɪ k]
n. Arithmetic; data statistics
1.4 Processors Read and Interpret Instructions Stored in Memory

The shell is a command-line interpreter that prints a prompt, waits for you
to type a command line, and then performs the command. If the first word of the
command line does not correspond to a built-in shell command, then the shell
assumes that it is the name of an executable file that it should load and run. So
in this case, the shell loads and runs the hello program and then waits for it to
terminate. The hello program prints its message to the screen and then terminates.
The shell then prints a prompt and waits for the next input command line.

Beauty[ ɪ n ˈ t ɜː rpr ə t ə r]
n. Interpreter

Beauty [PR] ɑː mpt]
n. Incentive; Prompt; Pronunciations; Tips

Beauty[ ˌ k ɔː r əˈ sp ɑː nd]
v. Compliance; amount to; signal communication

Beauty[ əˈ su ː m]
v. Suppose that
1.4.1 Hardware Organization of a System

From the time that power is applied to the system until the time that the
power is shut off, a processor repeatedly executes the instruction pointed at by the
program counter and updates the program counter to point to the next instruction.
A processor appears to operate according to a very simple instruction execution
model, defined by its instruction set architecture. In this model, instructions execute
in strict sequence, and executing a single instruction involves performing a series
of steps. The processor reads the instruction from memory pointed at by the
program counter (PC), interprets the bits in the instruction, performs some simple
operation dictated by the instruction, and then updates the PC to point to the next
instruction, which may or may not be contiguous in memory to the instruction that
was just executed.

Beauty[ ɪ n ˈ str ʌ k ʃ n]
n. Computer instructions

Beauty[ əˈ k ɔː rd]
v. Give (a treatment); Conform to

Beauty [STR] ɪ kt]
Adj. Strict; Tight

Beauty[ ɪ n ˈ t ɜː rpr ə t]
v. Interpretation; Understand... As

Beauty[ ˈ d ɪ kte ɪ t]
Vt. oral; Command, instruction

Beauty [k] ə n ˈ t ɪɡ ju ə s]
Adj. Contact, proximity, common
1.4.2 Running the hello Program

Given this simple view of a system’s hardware organization and operation, we can
begin to understand what happens when we run our example program. We must
omit a lot of details here that will be fifilled in later, but for now we will be content
with the big picture.Initially, the shell program is executing its instructions, waiting for 
us to type a command. As we type the characters ./hello at the keyboard, the shell program
reads each one into a register and then stores it in memory, as shown in Figure 1.5.

Beauty [o ʊˈ m ɪ t]
Vt. omitted; Omission

Beauty[ ɪˈ n ɪʃə li]
Adv. start; first
1.5 Caches Matter

To deal with the processor–memory gap, system designers include smaller,
faster storage devices called cache memories (or simply caches) that serve as
temporary staging areas for information that the processor is likely to need in
the near future. Figure 1.8 shows the cache memories in a typical system. An L1
cache on the processor chip holds tens of thousands of bytes and can be accessed
nearly as fast as the register file. A larger L2 cache with hundreds of thousands
to millions of bytes is connected to the processor by a special bus. It might take 5
times longer for the processor to access the L2 cache than the L1 cache, but this is
still 5 to 10 times faster than accessing the main memory. The L1 and L2 caches are
implemented with a hardware technology known as static random access memory
(SRAM). Newer and more powerful systems even have three levels of cache: L1,
L2, and L3. The idea behind caching is that a system can get the effect of both
a very large memory and a very fast one by exploiting locality, the tendency for
programs to access data and code in localized regions. By setting up caches to hold
data that are likely to be accessed often, we can perform most memory operations
using the fast caches.

Beauty[ ɡ æp]
n. Interval; disparity

Beauty[ ˈ temp ə reri]
Adj. Transient

Beauty [ste] ɪ d ʒ]
v. Staged; Hold Organization; Make happen

Beauty[ ˈ t ɪ p ɪ kl]
Adj. Typical;

Beauty [t] ʃɪ p]
n. French fries, French fries

Beauty[ ɪ ksp'l ɔɪ t ɪŋ]
v. Exploitation (present participle of exploit)

Beauty[ ˈ tend ə nsi]
n. Tendency; trend
1.6 Storage Devices Form a Hierarchy

This notion of inserting a smaller, faster storage device (e.g., cache memory)
between the processor and a larger, slower device (e.g., main memory) turns out
to be a general idea. In fact, the storage devices in every computer system are
organized as a memory hierarchy similar to Figure 1.9. As we move from the top
of the hierarchy to the bottom, the devices become slower, larger, and less costly
per byte. The register fifile occupies the top level in the hierarchy, which is known
as level 0 or L0. We show three levels of caching L1 to L3, occupying memory
hierarchy levels 1 to 3. Main memory occupies level 4, and so on.

Beauty[ ˈ no ʊʃ n]
n. Concept; Opinion

Beauty[ ˈ ha ɪə r ɑː rki]
n. Hierarchy

Beauty[ ˈɑː kjupa ɪ]
v. Residence; occupy; occupy
1.7 The Operating System Manages the Hardware

The operating system has two primary purposes: (1) to protect the hardware
from misuse by runaway applications and (2) to provide applications with simple
and uniform mechanisms for manipulating complicated and often wildly different
low-level hardware devices. The operating system achieves both goals via the
fundamental abstractions shown in Figure 1.11: processes, virtual memory, and
fifiles. As this fifigure suggests, fifiles are abstractions for I/O devices, virtual memory
is an abstraction for both the main memory and disk I/O devices, and processes
are abstractions for the processor, main memory, and I/O devices. We will discuss
each in turn.

Beauty [M] ɪ s ˈ juz]
Vt. improper use

Beauty[ ˈ ju ː n ɪ f ɔː rm]
Adj. Consistent

Beauty[ ˈ mek ə n ɪ z ə m]
n. Mechanism, function, music mechanism

Beauty [M] əˈ n ɪ pjule ɪ t]
Vt. operation, processing

Beauty[ ˈ k ɑː mpl ɪ ke ɪ t]
v. Complicate

Beauty[ ˌ f ʌ nd əˈ mentl]
Adj. Basic; Ingrained
1.7.1 Processes

A process is the operating system’s abstraction for a running program. Multi-
ple processes can run concurrently on the same system, and each process appears
to have exclusive use of the hardware. By concurrently, we mean that the instruc-
tions of one process are interleaved with the instructions of another process. In
most systems, there are more processes to run than there are CPUs to run them.
Traditional systems could only execute one program at a time, while newer multi-
core processors can execute several programs simultaneously. In either case, a
single CPU can appear to execute multiple processes concurrently by having the
processor switch among them. The operating system performs this interleaving
with a mechanism known as context switching. To simplify the rest of this discus-
sion, we consider only a uniprocessor system containing a single CPU. We will
return to the discussion of multiprocessor systems in Section 1.9.2.

Beauty[ ɪ k ˈ sklu ː s ɪ v]
Adj. Unique

Beauty[ ɪ nt ə' l ɪ vd]
Adj. Interleaved

Beauty[ ˈ sevr ə l]
Det. several; Several

Beauty[ ˌ sa ɪ m ə l ˈ te ɪ ni ə sli]
Adv. simultaneously

Beauty[ ˈ mek ə n ɪ z ə m]
n. Mechanism, function, music mechanism
1.7.2 Threads

Beauty [k] ə n ˈ s ɪ st]
v. Consisting of; lie in

Beauty[ ɪˈ f ɪʃ nt]
Adj. Efficient
1.7.3 Virtual Memory

Virtual memory is an abstraction that provides each process with the illusion that it
has exclusive use of the main memory. Each process has the same uniform view of
memory, which is known as its virtual address space. The virtual address space for
Linux processes is shown in Figure 1.13. (Other Unix systems use a similar layout.)
In Linux, the topmost region of the address space is reserved for code and data
in the operating system that is common to all processes. The lower region of the
address space holds the code and data defifined by the user’s process. Note that
addresses in the fifigure increase from the bottom to the top.

Beauty[ ɪˈ lu ːʒ n]
n. Illusion; fantasy

Beauty[ ɪ k ˈ sklu ː s ɪ v]
Adj. Unique

Beauty[ ˈ ju ː n ɪ f ɔː rm]
Adj. Consistent

Beauty[ ˈ t ɑ pmo ʊ st]
Adj. Highest

Beauty [R] ɪˈ z ɜ rvd]
Adj. Reserved
1.7.4 Files

This simple and elegant notion of a fifile is nonetheless very powerful because
it provides applications with a uniform view of all the varied I/O devices that
might be contained in the system. For example, application programmers who
manipulate the contents of a disk fifile are blissfully unaware of the specific disk
technology. Further, the same program will run on different systems that use
different disk technologies. You will learn about Unix I/O in Chapter 10.

Beauty[ ˈ el ɪɡə nt]
Adj. Beautiful; Elegant

Beauty[ ˌ n ʌ n ðəˈ les]
Adv. nevertheless, but

Beauty[ ˈ verid]
Adj. All kinds of

Beauty [M] əˈ n ɪ pjule ɪ t]
Vt. operation, processing

Beauty ['bl ɪ sf ə l ɪ]
Adv. happily, joyfully

Beauty [sp əˈ s ɪ f ɪ k]
Adj. Explicit
1.8 Systems Communicate with Other Systems Using Networks

With the advent of global networks such as the Internet, copying information
from one machine to another has become one of the most important uses of
computer systems. For example, applications such as email, instant messaging, the
World Wide Web, FTP, and telnet are all based on the ability to copy information
over a network.

Beauty[ ˈ ædvent]
n. Appear

Beauty[ ˈɪ nst ə nt]
Adj. Immediate
1.9 Important Themes

This concludes our initial whirlwind tour of systems. An important idea to take
away from this discussion is that a system is more than just hardware. It is a
collection of intertwined hardware and systems software that must cooperate in
order to achieve the ultimate goal of running application programs. The rest of
this book will fifill in some details about the hardware and the software, and it will
show how, by knowing these details, you can write programs that are faster, more
reliable, and more secure.

Beauty [k] ə n ˈ klu ː d]
v. Infer; summary

Beauty[ ɪˈ n ɪʃ l]
Adj. Start

Beauty[ ˈ w ɜː rlw ɪ nd]
Adj. Whirlwind; Rapid

Beauty[ ˌɪ nt ə r ˈ twa ɪ n]
Vt. entangled together; Entangle

Beauty [ko ʊˈɑː p ə re ɪ t]
v. Collaboration; coordination

Beauty[ ˈʌ l.t ə. m ə t]
Adj. Final

Beauty [R] ɪˈ la ɪə bl]
Adj. Trustworthy

Beauty [S] ɪˈ kj ʊ r]
Adj. Safe
1.9.1 Amdahl’s Law

Amdahl’s law describes a general principle for improving any process. In
addition to its application to speeding up computer systems, it can guide a company
trying to reduce the cost of manufacturing razor blades, or a student trying to
improve his or her grade point average. Perhaps it is most meaningful in the world
of computers, where we routinely improve performance by factors of 2 or more.
Such high factors can only be achieved by optimizing large parts of a system.

Beauty[ ˈ pr ɪ ns ə pl]
n. Law; Concept; reason; Law

Beauty[ ˌ mænju ˈ fækt ʃə r]
Vt. manufacturing, production

Beauty [ble] ɪ d]
n. Blade; Paddle Blade

Beauty [ru ˈ tinl ɪ]
Adv. routinely; Conventionally

Beauty[ ˈ fækt ə r]
n. Factors; factor
1.9.2 Concurrency and Parallelism

We highlight three levels here, working from the highest to the lowest level.
1. Thread-Level Concurrency, With threads, we can even have multiple control flows 
executing within a single process.
2. Instruction-Level Parallelism, we will explore the use of pipelining, where the
actions required to execute an instruction are partitioned into different steps and
the processor hardware is organized as a series of stages, each performing one
of these steps.
3. Single-Instruction, Multiple-Data (SIMD) Parallelism, processors have instructions that 
can add 8 pairs of single-precision floating-point numbers (C data type float) in parallel.

Beauty[ ˈ pær ə lel]
Adj. Parallel; Parallel

Beauty[ ˌ pa ɪ p'la ɪ n ɪŋ]
n. Pipeline operation

Beauty [P ɑː r ˈ t ɪʃ n]
Vt. separate

Beauty [PR] ɪˈ s ɪʒ n]
n. Accuracy
1.9.3 The Importance of Abstractions in Computer Systems

The use of abstractions is one of the most important concepts in computer science.
For example, one aspect of good programming practice is to formulate a simple
application program interface (API) for a set of functions that allow programmers
to use the code without having to delve into its inner workings. Different program-
ming languages provide different forms and levels of support for abstraction, such
as Java class declarations and C function prototypes.

Beauty[ ˈ k ɑː nsept]
n. Concept; concept

Beauty[ ˈ æspekt]
n. Aspects; a look

Beauty[ ˈ f ɔː rmjule ɪ t]
Vt. conceive, plan

Beauty [D] ɛ lv]
Vi. exploration; excavate

Beauty[ ˌ dekl əˈ re ɪʃ n]
n. Proclamation

Beauty[ ˈ pro ʊ t ə ta ɪ p]
n. Prototype
1.10 Summary

A computer system consists of hardware and systems software that cooperate
to run application programs. Information inside the computer is represented as
groups of bits that are interpreted in different ways, depending on the context.
Programs are translated by other programs into different forms, beginning as
ASCII text and then translated by compilers and linkers into binary executable

Beauty [k] ə n ˈ s ɪ st]
v. Consisting of;

Beauty [ko ʊˈɑː p ə re ɪ t]
v. Collaboration; coordination

Beauty[ ˌ repr ɪˈ zent]
v. Representatives; symbolize

Beauty[ ɪ n ˈ t ɜː rpr ə t]
v. Interpretation; understand

This work adoptsCC agreement, reprint must indicate the author and the link to this article

Recommended Today

The VBA ide displays a project that is not open. The solution cannot be operated

Reading time |0.24 minutes word count |388 characters primary coverage |1. Introduction & background “VBA ide displays the project that is not open, and the solution cannot be operated” Author | SCscHero Writing time | 2021/12/29 PM7:28 Article type |Series Degree of completion |Completed motto Every great cause has a trivial beginning. 1、 Introduction & […]