Computer Systems A Programmer’s Perspective (深入理解计算机系统 第一章)

许久之前的读书笔记,搬到博客上来

在wordpress里有同步


Chapter one _Reading Notes

Preparatory

  • cygwin64
  • K&R recommended book!
  • source code Download : src code

A tour of computer system.

HelloWorld 解析

Compilation System

Preprocessor Compiler Assembler Linker
hello.ch hello.i hello.s hello.o hello.exe
GNU = EMACS + GCC + GDB + ASSEMBLER + LINKER + OTHER TOOLS;

SOURCE FILE – DATA

系统中的所有信息,包括磁盘文件、存储器中的程序、存储器中存放的用户数据以及网络传送的数据,都是由一串位表示的。区分不同数据对象的唯一方法是我们读到数据的上下文。

OBJECT FILE – BINARY FILE

computer hardware

BUS (总线)

总线是 贯穿整个系统的一组电子管道。目前大多计算机字长为4个字节(*32Bit*) , 即 字长 为了方便讨论,我们假设字长为4个字节,并且总线每次只传送一个字(word)。

I/O EQUIPMENT

MAIN MEMORY ( 主存储器 )

临时存储设备,在处理器执行程序时,用来存放程序与程序处理的数据。

  • 主存是由一组动态随机存取存储器 DRAM 芯片组成的。 物理上
  • 主存是一个线性的字节数组。 逻辑上

CPU
  • CPU的核心是一个字长的寄存器,称为PC 程序计数器。

    在任何时刻,PC都指向主存中某条机器语言指令,即含有该条指令的地址。CPU从通电开始,不断执行PC程序计数器指向的指令,再更新PC程序计数器,使其指向下一条指令,如此…

  • 简单举例 :cpu’s operation
    • 加载
    • 存储
    • 操作
    • 跳转

    Notice : DMA => 直接存储器读取,数据可以不通过处理器而直接从磁盘到达主存。

CACHE ( 高速缓存 )
  • SRAM 静态随机访问存储器
  • 三级告诉缓存 L1,L2, L3 .
OPERATE SYSTEM
  • Process (进程)

    进程是操作系统对一个正在运行的程序的一种抽象。进程的概念使得正在运行的程序的代码和数据好像是系统存储器中唯一的对象。

  • Process context switch 上下文切换
  • Thread (线程)

    每个线程都运行在进程的上下文中,并共享同样的代码和全局数据。

  • Virtual Memory (虚拟存储器)

    又是一个假象: 它为每个进程提供一种假象,即每个进程都在独占主存。每个进程看到的是一致的存储器,称为虚拟地址空间。自下而上:

    • 程序代码和数据: 对于所有进程来说,代码是从同一固定地址开始的,然后是初始化数据区和非初始化数据区。
    • heap运行时堆 :
    • 共享库 : 动态链接
    • 栈区 stack : 栈帧
    • 内核虚拟存储区
FILE

CONCURRENCY (并发)

ABSTRACT

abstract for computer

  • 文件 是对I/O的抽象;
  • 虚拟存储器是对程序存储器的抽象;
  • 进程是对一个正在运行的程序的抽象;
  • 虚拟机是对整个计算机(操作系统,处理器和程序)的抽象。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
经典计算机操作系统教材第三版,详细内容可见亚马逊。 https://www.amazon.com/Computer-Systems-Programmers-Perspective-Engineering/dp/0134123832/ref=sr_1_2?ie=UTF8&qid=1541476471&sr=8-2&keywords=computer+systems+a+programmer's+perspective Computer systems: A Programmer’s Perspective explains the underlying elements common among all computer systems and how they affect general application performance. Written from the programmer’s perspective, this book strives to teach readers how understanding basic elements of computer systems and executing real practice can lead them to create better programs. Spanning across computer science themes such as hardware architecture, the operating system, and systems software, the Third Edition serves as a comprehensive introduction to programming. This book strives to create programmers who understand all elements of computer systems and will be able to engage in any application of the field--from fixing faulty software, to writing more capable programs, to avoiding common flaws. It lays the groundwork for readers to delve into more intensive topics such as computer architecture, embedded systems, and cyber security. This book focuses on systems that execute an x86-64 machine code, and recommends that programmers have access to a Linux system for this course. Programmers should have basic familiarity with C or C++. Personalize Learning with MasteringEngineering MasteringEngineering is an online homework, tutorial, and assessment system, designed to improve results through personalized learning. This innovative online program emulates the instructor’s office hour environment, engaging and guiding students through engineering concepts with self-paced individualized coaching With a wide range of activities available, students can actively learn, understand, and retain even the most difficult concepts.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值