Computer Systems: A Programmer's Perspective, 2nd Edition
β Scribed by Randal E. Bryant, David R. O'Hallaron
- Publisher
- Addison Wesley
- Year
- 2010
- Tongue
- English
- Leaves
- 1078
- Edition
- 2
- Category
- Library
No coin nor oath required. For personal study only.
β¦ Synopsis
Few students studying computer science or computer engineering will ever have the opportunity to build a computer system. On the other hand, most students will be required to use and program computers on a near daily basis.
Computer Systems: A ProgrammerΓ’?β’s Perspective introduces the important and enduring concepts that underlie computer systems by showing how these ideas affect the correctness, performance, and utility of application programs. The texts hands-on approach (including a comprehensive set of labs) helps students understand the Γ’?Εunder-the-hoodΓ’? operation of a modern computer system and prepares them for future courses in systems topics such as compilers, computer architecture, operating systems, and networking.
β¦ Table of Contents
Cover ......Page 1
Title Page......Page 4
Copyright......Page 5
Contents......Page 8
Preface......Page 20
About the Authors......Page 34
1 A Tour of Computer Systems......Page 36
1.1 Information Is Bits + Context......Page 38
1.2 Programs Are Translated by Other Programs into Different Forms......Page 39
1.3 It Pays to Understand How Compilation Systems Work......Page 41
1.4.1 Hardware Organization of a System......Page 42
1.4.2 Running the hello Program......Page 45
1.5 Caches Matter......Page 47
1.6 Storage Devices Form a Hierarchy......Page 48
1.7 The Operating System Manages the Hardware......Page 49
1.7.1 Processes......Page 51
1.7.3 Virtual Memory......Page 52
1.7.4 Files......Page 54
1.8 Systems Communicate with Other Systems Using Networks......Page 55
1.9.1 Concurrency and Parallelism......Page 56
1.9.2 The Importance of Abstractions in Computer Systems......Page 59
1.10 Summary......Page 60
Bibliographic Notes......Page 61
Part I: Program Structure and Execution......Page 62
2 Representing and Manipulating Information......Page 64
2.1 Information Storage......Page 68
2.2 Integer Representations......Page 91
2.3 Integer Arithmetic......Page 114
2.4 Floating Point......Page 134
2.5 Summary......Page 153
Homework Problems......Page 154
Solutions to Practice Problems......Page 169
3 Machine-Level Representation of Programs......Page 188
3.1 A Historical Perspective......Page 191
3.2 Program Encodings......Page 194
3.3 Data Formats......Page 202
3.4 Accessing Information......Page 203
3.5 Arithmetic and Logical Operations......Page 212
3.6 Control......Page 220
3.7 Procedures......Page 254
3.8 Array Allocation and Access......Page 267
3.9 Heterogeneous Data Structures......Page 276
3.10 Putting It Together: Understanding Pointers......Page 287
3.11 Life in the Real World: Using the GDB Debugger......Page 289
3.12 Out-of-Bounds Memory References and Buffer Overflow......Page 291
3.13 x86-64: Extending IA32 to 64 Bits......Page 302
3.14 Machine-Level Representations of Floating-Point Programs......Page 327
3.15 Summary......Page 328
Homework Problems......Page 329
Solutions to Practice Problems......Page 343
4 Processor Architecture......Page 368
4.1 The Y86 Instruction Set Architecture......Page 371
4.2 Logic Design and the Hardware Control Language HCL......Page 387
4.3 Sequential Y86 Implementations......Page 399
4.4 General Principles of Pipelining......Page 426
4.5 Pipelined Y86 Implementations......Page 435
4.6 Summary......Page 484
Homework Problems......Page 486
Solutions to Practice Problems......Page 492
5 Optimizing Program Performance......Page 508
5.1 Capabilities and Limitations of Optimizing Compilers......Page 511
5.2 Expressing Program Performance......Page 515
5.3 Program Example......Page 517
5.4 Eliminating Loop Inefficiencies......Page 521
5.5 Reducing Procedure Calls......Page 525
5.6 Eliminating Unneeded Memory References......Page 526
5.7 Understanding Modern Processors......Page 531
5.8 Loop Unrolling......Page 544
5.9 Enhancing Parallelism......Page 548
5.10 Summary of Results for Optimizing Combining Code......Page 559
5.11 Some Limiting Factors......Page 560
5.12 Understanding Memory Performance......Page 566
5.13 Life in the Real World: Performance Improvement Techniques......Page 574
5.14 Identifying and Eliminating Performance Bottlenecks......Page 575
5.15 Summary......Page 582
Bibliographic Notes......Page 583
Homework Problems......Page 584
Solutions to Practice Problems......Page 587
6 The Memory Hierarchy......Page 594
6.1 Storage Technologies......Page 596
6.2 Locality......Page 621
6.3 The Memory Hierarchy......Page 626
6.4 Cache Memories......Page 631
6.5 Writing Cache-friendly Code......Page 650
6.6 Putting It Together: The Impact of Caches on Program Performance......Page 655
6.7 Summary......Page 664
Bibliographic Notes......Page 665
Homework Problems......Page 666
Solutions to Practice Problems......Page 677
Part II: Running Programs on a System......Page 686
7 Linking......Page 688
7.1 Compiler Drivers......Page 690
7.3 Object Files......Page 692
7.4 Relocatable Object Files......Page 693
7.5 Symbols and Symbol Tables......Page 695
7.6 Symbol Resolution......Page 698
7.7 Relocation......Page 707
7.8 Executable Object Files......Page 713
7.9 Loading Executable Object Files......Page 714
7.10 Dynamic Linking with Shared Libraries......Page 716
7.11 Loading and Linking Shared Libraries from Applications......Page 718
7.12 Position-Independent Code (PIC)......Page 722
7.13 Tools for Manipulating Object Files......Page 725
Bibliographic Notes......Page 726
Homework Problems......Page 727
Solutions to Practice Problems......Page 733
8 Exceptional Control Flow......Page 736
8.1 Exceptions......Page 738
8.2 Processes......Page 747
8.3 System Call Error Handling......Page 752
8.4 Process Control......Page 753
8.5 Signals......Page 771
8.6 Nonlocal Jumps......Page 794
8.7 Tools for Manipulating Processes......Page 797
Bibliographic Notes......Page 798
Homework Problems......Page 799
Solutions to Practice Problems......Page 806
9 Virtual Memory......Page 810
9.1 Physical and Virtual Addressing......Page 812
9.2 Address Spaces......Page 813
9.3 VM as a Tool for Caching......Page 814
9.4 VM as a Tool for Memory Management......Page 820
9.5 VM as a Tool for Memory Protection......Page 821
9.6 Address Translation......Page 822
9.7 Case Study: The Intel Core i7/Linux Memory System......Page 834
9.8 Memory Mapping......Page 842
9.9 Dynamic Memory Allocation......Page 847
9.10 Garbage Collection......Page 873
9.11 Common Memory-Related Bugs in C Programs......Page 878
Bibliographic Notes......Page 883
Homework Problems......Page 884
Solutions to Practice Problems......Page 888
Part III: Interaction and Communication Between Programs......Page 894
10 System-Level I/O......Page 896
10.1 Unix I/O......Page 897
10.2 Opening and Closing Files......Page 898
10.3 Reading and Writing Files......Page 900
10.4 Robust Reading and Writing with the Rio Package......Page 902
10.5 Reading File Metadata......Page 908
10.6 Sharing Files......Page 910
10.7 I/O Redirection......Page 912
10.8 Standard I/O......Page 914
10.9 Putting It Together: Which I/O Functions Should I Use?......Page 915
10.10 Summary......Page 916
Homework Problems......Page 917
Solutions to Practice Problems......Page 918
11 Network Programming......Page 920
11.1 The Client-Server Programming Model......Page 921
11.2 Networks......Page 922
11.3 The Global IP Internet......Page 926
11.4 The Sockets Interface......Page 935
11.5 Web Servers......Page 946
11.6 Putting It Together: The TINY Web Server......Page 954
11.7 Summary......Page 962
Homework Problems......Page 963
Solutions to Practice Problems......Page 964
12 Concurrent Programming......Page 968
12.1 Concurrent Programming with Processes......Page 970
12.2 Concurrent Programming with I/O Multiplexing......Page 974
12.3 Concurrent Programming with Threads......Page 982
12.4 Shared Variables in Threaded Programs......Page 989
12.5 Synchronizing Threads with Semaphores......Page 992
12.6 Using Threads for Parallelism......Page 1009
12.7 Other Concurrency Issues......Page 1014
12.8 Summary......Page 1023
Homework Problems......Page 1024
Solutions to Practice Problems......Page 1029
A: Error Handling......Page 1034
A.1 Error Handling in Unix Systems......Page 1035
A.2 Error-Handling Wrappers......Page 1036
References......Page 1040
A......Page 1046
B......Page 1048
C......Page 1049
D......Page 1052
E......Page 1054
F......Page 1055
G......Page 1056
H......Page 1057
I......Page 1058
J......Page 1060
L......Page 1061
M......Page 1062
O......Page 1065
P......Page 1066
R......Page 1069
S......Page 1071
T......Page 1075
U......Page 1076
W......Page 1077
Z......Page 1078
π SIMILAR VOLUMES
For Computer Organization and Architecture and Computer Systems courses in CS and EE and ECE departments. Developed out of an introductory course at Carnegie Mellon University, this text explains the important and enduring concepts underlying all computer systems, and shows the concrete ways that t
<DIV sercontent> <B> <P style="MARGIN: 0px">For Computer Systems, Computer Organization and Architecture courses in CS, EE, and ECE departments.</P> </B> <br> <P style="MARGIN: 0px">Few students studying computer science or computer engineering will ever have the opportunity to build a computer sy
This book, Computer Systems: A Programmer's Perspective (CS:APP), is for pro- grammers who want to improve their skills by learning what is going on "under the hood" of a computer system. Our aim is to explain the enduring concepts underlying all computer systems, and to show you the concrete
CS:APP 3e with scanned main text from the Chinese adaptation. Details and updates available at (in English and Chinese): https://forum.freemdict.com/t/topic/11216 Uploader's note: There are a few versions of electronic copies of the third edition available so far on the internet: - An EPUB