Module 2: Computer-System Structures 计算机系统结构 Computer System Operation 计算机系统运行 ●| o Structure O结构 Storage Structure 存储构造 Storage Hierarchy 存储层次 Hardware Protection 硬件保护 General System Architecture 般系统体系结构 Applied Operating System Concepts 2.1
Applied Operating System Concepts 2.1 Module 2: Computer-System Structures 计算机系统结构 • Computer System Operation 计算机系统运行 • I/O Structure I/O结构 • Storage Structure 存储构造 • Storage Hierarchy 存储层次 • Hardware Protection 硬件保护 • General System Architecture 一般系统体系结构
Computer-System Architecture 计算机系统体系结构 dek pinter tape drives dsk pinter mpe-drhre CPU controler contoller controler m ble memary cona dler memory Applied Operating System Concepts 2.2
Applied Operating System Concepts 2.2 Computer-System Architecture 计算机系统体系结构
Computer-System Operation 计算机系统运行 w/o devices and the CPU can execute concurrently. 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通过局部缓存与主存交换数据 o is from the device to local buffer of controller O从设备到设备控制器的局部缓存 Device controller informs cpu that it has finished its operation by causing an interrupt. 设备控制器通过引起中断通知cPU操作已完成 Applied Operating System Concepts 2.3
Applied Operating System Concepts 2.3 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操作已完成
Common Functions of Interrupts 中断的常见功能 Interrupts transfers control to the interrupt service routine generall through the interrupt vector, which contains the addresses of all the service routines 通常中断通过中断矢量把控制传送给中断服务程序,该中断矢量包含了所有 服务程序的地址 Interrupt architecture must save the address of the interrupted instruction.中断体系结构必须保护被中断指令的地址 Incoming interrupts are disabled while another interrupt is being processed to prevent a lost interrupt 当另一个中断正在处理时,刚进入的中断不能作用,以免丢失中断 e A trap is a software-generated interrupt caused either by an error or a user request陷阱是由于出错或用户请求引起的软件生成的中断 An operating system is interrupt driven 操作系统是中断驱动的 Applied Operating System Concepts 2.4
Applied Operating System Concepts 2.4 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 instruction. 中断体系结构必须保护被中断指令的地址 • Incoming interrupts are disabled while another interrupt is being processed to prevent a lost interrupt. 当另一个中断正在处理时,刚进入的中断不能作用,以免丢失中断 • A trap is a software-generated interrupt caused either by an error or a user request.陷阱是由于出错或用户请求引起的软件生成的中断 • An operating system is interrupt driven. 操作系统是中断驱动的
Interrupt Handling 中断处理 The operating system preserves the state of the CPU by storing registers and the program counter. 操作系统通过存储寄存器和程序计数器而保留了cPU的状态 Determines which type of interrupt has occurred 确定哪一种中断发生了: polling轮询 vectored interrupt system矢量化中断系统 Separate segments of code determine what action should be H taken for each type of interrupt 对每一类中断分离代码段,以确定应该采取什么反应 Applied Operating System Concepts 2.5
Applied Operating System Concepts 2.5 Interrupt Handling 中断处理 • The operating system preserves the state of the CPU by storing registers and the program counter. 操作系统通过存储寄存器和程序计数器而保留了CPU的状态 • Determines which type of interrupt has occurred: 确定哪一种中断发生了: – polling 轮询 – vectored interrupt system 矢量化中断系统 • Separate segments of code determine what action should be taken for each type of interrupt 对每一类中断分离代码段,以确定应该采取什么反应