ding.dev

CSAPP Walk Through: Chapter 1

· Notes, Computer Science

These series of notes are based on the book Computer Systems: A Programmer’s Perspective.

Computer Systems: A Programmer’s Perspective

The homepage for the book is http://csapp.cs.cmu.edu/.

I put these notes here for me to review the book conveniently, hope it helps you as well.


Information = Bits + Context

Files that consist exclusively of ASCII characters are known as text files. All other files are known as binary files.

The machine representations of numbers are not the same as integers and real numbers as they a finite approximations that can behave in unexpected ways.

Why is C so successful?

However, C also have weaknesses:

The 4 phases of the Compilation System

Understanding How Compilation System Work is useful

Processors Read and Interpret Instructions

Hardware Organization of a System

Running a Program

When we run a executable file(in Shell for example), shell loads the executable file to the main memory using DMA, and processor begin to execute the machine-language instuctions in the executable file’s main routine.

Direct Memory Access(DMA) is a technique to transfer data directly from disk to main memory, no need to go through the processor.

Caches

System spends a lot of time moving information from one place to another, so it is important to make the information move faster.

Cache memories, designed to deal with the processor-memory gap, were small fast storage devices to store temproary information which the processor is likely to need in the near future.

Storage Devices Form a Hierarchy

The Operating System Manages the Hardware

The operating system has two primary purpose:

  1. To protect the hardware from misuse by runaway applications.
  2. To provide applications with simple and uniform mechanisms for manipulating complicated and often wildly different low-level hardware devices.

Processes

Threads

Virtual Memory

Files

Systems Communicate with Each Other Using Networks

The network can also be viewed as an I/O device.

Concurrency and Parallelism

Parallelism can be exploited at multiple levels of abstraction in a computer system, for example there are Thread-Level Concurrency, Instruction-Level Parallelism, and Single-Instruction, Multiple-Data (SIMD) Parallelism.

← All articles