【OS】初识操作系统
啊事情是这样的……楼主最近写iOS程序,以及之前写树莓派都用到了MultiThread Programming,然而楼主知道了怎么用,但是貌似又有点不知其所以然。
于是特地去搜了门OS的课程来了解一下MultiThreading到底是怎么一回事。
啊这门课叫做Advanced OS,在Udacity上可以搜到。
--------------------------------------------------------------------------------------------------------------------------------------------------
下面是楼主Lecture 1的笔记:
L01a. Principle of Abstraction
Abstraction - an interface that allows us to hide all the details.
在计算机系统中,在最底层的电子和Google Earth App之间所用到的Abstraction有哪些呢?
Transistors(晶体管)-> Logic Gates -> seq + comb. logic elements -> Machine Organization(datapath + control) -> Instruction Set Architecture -> System software(OS, computers, etc.) -> Applications
L01b. Hardware Resources
手机笔记本台式机服务器云用的计算机系统之间的差别很大吗?不!
CPU通过Bus总线和外接控制器及Memory(内存)进行通信。
DMA - Direct Memory Access跑得比较快,如上图的Memory和Network之间。
有DMA device,还有slow-speed device(如microphone)。
System Bus上有CPU,Memory,frame buffer(这个是用来刷新屏幕的貌似),跑得比I/O Bus要快。
I/O Bus上有各类控制器,比如鼠标键盘网络啥的,跑得相对慢一丢丢。
System Bus和I/O Bus之间通过Bridge可以传输数据。
L01c. OS Functionality
https://mc.dfrobot.com.cn/forum.php?mod=image&aid=33952&size=300x300&key=b398da1ef2b32e6b&nocache=yes&type=fixnone
OS可以用来当资源管理器,和计算机硬件交互,管理CPU上的运行程序。
一个问题:点击鼠标的下一刻发生了啥?
答案:CPU Interrupt
点击鼠标的那一刻,在Bus总线上停留着CPU Interrupt,然后OS检测到之后留待Program来处理该Interrupt。
mouse clicked -> Interrupt line on the bus -> Interrupt to the CPU -> OS fields it -> passes it to the program for action.
L01d. Managing the CPU and Memory
https://mc.dfrobot.com.cn/forum.php?mod=image&aid=33948&size=300x300&key=b550e3e8a4b59b51&nocache=yes&type=fixnone
珍贵的CPU和Memory。
一个App刚运行的时候,用了一堆的Memory,在运行的时候,还会继续用其他的资源。
https://mc.dfrobot.com.cn/forum.php?mod=image&aid=33949&size=300x300&key=9be0c0fb602bd332&nocache=yes&type=fixnone
Process(进程) = Program + State
对Process的更细的定义:
Process = Program + state of all threads executing in the program
好吧刷了楼主两个多小时,终于把Lecture 1的内容给刷完啦~
楼主保守估计了一下,这门课程总共有11个Lecture,大概需要22个小时,楼主想了想,两天就可以刷完了呢~
{:5_180:}
沙了个发~ 板了个凳~~ 地了个板~~~ 板了个凳0 0! MakerFaire北京 发表于 2017-3-22 16:24
板了个凳0 0!
{:5_160:}
页:
[1]