Prentice Hall

Engineering

Browse available resources for Electrical and Computing Engineering:



Computer Systems: A Programmer's Perspective
Randal E. Bryant
David R. O'Hallaron, both of Carnegie Mellon University

ISBN-10: 013034074X
ISBN-13: 9780130340740

Publisher: Prentice Hall
Copyright: 2003
Format: Cloth; 1304 pp
Published: 08/13/2002

Suggested retail price: $140.00
Buy from myPearsonStore

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 these ideas affect the correctness, performance, and utility of application programs. The text's concrete and hands-on approach will help students understand what is going on “under the hood” of a computer system.

  • Systems presented from a programmer's perspective—Material is presented in such a way that it has clear benefit to application programmers.
    • Teaches students how to use this knowledge to improve program performance and reliability. Enables students to become more effective in program debugging, because they understand the behaviors that can be caused by difficult bugs such as memory referencing errors.

  • Basic network programming.
    • Introduces students to basic concepts of I/O and computer networks, and gives them experience in dealing with concurrency and with client-server computing.

  • Processor Architecture—Extend and modify sequential and pipelined processors to add new instructions, change the brand prediction policy, and add or remove bypassing paths. Evaluate results with simulations models.
    • Gives students a chance to deepen their understanding of processor design and correctness.

  • 169 practice problems with solutions in the text and 33 homework problems with solutions in an instructors manual.
    • Gives students a chance to test their understanding of every concept presented in the book.

LABS AND ASSIGNMENTS VIA THE WEB SUPPLEMENT THE BOOK

http://csapp.cs.cmu.edu

  • Data puzzles—Implementation of simple logical and arithmetic functions, but using a highly restricted subset of C.
    • Helps students understand the bit-level representations of C data types and the bit-level behavior of the operations on data.

  • Defusing a binary bomb—Provided as an object code file that “explodes” when any one of six different strings used is incorrect.
    • Forces students to disassemble and reverse engineer the program in order to determine what the correct six strings should be.

  • Memory allocater—Implementation of students' own version of malloc and free.
    • Provides students with a clear understanding of data layout and organization and requires the evaluation of different tradeoffs between space and time efficiency.

  • Program optimization—Optimizes the performance of a memory-intensive application.
    • Provides students with a very clear demonstration of the properties of cache memories and gives them experience with low-level program optimization.

  • Proxy Server—Implementation of a proxy server for the world wide web.
    • Gives students exposure to such topics as web clients and servers, Unix sockets and file I/O accuracy, and threads.

(NOTE: Each chapter concludes with Summary.)

Preface.


1. A Tour of Computer Systems.

Information Is Bits + Context. Programs Are Translated by Other Programs into Different Forms. It Pays to Understand How Compilation Systems Work. Processors Read and Interpret Instructions Stored in Memory. Caches Matter. Storage Devices Form a Hierarchy. The Operating System Manages the Hardware. Systems Communicate with Other Systems Using Networks. The Next Step.

I. PROGRAM STRUCTURE AND EXECUTION.

2. Representing and Manipulating Information.

Information Storage. Integer Representations. Integer Arithmetic. Floating Point.

3. Machine-Level Representation of Programs.

A Historical Perspective. Program Encodings. Data Formats. Accessing Information. Arithmetic and Logical Operations. Control. Procedures. Array Allocation and Access. Heterogeneous Data Structures. Alignment. Putting It Together: Understanding Pointers. Life in the Real World: Using the GDB Debugger. Out-of-Bounds Memory References and Buffer Overflow. Floating-Point Code. Embedding Assembly Code in C Programs.

4. Processor Architecture.

The Y86 Instruction Set Architecture. Overview of Logic Design and the Hardware Control Language. A Sequential Implementation. General Principles of Pipelining. Pipelined Implementations.

5. Optimizing Program Performance.

Capabilities and Limitations of Optimizing Compilers. Expressing Program Performance. Program Example. Eliminating Loop Inefficiencies. Reducing Procedure Calls. Eliminating Unneeded Memory References. Understanding Modern Processors. Reducing Loop Overhead. Converting to Pointer Code. Enhancing Parallelism. Putting It Together: Summary of Results for Optimizing Combining Code. Branch Prediction and Misprediction Penalties. Understanding Memory Performance. Life in the Real World: Performance Improvement Techniques. Identifying and Eliminating Performance Bottlenecks.

6. The Memory Hierarchy.

Storage Technologies. Locality. The Memory Hierarchy. Cache Memories. Writing Cache-Friendly Code. Putting It Together: Exploiting Locality in Your Programs.

II. RUNNING PROGRAMS ON A SYSTEM.

7. Linking.

Compiler Drivers. Static Linking. Object Files. Relocatable Object Files. Symbols and Symbol Tables. Symbol Resolution. Relocation. Executable Object Files. Loading Executable Object Files. Dynamic Linking with Shared Libraries. Loading and Linking Shared Libraries from Applications. Position-Independent Code (PIC). Tools for Manipulating Object Files.

8. Exceptional Control Flow.

Exceptions. Processes. System Calls and Error Handling. Process Control. Signals. Nonlocal Jumps. Tools for Manipulating Processes.

9. Measuring Program Execution Time.

The Flow of Time on a Computer Systems. Measuring Time by Interval Counting. Cycle Counters. Measuring Program Execution Time with Cycle Counters. Time-of-Day Measurements. Putting It Together: An Experimental Protocol. Looking into the Future. Life in the Real World: An Implementation of the K-Best Measurement Scheme. Lessons Learned.

10. Virtual Memory.

Physical and Virtual Addressing. Address Spaces. VM as a Tool for Caching. VM as a Tool for Memory Management. VM as a Tool for Memory Protection. Address Translation. Case Study: The Pentium/Linux Memory System. Memory Mapping. Dynamic Memory Allocation. Garbage Collection. Common Memory-Related Bugs in C Programs. Recapping Some Key Ideas about Virtual Memory.

III. INTERACTION AND COMMUNICATION BETWEEN PROGRAMS.

11. System-Level I/O.

Unix I/O. Opening and Closing Files. Reading and Writing Files. Robust Reading and Writing with the R10 Package. Reading File Metadata. Sharing Files. I/O Redirection. Standard I/O. Putting It Together: Which I/O Functions Should I Use?

12. Network Programming.

The Client-Server Programming Model. Networks. The Global IP Internet. The Sockets Interface. Web Servers. Putting It Together: The TINY Web Server.

13. Concurrent Programming.

Concurrent Programming with Processes. Concurrent Programming with I/O Multiplexing. Concurrent Programming with Threads. Shared Variables in Threaded Programs. Synchronizing Threads with Semaphores. Putting It Together: A Concurrent Server Based on Pre-Threading. Other Concurrency Issues.

Appendix A. HCL Descriptions of Processor Control Logic.

HCL Reference Manual. SEQ. SEQ+. PIPE.

Appendix B. Error Handling.

Error Handling in Unix Systems. Error-Handling Wrappers. The csapp .h Header File. The csapp .c Source File.

"I strongly believe that a programmer's perspective really helps in teaching the students the inner structure of computers." — Kostas Daniilidis, University o f Pennsylvania

"The book approaches the material in a way unlike any other, but similar to how I'd like to move our course." — John Greiner, Rice University

"This is an outstanding project and has a good chance of revolutionizing pedagogy in the field." — Michael Scott, University of Rochester

Randal E. Bryant received the Bachelor's degree from the University of Michigan in 1973 and then attended graduate school at the Massachusetts Institute of Technology, receiving the Ph.D. degree in computer science in 1981. He spent three years as an Assistant Professor at the California Institute of Technology and has been on the faculty at Carnegie Mellon since 1984. He is currently the President's Professor of Computer Science and head of the Department of Computer Science. He also holds a courtesy appointment with the Department of Electrical and Computer Engineering.

He has taught courses in computer systems at both the undergraduate and graduate level for over 20 years. Over many years of teaching computer architecture courses, he began shifting the focus from how computers are designed to one of how programmers can write more efficient and reliable programs if they understand the system better. Together with Prof. O'Hallaron, he developed the course "Introduction to Computer Systems" at Carnegie Mellon that is the basis for this book. He has also taught courses in algorithms and programming.

Prof. Bryant's research concerns the design of software tools to help hardware designers verify the correctness of their systems. These include several types of simulators, as well as formal verification tools that prove the correctness of a design using mathematical methods. He has published over 100 technical papers. His research results are used by major computer manufacturers including Intel, Motorola, IBM, and Fujitsu. He has won several major awards for his research. These include two inventor recognition awards and a technical achievement award from the Semiconductor Research Corporation, the Kanellakis Theory and Practice Award from the Association for Computer Machinery (ACM), and the W. R. G. Baker Award and a Golden Jubilee Medal from the Institute of Electrical and Electronics Engineers (IEEE). He is a Fellow of both the ACM and the IEEE.

David R. O'Hallaron received the Ph.D. degree in computer science from the University of Virginia in 1986. After a stint at General Electric, he joined the Carnegie Mellon faculty in 1989 as a Systems Scientist. He is currently an Associate Professor in the Departments of Computer Science and Electrical and Computer Engineering.

He has taught computer systems courses at the undergraduate and graduate levels, on such topics as computer architecture, introductory computer systems, parallel processor design, and Internet services. Together with Prof. Bryant, he developed the course "Introduction to Computer Systems" that is the basis for this book.

Prof. O'Hallaron and his students perform research in the area of computer -systems. In particular, they develop software systems to help scientists and engineers simulate nature on computers. The best known example of their work is the Quake project, a group of computer scientists, civil engineers, and seismologists who have developed the ability to predict the motion of the ground during strong earthquakes, including major quakes in Southern California, Kobe, Japan, Mexico, and New Zealand. Along with the other members of the Quake Project, he received the Allen Newell Medal for Research Excellence from the CMU School of Computer Science. A benchmark he developed for the Quake project, 183.equake, was selected by SPEC for inclusion in the influential SPEC CPU and OMP (Open MP) benchmark suites.

A PROGRAMMER'S PERSPECTIVE

This book is for programmers who want to write faster and more reliable programs. By learning how programs are mapped onto the system and executed, readers will better understand why programs behave the way they do and how inefficiencies arise. Computer systems are viewed broadly, comprising processor and memory hardware, compiler, operating system, and networking environment. With its programmer's perspective, readers can clearly see how learning about the inner workings of computer systems will help their further development as computer scientists and engineers. It also helps prepare them for further study in computer architecture, operating systems, compilers, and networking.

Topics include: data representations, machine-level representations of C programs, processor architecture, program optimization, memory hierarchy, linking, exceptional control flow, virtual memory and memory management, system-level 1/O, network programming, and concurrent programming. The coverage focuses on how these areas affect application and system programmers. For example, when covering data representations, it considers how the finite representations used to represent numbers can approximate integer and real numbers, but with limitations that must be understood by programmers. When covering caching, it discusses how the ordering of loop indices in matrix code can affect program performance. When covering networking, it describes how a concurrent server can efficiently handle requests from multiple clients.

The book is based on Intel-compatible (IA32) machines executing C programs on Unix or related operating systems such as Linux. Some familiarity with C or C++ is assumed, although hints are included to help readers making the transition from Java to C.

A complete set of resources, including labs and assignments, lecture notes, and code examples are available via the book's Web site at csapp.cs.cmu.edu.

View a Sample Chapter PDF:

Pearson Higher Education offers special pricing when you choose to package your text with other student resources. If you're interested in creating a cost-saving package for your students, contact your Pearson Higher Education representative for pricing and ordering information.

Pearson Higher Education offers special pricing when you choose to package your text with other student resources. If you're interested in creating a cost-saving package for your students, browse our available packages below, or contact your Pearson Higher Education representative to create your own package.



Copyright ©2008 Pearson Education. All rights reserved. Legal Notice | Privacy Policy | Permissions