- 原书名：Computer Systems Aprogrammer’s Perspective
- 原出版社： Pearson
a tour of computer systems 1
1.1 information is bits + context 2
1.2 programs are translated by other programs into different forms 4
1.3 it pays to understand how compilation systems work 6
processors read and interpret instructions stored in memory 6
1.4.1 hardware organization of a system 7
1.4.2 running the hello program 9
1.5 caches matter 11
1.6 storage devices form a hierarchy 12
1.7 the operating system manages the hardware 13
1.7.1 processes 15
1.7.2 threads 16
1.7.3 virtual memory 16
1.7.4 files 18
1.8 systems communicate with other systems using networks 18
1.9 the next step 20
1.10 summary 20
bibliographics notes 21
part i program structure and execution
Our aim is to explain the enduring concepts underlying all computer systems, and to show you the concrete ways that these ideas affect the correctness, performance, and utility of your application programs. Unlike other systems books, which are written primarily for system builders, this book is written for programmers, from a programmer's perspective.
If you study and learn the concepts in this book, you will be on your way to becoming the rare "power programmer" who knows how things work and how to fix them when they break. You will also be prepared to study specific systems topics such as compilers, computer architecture, operating systems, embedded systems, and networking.
Assumptions About the Reader's Background The examples in the book are based on Intel-compatible processors (called "IA32" by Intel and "x86" colloquially) running C programs on Unix or Unix-like (such as Linux) operating systems. (To simplify our presentation, we will use the term
"Unix" as an umbrella term for systems like Solaris and Linux.) The text contains numerous programming examples that have been compiled and run on Linux systems. We assume that you have access to such a machine, and are able to log in and do simple things such as changing directories.
If your computer runs Microsoft Windows, you have two choices. First, you can get a copy of Linux (see www. linux, org or www. red.hat, com) and install it as a "dual boot" option, so that your machine can run either operating system. Alternatiyely, by installing a copy of the Cygwin tools (www. cygwin, com), you can have up a Unix-like shell under Windows and have an environment very close to that provided by Linux. Not all features of Linux are available under Cygwin,
We also assume that you have some familiarity with C or C++. If your only prior experience is with Java, the transition will require more effort on your part, but we will help you. Java and C share similar syntax and control statements. However, there are aspects of C, particularly pointers, explicit dynamic memory allocation, and formatted I/O, that do not exist in Java. Fortunately, C is a small language, and it is clearly and beautifully described in the classic "K&R" text by Brian Kernighan and Dennis Ritchie . Regardless of your programming background, consider K&R an essential part of your personal systems library.
Several of the early chapters in the book explore the interactions between C programs and their machine-language counterparts. The machine language examples were all generated by the GNU Gcc compiler running on an Intel A32 processor. We do not assume any prior experience with hardware, machine language, or assembly-language programming.