[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.
[CSAPP] Chapter 1 Overview of Computer的更多相关文章
- CSAPP Chapter 8:Exception Control Flow
prcesssor在运行时,假设program counter的值为a0, a1, ... , an-1,每个ak表示相对应的instruction的地址.从ak到ak+1的变化被称为control ...
- Chapter 2. Overview gradle概览
2.1. Features //gradle特性 Here is a list of some of Gradle's features. Declarative builds and build-b ...
- optimization blocks (csapp chapter 5.1)
p_511 编译器在没有指示下,会做‘ safe optimization',因此有些优化在没有参数的指示下是不会对代码做优化的,故在程序中应该避免某一类代码,因为它们妨碍了编译器做优化. optim ...
- Chapter 1. Introduction gradle介绍
We would like to introduce Gradle to you, a build system that we think is a quantum leap for build ...
- 计算机网络 Computer Networks 期末复习总提纲
平时不学习,期末火葬场. 一周时间靠王道考研和各路 pdf 自学计网,留下的提纲都在这里了.全是干货.全文 pdf 可以在这里下载:http://cloud.billc.io/s/xNHarppQPG ...
- 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 ...
- Image Segmentation的定义
Definition 图像分割将一张图分为\(n\)个region, 需要满足下面5个条件 每一个像素都要属于一个region 每个region都是连通的 region与region之间没有交集 re ...
- 正则表达式——语法
正则表达式(regular expression)--描述一种字符串匹配模式,可以用来检测一个字符串是否包含特定的子串.用其他字符串将其代替.提取出某个符合要求的子串. 正则表达式 由普通字符 和 ...
- <转载> OpenGL Projection Matrix
原文 OpenGL Projection Matrix Related Topics: OpenGL Transformation Overview Perspective Projection Or ...
随机推荐
- Android 开发技术选型(博客,新闻,阅读类)
前言 最开始学习写应用的时候,发现类聚合数据这个平台可以提供一些免费数据接口,于是写了个人的第一个应用-– JuheNews,当时的知识储备稍显粗糙,虽然现在的知识也不咋滴,但是相对之前而言还是有些进 ...
- iOS限制输入表情(emoji),出现九宫格不能输入的解决方法
在提交数据发送网络请求,由于用户输入了emoji表情,服务端返回系统异常,体验感很差.为了解决服务器不能验证emoji编码的问题,需要在本地进行emoji的输入控制(一般情况应该由服务器在数据库中添加 ...
- python爬虫入门(6)-Scrapy基本使用
源码:链接:http://pan.baidu.com/s/1dEK82hb 密码:9flo 创建项目 scrapy startpro ...
- Cloudify介绍
一篇关于Cloudify的介绍,可以看一下:http://timeson.iteye.com/blog/1699730
- selenium-java,解决一些加了显性等待和隐性等待都不好使的情况,以及给UI自动化加上暂停功能
最近在UI自动化时遇到了,上一步成功操作后没有响应的情况(动画加载和浏览器加载导致实际没有问题),导致下一步无法成功操作,所有想在尝试2次操作后再次进行上一步操作解决这种情况导致的错误(其实是不想每一 ...
- hiho 1515 : 分数调查 简单bfs
时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi的学校总共有N名学生,编号1-N.学校刚刚进行了一场全校的古诗文水平测验. 学校没有公布测验的成绩,所以小Hi只能得 ...
- 如何快速编写和调试 Emit 生成 IL 的代码
.NET Core/.NET Framework 的 System.Reflection.Emit 命名空间为我们提供了动态生成 IL 代码的能力.利用这项能力,我们能够在运行时生成一段代码/一个方法 ...
- KeyDown/PreviewKeyDown事件中监听Alt键按下
一个坑 在WPF应用程序(或者其他Windows应用程序中),为了监听Alt键按下,我们可以尝试写出这样的代码: PreviewKeyDown += (s, e) => { if (e.Key ...
- php 中的 Output Control 函数
先看一个简单的例子 <?php ob_start(); echo 111; ob_clean(); echo 222; ob_start()开启ob缓存,然后111放进了ob缓存, 再调用ob_ ...
- 20165222 实验三 敏捷开发与XP实践
实验内容: 1.XP基础 2.XP核心实践 3.相关工具 二.具体实验内容 (一)代码规范格式化 总结:感觉就那个Code->Reformate Code代码重新格式化最好用,其他的我都点了下, ...