資料簡介:
本書從程序員的視角詳細(xì)闡述計(jì)算機(jī)系統(tǒng)的本質(zhì)概念,并展示這些概念如何實(shí)實(shí)在在地影響應(yīng)用程序的正確性、性能和實(shí)用性。全書共12章,主要包括信息的表示和處理、程序的機(jī)器級表示、處理器體系結(jié)構(gòu)、優(yōu)化程序性能、存儲器層次結(jié)構(gòu)、鏈接、異??刂屏?、虛擬存儲器、系統(tǒng)級I/O、網(wǎng)絡(luò)編程、并發(fā)編程等內(nèi)容。書中提供了大量的例子和練習(xí)題,并給出部分答案,有助于讀者加深對正文所述概念和知識的理解
資料目錄:
A Tour of Computer Systems 1
1.1Information Is Bits + Context 3
1.2Programs Are Translated by Other Programs into Different Forms 4
1.3It Pays to Understand How Compilation Systems Work 6
1.4Processors Read and Interpret Instructions Stored in Memory 7
1.4.1Hardware Organization of a System 8
1.4.2Running the helloProgram 10
1.5Caches Matter 11
1.6Storage Devices Form a Hierarchy 14
1.7The Operating System Manages the Hardware 14
1.7.1Processes 15
1.7.2Threads 17
1.7.3Virtual Memory 18
1.7.4Files 19
1.8Systems Communicate with Other Systems Using Networks 19
1.9Important Themes 22
1.9.1Amdahl’s Law 22
1.9.2Concurrency and Parallelism 24
1.9.3The Importance of Abstractions in Computer Systems 26
1.10Summary 27 Bibliographic Notes 28 Solutions to Practice Problems 28
Part I Program Structure and Execution
2
Representing and Manipulating Information 31
2.1Information Storage 34
2.1.1Hexadecimal Notation 36
2.1.2Data Sizes 39
2.1.3 Addressing and Byte Ordering 42
2.1.4 Representing Strings 49
2.1.5 Representing Code 49
2.1.6 Introduction to Boolean Algebra 50
2.1.7 Bit-Level Operations in C 54
2.1.8 Logical Operations in C 56
2.1.9 Shift Operations in C 57
2.2 Integer Representations 59
2.2.1 Integral Data Types 60
2.2.2 Unsigned Encodings 62
2.2.3 Two’s-Complement Encodings 64
2.2.4 Conversions between Signed and Unsigned 70
2.2.5 Signed versus Unsigned in C 74
2.2.6 Expanding the Bit Representation of a Number 76
2.2.7 Truncating Numbers 81
2.2.8 Advice on Signed versus Unsigned 83
2.3 Integer Arithmetic 84
2.3.1 Unsigned Addition 84
2.3.2 Two’s-Complement Addition 90
2.3.3 Two’s-Complement Negation 95
2.3.4 Unsigned Multiplication 96
2.3.5 Two’s-Complement Multiplication 97
2.3.6 Multiplying by Constants 101
2.3.7 Dividing by Powers of 2 103
2.3.8 Final Thoughts on Integer Arithmetic 107
2.4 Floating Point 108
2.4.1 Fractional Binary Numbers 109
2.4.2 IEEE Floating-Point Representation 112
2.4.3 Example Numbers 115
2.4.4 Rounding 120
2.4.5 Floating-Point Operations 122
2.4.6 Floating Point in C 124
2.5 Summary 126
Bibliographic Notes 127
Homework Problems 128
Solutions to Practice Problems 143
3
Machine-Level Representation of Programs 163
3.1 A Historical Perspective 166
3.2Program Encodings 169
3.2.1Machine-Level Code 170
3.2.2Code Examples 172
3.2.3Notes on Formatting 175
3.3Data Formats 177
3.4Accessing Information 179
3.4.1Operand Speci.ers 180
3.4.2Data Movement Instructions 182
3.4.3Data Movement Example 186
3.4.4Pushing and Popping Stack Data 189
3.5Arithmetic and Logical Operations 191
3.5.1Load Effective Address 191
3.5.2Unary and Binary Operations 194
3.5.3Shift Operations 194
3.5.4Discussion 196
3.5.5Special Arithmetic Operations 197
3.6Control 200
3.6.1Condition Codes 201
3.6.2Accessing the Condition Codes 202
3.6.3Jump Instructions 205
3.6.4Jump Instruction Encodings 207
3.6.5Implementing Conditional Branches withConditional Control 209
3.6.6Implementing Conditional Branches withConditional Moves 214
3.6.7Loops 220
3.6.8Switch Statements 232
3.7Procedures 238
3.7.1The Run-Time Stack 239
3.7.2Control Transfer 241
3.7.3Data Transfer 245
3.7.4Local Storage on the Stack 248
3.7.5Local Storage in Registers 251
3.7.6Recursive Procedures 253
3.8Array Allocation and Access 255
3.8.1Basic Principles 255
3.8.2Pointer Arithmetic 257
3.8.3Nested Arrays 258
3.8.4Fixed-Size Arrays 260
3.8.5Variable-Size Arrays 262
3.9 Heterogeneous Data Structures 265
3.9.1 Structures 265
3.9.2 Unions 269
3.9.3 Data Alignment 273
3.10 Combining Control and Data in Machine-Level Programs 276
3.10.1 Understanding Pointers 277
3.10.2 Life in the Real World: Using the gdbDebugger 279
3.10.3 Out-of-Bounds Memory References and Buffer Over.ow 279
3.10.4 Thwarting Buffer Over.ow Attacks 284
3.10.5 Supporting Variable-Size Stack Frames 290
3.11 Floating-Point Code 293
3.11.1 Floating-Point Movement and Conversion Operations 296
3.11.2 Floating-Point Code in Procedures 301
3.11.3 Floating-Point Arithmetic Operations 302
3.11.4 De.ning and Using Floating-Point Constants 304
3.11.5 Using Bitwise Operations in Floating-Point Code 305
3.11.6 Floating-Point Comparison Operations 306
3.11.7 Observations about Floating-Point Code 309
3.12 Summary 309
Bibliographic Notes 310
Homework Problems 311
Solutions to Practice Problems 325
4
Processor Architecture 351
4.1The Y86-64 Instruction Set Architecture 355
4.1.1Programmer-Visible State 355
4.1.2Y86-64 Instructions 356
4.1.3Instruction Encoding 358
4.1.4Y86-64 Exceptions 363
4.1.5Y86-64 Programs 364
4.1.6Some Y86-64 Instruction Details 370
4.2Logic Design and the Hardware Control Language HCL 372
4.2.1Logic