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.

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

  1. CSAPP Chapter 8:Exception Control Flow

    prcesssor在运行时,假设program counter的值为a0, a1, ... , an-1,每个ak表示相对应的instruction的地址.从ak到ak+1的变化被称为control ...

  2. Chapter 2. Overview gradle概览

    2.1. Features //gradle特性 Here is a list of some of Gradle's features. Declarative builds and build-b ...

  3. optimization blocks (csapp chapter 5.1)

    p_511 编译器在没有指示下,会做‘ safe optimization',因此有些优化在没有参数的指示下是不会对代码做优化的,故在程序中应该避免某一类代码,因为它们妨碍了编译器做优化. optim ...

  4. Chapter 1. Introduction gradle介绍

      We would like to introduce Gradle to you, a build system that we think is a quantum leap for build ...

  5. 计算机网络 Computer Networks​ 期末复习总提纲

    平时不学习,期末火葬场. 一周时间靠王道考研和各路 pdf 自学计网,留下的提纲都在这里了.全是干货.全文 pdf 可以在这里下载:http://cloud.billc.io/s/xNHarppQPG ...

  6. Networked Graphics: Building Networked Games and Virtual Environments (Anthony Steed / Manuel Fradinho Oliveira 著)

    PART I GROUNDWORK CHAPTER 1 Introduction CHAPTER 2 One on One (101) CHAPTER 3 Overview of the Intern ...

  7. Image Segmentation的定义

    Definition 图像分割将一张图分为\(n\)个region, 需要满足下面5个条件 每一个像素都要属于一个region 每个region都是连通的 region与region之间没有交集 re ...

  8. 正则表达式——语法

    正则表达式(regular expression)--描述一种字符串匹配模式,可以用来检测一个字符串是否包含特定的子串.用其他字符串将其代替.提取出某个符合要求的子串. 正则表达式   由普通字符 和 ...

  9. <转载> OpenGL Projection Matrix

    原文 OpenGL Projection Matrix Related Topics: OpenGL Transformation Overview Perspective Projection Or ...

随机推荐

  1. React-Native基础_2.样式Style

    2.样式Style 基本使用 方式1 直接在View 上面写style 内容 <View style={{ backgroundColor: '#07811d', flex: 1 }}> ...

  2. python常用模块之json、pickle模块

    python常用模块之json.pickle模块 什么是序列化? 序列化就是把内存里的数据类型转换成字符,以便其能存储到硬盘或者通过网络进行传输,因为硬盘或网络传输时只接受bytes. 为什么要序列化 ...

  3. iOS的坑:ERRORITMS-90096: "Your binary is not optimized for iPhone 5 - New iPhone appsand app updatesXcode7提交到App Store二进制文件时报错错误:“你itms-90096二进制不是iPhone 5的新iPhone应用程序和应用程序的更新必须提交支持iPhone 5英寸的显示器........

    在工程里的Images.xcassets添加并设置LaunchImage对解决ERROR ITMS-90096根本不会起到任何作用,需要单独添加针对iPhone 5的载入图片.关键点有三项: 1.图片 ...

  4. C程序fork进程导致PHP执行不退出

    /********************************************************************* * C程序fork进程导致PHP执行不退出 * 说明: * ...

  5. 【剑指offer】08二叉树的下一个节点,C++实现

    原创博文,转载请注明出处! # 题目 父节点指向子节点的指针用实线表示,从子节点指向父节点的指针用虚线表示. # 思路 如果节点有右子节点,则右子节点的最左节点是该节点的下一个节点.例如,寻找b的下一 ...

  6. 基本SQL命令

    1.SQL命令的使用规则 1.每条命令必须以 ; 结尾 2.SQL命令不区分字母大小写 3.使用 \c 来终止当前命令的执行 2.库的管理 1.库的基本操作 1.查看已有库 show database ...

  7. 文件的copy

    def mycopy(src_filename, dst_filename): try: fr = open(src_filename, "rb") try: try: fw = ...

  8. BZOJ4547 Hdu5171 小奇的集合 【矩阵快速幂优化递推】

    BZOJ4547 Hdu5171 小奇的集合 Description 有一个大小为n的可重集S,小奇每次操作可以加入一个数a+b(a,b均属于S),求k次操作后它可获得的S的和的最大值.(数据保证这个 ...

  9. Windows 10 自带那么多图标,去哪里找呢?

    无意间发现我的 D 盘根目录中大部分的文件夹都是系统专用文件夹,有自己的独特图标,偶有一两个开发用的文件夹是默认图标.于是想把它们改成独特样式,而且是 Windows 10 那些新图标样式! 这是我的 ...

  10. 重温CLR(九) 接口

    对于多继承(multiple inheritance)的概念,许多程序员并不陌生,他是指一个类从两个或多个基类派生的能力.例如,假定TransmitData类的作用是发送数据,ReceiveData类 ...