CSAPP英語學習系列:Chapter 1: A Tour of Computer Systems.

xing393939發表於2021-01-10

讀CSAPP這本書是基於PDF,邊讀變記錄英語生詞。

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
play.

terminate
美[ˈtɜːrmɪneɪt]
vt.& vi. 結束;使終結

briefly
美[ˈbriːfli]
adv. 短暫地;簡單地;簡略地;略略

concept
美[ˈkɑːnsept]
n. 概念;觀念

terminology
美[ˌtɜːrmɪˈnɑːlədʒi]
n. 專門名詞;術語,術語學;用辭

component
美[kəmˈpoʊnənt]
n. 組成部分,成分
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
instruction.

representation
美[ˌrɛprɪzɛnˈteʃən]
n. 表現;陳述;表現…的事物

illustrate
美[ˈɪləstreɪt]
v. (用示例/圖畫等)說明

fundamental
美[ˌfʌndəˈmentl]
adj. 基礎的;根深蒂固的

bunch
美[bʌntʃ]
n. 一夥;一束;一串

distinguish
美[dɪˈstɪŋɡwɪʃ]
v. 區分,使有別於;辨別出

sequence
美[ˈsiːkwəns]
n. []數列,序列

instruction
美[ɪnˈstrʌkʃn]
n. 指示;計算機指令
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.

perform
美[pərˈfɔːrm]
v. 執行;起…作用

sequence
美[ˈsiːkwəns]
n. []數列,序列

phase
美[feɪz]
n. 階段;時期

figure
美[ˈfɪɡjər]
n. 圖,表

preprocessor
美[pri'proʊsesə(r)]
n. 預處理程式

assembler
美[əˈsɛmblɚ]
n. 裝配工;彙編程式

collectively
美[kəˈlɛktɪvlɪ]
adv. 全體地,共同地

compilation
美[ˌkɑmpɪˈleɪʃn]
n. 彙編物
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?

optimize
美[ˈɑptɪmaɪz]
vt. 使最最佳化,使盡可能有效

sophisticate
美[sə'fɪstɪkeɪt]
adj. 老於世故的

efficient
美[ɪˈfɪʃnt]
adj. 效率高的;有能力的

overhead
美[ˈoʊvərhed]
n. 經常性支出,運營費用

incur
美[ɪnˈkɜːr]
vt. 招致,引起

rearrange
美[ˌriəˈrendʒ]
vt. 重新安排;重新佈置

parenthesis
美[pəˈrɛnθɪsɪs]
n. 插入語;插入成分

arithmetic
美[əˈrɪθmətɪk]
n. 算術;資料統計
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.

interpreter
美[ɪnˈtɜːrprətər]
n. 解釋者

prompt
美[prɑːmpt]
n. 激勵;提示符;提詞;提示

correspond
美[ˌkɔːrəˈspɑːnd]
v. 符合;相當於;通訊

assume
美[əˈsuːm]
v. 假設,認為
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.

instruction
美[ɪnˈstrʌkʃn]
n. 計算機指令

accord
美[ əˈkɔːrd]
v. 給予(某種待遇);符合,與…一致

strict
美[strɪkt]
adj. 嚴格的;嚴密的

interpret
美[ɪnˈtɜːrprət]
v. 詮釋;領會,把…理解為

dictate
美[ ˈdɪkteɪt]
vt. 口述;命令,指示

contiguous
美[kənˈtɪɡjuəs]
adj. 接觸的,鄰近的,共同的
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.

omit
美[oʊˈmɪt]
vt. 省略;遺漏

initially
美[ɪˈnɪʃəli]
adv. 開始;最初
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.

gap
美[ɡæp]
n. 間隔;差距

temporary
美[ˈtempəreri]
adj. 短暫的

stage
美[steɪdʒ]
v. 上演;舉辦;組織;使發生

typical
美[ˈtɪpɪkl]
adj. 典型的;

chip
美[tʃɪp]
n. 炸薯條,炸薯片

exploiting
美[ɪksp'lɔɪtɪŋ]
v. 開採( exploit的現在分詞 )

tendency
美[ˈtendənsi]
n. 傾向;趨勢
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.

notion
美[ˈnoʊʃn]
n. 概念,觀念;意見,見解

hierarchy
美[ˈhaɪərɑːrki]
n. []分層,層次

occupy
美[ˈɑːkjupaɪ]
v. 居住;佔用;佔領
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.

misuse
美[mɪsˈjuz]
vt. 使用…不當

uniform
美[ˈjuːnɪfɔːrm]
adj. 一致的,統一的

mechanism
美[ˈmekənɪzəm]
n. []機制,機能,[]機理

manipulate
美[məˈnɪpjuleɪt]
vt. 操作,處理

complicate
美[ˈkɑːmplɪkeɪt]
v. 使複雜化

fundamental
美[ˌfʌndəˈmentl]
adj. 基礎的;根深蒂固的
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.

exclusive
美[ɪkˈskluːsɪv]
adj. 獨有的

interleaved
美[ɪntə'lɪvd]
adj. 交叉存取的,隔行掃描的

several
美[ˈsevrəl]
det. 幾個;數個

simultaneously
美[ˌsaɪməlˈteɪniəsli]
adv. 同時地

mechanism
美[ˈmekənɪzəm]
n. []機制,機能,[]機理
1.7.2 Threads

consist
美[kənˈsɪst]
v. 由…組成;在於

efficient
美[ɪˈfɪʃnt]
adj. 效率高的
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.

illusion
美[ɪˈluːʒn]
n. 錯覺;幻想

exclusive
美[ɪkˈskluːsɪv]
adj. 獨有的

uniform
美[ˈjuːnɪfɔːrm]
adj. 一致的,統一的

topmost
美[ˈtɑpmoʊst]
adj. 最高的

reserved
美[rɪˈzɜrvd]
adj. 預訂的
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.

elegant
美[ˈelɪɡənt]
adj. 優美的;典雅的

nonetheless
美[ˌnʌnðəˈles]
adv. 雖然如此,但是

varied
美[ˈverid]
adj. 各種各樣的

manipulate
美[məˈnɪpjuleɪt]
vt. 操作,處理

blissfully
美['blɪsfəlɪ]
adv. 幸福地,充滿喜悅地

specific
美[spəˈsɪfɪk]
adj. 明確的
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.

advent
美[ˈædvent]
n. 出現

instant
美[ˈɪnstənt]
adj. 立即的
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.

conclude
美[kənˈkluːd]
v. 推斷出;總結

initial
美[ɪˈnɪʃl]
adj. 開始的

whirlwind
美[ˈwɜːrlwɪnd]
adj. 旋風般的;急速的

intertwine
美[ˌɪntərˈtwaɪn]
vt. 纏結在一起;使纏結

cooperate
美[koʊˈɑːpəreɪt]
v. 協作;配合

ultimate
美[ˈʌl..mət]
adj. 最後的

reliable
美[rɪˈlaɪəbl]
adj. 可信賴的

secure
美[sɪˈkjʊr]
adj. 安全的
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.

principle
美[ˈprɪnsəpl]
n. 法則;觀念;理由;定律

manufacture
美[ˌmænjuˈfæktʃər]
vt. 製造,生產

blade
美[bleɪd]
n. 葉片;槳葉

routinely
美[ruˈtinlɪ]
adv. 例行公事地;常規地,慣常地

factor
美[ˈfæktər]
n. 因素;因子
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.

parallel
美[ˈpærəlel]
adj. 平行的;並行的

pipelining
美[ˌpaɪp'laɪnɪŋ]
n. 流水線操作

partition
美[pɑːrˈtɪʃn]
vt. 分開,隔開

precision
美[prɪˈsɪʒn]
n. 精確度
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.

concept
美[ˈkɑːnsept]
n. 概念;觀念

aspect
美[ˈæspekt]
n. 方面;樣子

formulate
美[ˈfɔːrmjuleɪt]
vt. 構想出,規劃

delve
美[dɛlv]
vi. 探究;挖掘

declaration
美[ˌdekləˈreɪʃn]
n. 公告,宣言

prototype
美[ˈproʊtətaɪp]
n. 原型
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
files.

consist
美[kənˈsɪst]
v. 由…組成;

cooperate
美[koʊˈɑːpəreɪt]
v. 協作;配合

represent
美[ˌreprɪˈzent]
v. 代表;象徵

interpret
美[ɪnˈtɜːrprət]
v. 詮釋;領會

本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章