文档介绍:CHAP puter-System Structures计算机系统结构
Applied Operating System Concepts
A Sample puter-System puter System Operation 计算机系统运行
I/O Structure I/O结构
Storage Structure 存储构造
Storage Hierarchy 存储层次
Hardware Protection 硬件保护
General System Architecture 一般系统体系结构
Summary(总结)
Homework作业
内容
Applied Operating System Concepts
#include <>
int main(int argc, char *argv[])
{
puts("hello world");
return 0;
}
操作系统做什么?—一个例子
Applied Operating System Concepts
Process Create 进程创建
用户告诉操作系统执行hello程序
操作系统找到该程序,检查其类型
检查程序首部,找出正文和数据的地址
文件系统找到第一个磁盘块
父进程需要创建一个新的子进程,执行hello程序
操作系统需要将执行文件映射到进程结构
Applied Operating System Concepts
1、操作系统设置CPU上下文环境,并跳到程序开始处
2、程序的第一条指令执行,失败,缺页中断发生
3、操作系统分配一页内存,并将代码读入,继续执行
4、更多的缺页中断,读入更多的页面
5、程序执行系统调用,在文件描述符中写一字符串
6、操作系统检查字符串的位置是否正确
7、操作系统找到字符串被送往的设备
8、设备是一个伪终端,由一个进程控制
Process Running进程执行过程
Applied Operating System Concepts
9、操作系统将字符串送给该进程
10、该进程告诉窗口系统它要显示字符串
11、窗口系统确定这是一个合法的操作,然后将字符串转换成像素
12、窗口系统将像素写入存储映像区
13、视频硬件将像素表示转换成一组模拟信号控制显示器(重画屏幕)
14、显示器发射电子素
15、你在屏幕上看到hello world
Process Running (cont.) 进程执行过程(续)
Applied Operating System Concepts
Computer-System Architecture计算机系统体系结构
Applied Operating System Concepts
Computer-System Operation计算机系统运行
I/O devices and the CPU can execute concurrently.
I/O 设备与CPU可并行运行
Each device controller is in charge of a particular device type. 每一设备控制器负责一个设备类型
Each device controller has a local buffer.
每一设备控制器有一局部缓存
CPU moves data from/to main memory to/from local buffers
CPU 通过局部缓存与主存交换数据
I/O is from the device to local buffer of controller.
I/O从设备到设备控制器的局部缓存
Device controller informs CPU that it has finished its operation by causing an interrupt.
设备控制器通过引起中断通知CPU操作已完成
Applied Operating System Concepts
Common Functions of Interrupts中断的常见功能
Interrupts transfers control to the interrupt service routine generally, through the interrupt vector, which contains the addresses of all the service routines.
通常中断通过中断矢量把控制传送给中断服务程序,该中断矢量包含了所有服务程序的地址
Interrupt architecture must save the address of the interrupted