Study Notes of the CS:APP ICS+ Course 15-213 (Regularly Updated, Till Chapter 0)

Study Notes of the CS:APP ICS+ Course 15-213

Course Information

Textbooks

Randal E. Bryant and David R. O‘Halloran,

Computer Systems: A Programmer‘s Perspective, Third Edition, Pearson, 2016

Brian W. Kernighan and Dennis M. Ritchie,

The C Programming Language, Second Edition, Prentice Hall, 1988

Home

http://www.cs.cmu.edu/~213

Related Materials

Course Overview: Topics

Programs and Data

?    Bits operations, arithmetic, assembly language programs

?    Representation of C control and data structures

?    Includes aspects of architecture and compilers

The Memory Hierarchy

?    Memory technology, memory hierarchy, caches, disks, locality

?    Includes aspects of architecture and OS

Exceptional Control Flow

?    Hardware exceptions, processes, process control, Unix signals, nonlocal jumps

?    Includes aspects of compilers, OS, and architecture

Virtual Memory

?    Virtual memory, address translation, dynamic storage allocation

?    Includes aspects of architecture and OS

Networking, and Concurrency

?    High level and low-level I/O, network programming

?    Internet services, Web servers

?    concurrency, concurrent server design, threads

?    I/O multiplexing with select

?    Includes aspects of networking, OS, and architecture

Study Notes of the CS:APP ICS+ Course 15-213 (Regularly Updated, Till Chapter 0)

Chapter 2    A Tour of Computer Systems

2.1    Information Is Bits + Context

2.2    Programs Are Translated by Other Programs into Different Forms

2.3    It Pays to Understand How Compilation Systems Work

2.4    Processors Read and Interpret Instructions Stored in Memory

2.4.1    Hardware Organization of a System

2.4.2    Running the hello Program

2.5    Caches Matter

2.6    Storage Devices Form a Hierarchy

2.7    The Operating System Manages the Hardware

2.7.1    Processes

2.7.2    Threads

2.7.3    Virtual Memory

2.7.4    Files

2.8    Systems Communicate with Other Systems Using Networks

2.9    Important Themes

2.9.1    Amdahl‘s Law

2.9.2    Concurrency and Parallelism

2.9.3    The Importance of Abstractions in Computer Systems

2.10    Summary

Part II    Program Structure and Execution

Chapter 3    Representing and Manipulating Information

3.1    Information Storage

3.1.1    Hexadecimal Notation

3.1.2    Data Sizes

3.1.3    Addressing and Byte Ordering

3.1.4    Representing Strings

3.1.5    Representing Code

3.1.6    Introduction to Boolean Algebra

3.1.7    Bit-Level Operations in C

3.1.8    Logical Operations in C

3.1.9    Shift Operations in C

3.2    Integer Representations

3.2.1    Integral Data Types

3.2.2    Unsigned Encodings

3.2.3    Two‘s-Complement Encodings

3.2.4    Conversions between Signed and Unsigned

3.2.5    Signed versus Unsigned in C

3.2.6    Expanding the Bit Representation of a Number

3.2.7    Truncating Numbers

3.2.8    Advice on Signed versus Unsigned

3.3    Integer Arithmetic

3.3.1    Unsigned Addition

3.3.2    Two‘s-Complement Addition

3.3.3    Two‘s-Complement Negation

3.3.4    Unsigned Multiplication

3.3.5    Two‘s-Complement Multiplication

3.3.6    Multiplying by Constants

3.3.7    Dividing by Powers of 2

3.3.8    Final Thoughts on Integer Arithmetic

3.4    Floating Point

3.4.1    Fractional Binary Numbers

3.4.2    IEEE Floating-Point Representation

3.4.3    Example Numbers

3.4.4    Rounding

3.4.5    Floating-Point Operations

3.4.6    Floating Point in C

3.5    Summary

Chapter 4    Machine-Level Representation of Programs

4.1    A Historical Perspective

4.2    Program Encodings

4.2.1    Machine-Level Code

4.2.2    Code Examples

4.2.3    Notes on Formatting

4.3    Data Formats

4.4    Accessing Information

4.4.1    Operand Specifiers

4.4.2    Data Movement Instructions

4.4.3    Data Movement Example

4.4.4    Pushing and Popping Stack Data

4.5    Arithmetic and Logical Operations

4.5.1    Load Effective Address

4.5.2    Unary and Binary Operations

4.5.3    Shift Operations

4.5.4    Discussion

4.5.5    Special Arithmetic Operations

4.6    Control

4.6.1    Condition Codes

4.6.2    Accessing the Condition Codes

4.6.3    Jump Instructions

4.6.4    Jump Instruction Encodings

4.6.5    Implementing Conditional Branches with Conditional Control

4.6.6    Implementing Conditional Branches with Conditional Moves

4.6.7    Loops

4.6.8    Switch Statements

4.7    Procedures

4.7.1    The Run-Time Stack

4.7.2    Control Transfer

4.7.3    Data Transfer

4.7.4    Local Storage on the Stack

4.7.5    Local Storage in Registers

4.7.6    Recursive Procedures

4.8    Array Allocation and Access

4.8.1    Basic Principles

4.8.2    Pointer Arithmetic

4.8.3    Nested Arrays

4.8.4    Fixed-Size Arrays

4.8.5    Variable-Size Arrays

4.9    Heterogeneous Data Structures

4.9.1    Structures

4.9.2    Unions

4.9.3    Data Alignment

4.10    Combining Control and Data in Machine-Level Programs

4.10.1    Understanding Pointers

4.10.2    Life in the RealWorld: Using the gdb Debugger

4.10.3    Out-of-Bounds Memory References and Buffer Overflow

4.10.4    Thwarting Buffer Overflow Attacks

4.10.5    Supporting Variable-Size Stack Frames

4.11    Floating-Point Code

4.11.1    Floating-Point Movement and Conversion Operations

4.11.2    Floating-Point Code in Procedures

4.11.3    Floating-Point Arithmetic Operations

4.11.4    Defining and Using Floating-Point Constants

4.11.5    Using Bitwise Operations in Floating-Point Code

4.11.6    Floating-Point Comparison Operations

4.11.7    Observations about Floating-Point Code

4.12    Summary

Chapter 5    

Chapter 6    

Chapter 7    The Memory Hierarchy

7.1    Storage Technologies

7.1.1    Random Access Memory

7.1.2    Disk Storage

7.1.3    Solid State Disks

7.1.4    Storage Technology Trends

7.2    Locality

7.2.1    Locality of References to Program Data

7.2.2    Locality of Instruction Fetches

7.2.3    Summary of Locality

7.3    The Memory Hierarchy

7.3.1    Caching in the Memory Hierarchy

7.3.2    Summary of Memory Hierarchy Concepts

7.4    Cache Memories

7.4.1    Generic Cache Memory Organization

7.4.2    Direct-Mapped Caches

7.4.3    Set Associative Caches

7.4.4    Fully Associative Caches

7.4.5    Issues with Writes

7.4.6    Anatomy of a Real Cache Hierarchy

7.4.7    Performance Impact of Cache Parameters

7.5    Summary

Part III    Running Programs on a System

Chapter 1

Chapter 2

Chapter 3

Chapter 4

Chapter 5

Chapter 8    

Chapter 9    

Chapter 10    

Chapter 11    

Chapter 12    

Chapter 9    Virtual Memory

9.1    Physical and Virtual Addressing

9.2    Address Spaces

9.3    VM as a Tool for Caching

9.3.1    DRAM Cache Organization

9.3.2    Page Tables

9.3.3    Page Hits

9.3.4    Page Faults

9.3.5    Allocating Pages

9.3.6    Locality to the Rescue Again

9.4    VM as a Tool for Memory Management

9.5    VM as a Tool for Memory Protection

9.6    Address Translation

9.6.1    Integrating Caches and VM

9.6.2    Speeding Up Address Translation with a TLB

9.6.3    Multi-Level Page Tables

9.6.4    Putting It Together: End-to-End Address Translation

9.7    Case Study: The Intel Core i7/Linux Memory System

9.7.1    Core i7 Address Translation

9.7.2    Linux Virtual Memory System

9.8    Memory Mapping

9.8.1    Shared Objects Revisited

9.8.2    The fork Function Revisited

9.8.3    The execve Function Revisited

9.8.4    User-Level Memory Mapping with the mmap Function

9.9    

9.10    Garbage Collection

9.10.1    Garbage Collector Basics

9.10.2    Mark&Sweep Garbage Collectors

9.10.3    Conservative Mark&Sweep for C Programs

9.11    Common Memory-Related Bugs in C Programs

9.11.1    Dereferencing Bad Pointers

9.11.2    Reading Uninitialized Memory

9.11.3    Allowing Stack Buffer Overflows

9.11.4    Assuming That Pointers and the Objects They Point to Are the Same Size

9.11.5    Making Off-by-One Errors

9.11.6    Referencing a Pointer Instead of the Object It Points To

9.11.7    Misunderstanding Pointer Arithmetic

9.11.8    Referencing Nonexistent Variables

9.11.9    Referencing Data in Free Heap Blocks

9.11.10    Introducing Memory Leaks

9.12    Summary

Study Notes of the CS:APP ICS+ Course 15-213 (Regularly Updated, Till Chapter 0)

上一篇:PHP 数组处理(一)


下一篇:uniapp中利用uni.$emit()和uni.$on()进行页面和tabbar页面传值(页面通讯)