[CSAPP] Chapter 1 Overview of Computer

1.1 information is bits + context

All computer programs are just a sequence of bits, each with a value of 0 or 1, organized in 8-bit chunks called by bytes.

8 bits = 1 byte

All files is binary files.

1.2 Programs are translated by other programs into different forms

To compile a program, we have 4 phases.

Preprocessoring phases: The preprocessor modifies the original program acording to the character in the program.

The result is another program. Just like how preprocessor deal with ‘#‘ in C program.

Compiler phases: translate high-level language into assembler language

Assembler phases: translate the program into machine language

Linker phases: link to the standard libary

1.4 Processors read and Interpret Instructions stored in memory

The shell is a command-line interpreter. If the first word does not correspond to a built-in shell command, then shell will assume that it‘s a executable file.

1.4.1 Hardware organization of a System

Buses: running through the system, a collection of electrical conduits

carry bytes of information between devices

I/O Devices: system‘s connection to the external world

Each I/O device is connected to the I/O bus by either a controlled or an adapter.

Main memory: a temporary storage device

Processor: CPU or simple processor, control the hold system

1.5 Caches Matter


A system spend a lot of time moving information from one place to another.

A major goal is decrease the copy time.

The major part of copy time is copying between processor and memory.

Between these two devices, we have processor-memory gap.

To solve this problem, we will use cache.

 1.6 storage devices form a hierarchy

1.7 OS manage the hardware

OS is a layer between the application program and the hardware.

purpose:

(1) protect hardware from misuse;

(2) make the hardware easy to use.

1.7.1 Processes


A process is the operating system‘s abstraction for a running program.

Multiple processes can run concurrently on the same system, and each process appears to have exclusive use of hardware.

Single CPU can appear to execute multiple processes concurrently by having the processor switch among them.

This mechanism is called context switching.

1.7.2 Threads

Threads running in the context of the process and sharing the same code and global data

Multi-threading can make program run faster.

1.7.3 virtual memory

Virtual memory is an abstraction that provides each process with the illusion that it has exclusive use of the main memory.

Each process -----> uniform view of memory -----> virtual address space

Program code and data:

Code begins at the same fixed address for all process followed by data locations.

Heap:

expand and contract dynamically at run time as a result of calls to standard C library routines such as malloc and free.

Shared libraries:

hold the codes and data for shared libraries such as C standard library and the math library

Stack:

compiler uses to implement functions call

expand and contract dynamically at run time

Kernel Virtual Memory:

the part of OS

1.7.4 files

A sequence of bytes

Every I/O devices is modeled as a file

1.8 Systems communicate with other systems using Networks

networks can be just viewed as an I/O device.

main memory ---> network adapter ----> network ----> another machine

1.9 Important Themes

1.9.1 Concurrency and Parallelism

Thread-level concurrency:

multiple programs execute at the same time

Hyperthreading = simultaneous multi-threading allows a single CPU to execute multiple flows of control.

Instruction-level Parallelism:

Processors execute multiple instructions at one time.

Single-instruction, Multiple-Data(SIMD) Parallelism:

special hardware allows a single instruction to cause multiple operations to be performed in parallel

1.9.2 The importance of abstractions in Computer System

formulate a simple application-program interface (API) for a set of functions that allows programmers to use the code without diving into its inner workings

1.10 summary

computer system = hardware + software

Information = groups of bits

Computer spends most of time copying data ----> the storage device is a hierarchy

3 fundamenta abstractions:

(1) Files are abstractions for I/O devices.

(2) Virtual memory is an abstraction for both main memory and disk.

(3) Processes are abstractions for the processor, main memory and I/O device.

时间: 2024-10-24 02:03:49

[CSAPP] Chapter 1 Overview of Computer的相关文章

MVC Chapter 12 Overview of MVC Projects

MVC Projects Templates Empty 一个空 ASP.NET MVC 4 项目. Basic 基本 ASP.NET MVC 4 项目. Internet Application 带有使用窗体身份验证的帐户控制器的默认 ASP.NET MVC 4 项目. Intranet Application 使用 Windows 身份验证的默认 ASP.NET MVC 4 项目. Mobile Application 一个 ASP.NET MVC 4 项目,适用于带有使用窗体身份验证的帐户

CSAPP Chapter 2

计算机中的信息存储 大多数计算机使用8位的块(字节byte)作为最小的可寻址的存储器单位,而不是在存储器中访问单独的位(单独的位由存储器内部寻址).程序将存储器视为一个非常大的字节数组,称为虚拟存储器(virtual memory).存储器的每个字节都由一个唯一的数字来标识,称为它的地址,所有地址的集合称为虚拟地址空间(virtual adress space).这个虚拟地址空间只是一个展现给机器级程序的映像,实际的实现见第九章. 每台计算机都有一个字长(32位,64位).因为虚拟地址空间以这个

chapter 3 introduction to computer science

主机文件: <chapter3.docx>

computer network fundamental

Copy from  http://cyberlingo.blogspot.com/2015/10/data-communications-and-networking-2.html List the layers of the Internet model. Physical, Data Link, Network, Transport, Application. Which layers in the Internet model are the network support layers

[Stanford Algorithms: Design and Analysis, Part 2]

Specific topics in Part 2 include: greedy algorithms (scheduling, minimum spanning trees, clustering, Huffman codes), dynamic programming (knapsack, sequence alignment, optimal search trees, shortest paths), NP-completeness and what it means for the

分享一本关于稀疏信号处理的书给大家,也是我曾读过的教材[附下载链接]

Sparse Signal Processing 作者/authors M Azghani, F Marvasti 摘要/abstract Conventional sampling techniques are based on Shannon-Nyquist theory which states that the required sampling rate for perfect recovery of a band-limited signal is at least twice it

&lt;转载&gt; OpenGL Projection Matrix

原文 OpenGL Projection Matrix Related Topics: OpenGL Transformation Overview Perspective Projection Orthographic Projection Updates: The MathML version is available here. Overview A computer monitor is a 2D surface. A 3D scene rendered by OpenGL must b

【转载】Gradle学习 第一章:引言

转载地址:http://ask.android-studio.org/?/article/7 We would like to introduce Gradle to you, a build system that we think is a quantum leap for build technology in the Java (JVM) world. Gradle provides:<翻译>我们准备把Gradle介绍给你,我们认为它是一个在Java构建技术世界里具有巨大突破性的构建工

libusb 开发者指南-牛胜超(转)

源:libusb 开发者指南 libusb Developers Guidelibusb 开发者指南 原作者:Johannes Erdfelt翻译者:牛胜超 Table of Contents目录 Preface序言 I. Introduction            引言   1. Overview      概述   2. Current OS support      流行的操作系统支持 II. API                         应用程序接口   3. Device