Module12: lO Systems(O系统) lo hardwared(MO硬件) ° Application I/o Interface(应用程序Vo接口) ° Kernel l/o Subsystem(核心O子系统) Transforming l/O Requests to Hardware Operations (转换|O请求为硬件操作) Performance(性能) Applied Operating System Concepts 12.1 Silberschatz, Galvin, and Gagne @1999
12.1 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts Module 12: I/O Systems(I/O系统) • I/O hardwared(I/O硬件) • Application I/O Interface(应用程序I/O接口) • Kernel I/O Subsystem(核心I/O子系统) • Transforming I/O Requests to Hardware Operations (转换I/O请求为硬件操作) • Performance(性能)
yo Hardware(O硬件) ° Incredible variety of l/o devices(难以置信的O设备种类) ° Common concepts(基本概念) Port(端口) Bus(daisy chain or shared direct access) (总线:菊花链或者共享总线) Controller( host adapter)(控制器,主机适配器) ● o instructions control devices(O指令控制设备) ° Devices have addresses, used by(设备的寻址方式) Direct l/o instructions(直接O指令) Memory-mapped l/O(存储器映射Wo指令) Applied Operating System Concepts 122 Silberschatz, Galvin, and Gagne @1999
12.2 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts I/O Hardware(I/O硬件) • Incredible variety of I/O devices(难以置信的I/O设备种类) • Common concepts(基本概念) – Port (端口) – Bus (daisy chain or shared direct access) (总线:菊花链或者共享总线) – Controller (host adapter)(控制器,主机适配器) • I/O instructions control devices(I/O指令控制设备) • Devices have addresses, used by (设备的寻址方式) – Direct I/O instructions(直接I/O指令) – Memory-mapped I/O(存储器映射I/O指令)
Polling(轮询 Determines state of device(决定设备的状态) command- ready(等待命令) BusY(忙) Error(错误) Busy-wait cycle to wait for l/o from device (忙等待循环等待设备的O操作) Applied Operating System Concepts 123 Silberschatz, Galvin, and Gagne @1999
12.3 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts Polling(轮询) • Determines state of device (决定设备的状态) – command-ready(等待命令) – Busy(忙) – Error(错误) • Busy-wait cycle to wait for I/O from device (忙等待循环等待设备的I/O操作)
interrupts(中断) CPU Interrupt request line triggered by l/o device (cPU的中断需要有WO设备的触发) Interrupt handler receives interrupts (中断处理例程接收中断) Maskable to ignore or delay some interrupts (通过屏蔽来忽略或者延迟某些中断) o Interrupt vector to dispatch interrupt to correct handler (中断向量给中断分配正确的中断处理例程) Based on priority(以优先级为基础) Some unmaskable(某些中断不可屏蔽) Interrupt mechanism also used for exceptions (中断机制也用在异常) Applied Operating System Concepts 12.4 Silberschatz, Galvin, and Gagne @1999
12.4 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts Interrupts(中断) • CPU Interrupt request line triggered by I/O device (CPU的中断需要有I/O设备的触发) • Interrupt handler receives interrupts (中断处理例程接收中断) • Maskable to ignore or delay some interrupts (通过屏蔽来忽略或者延迟某些中断) • Interrupt vector to dispatch interrupt to correct handler (中断向量给中断分配正确的中断处理例程) – Based on priority(以优先级为基础) – Some unmaskable(某些中断不可屏蔽) • Interrupt mechanism also used for exceptions (中断机制也用在异常)
nterrupt- drive lO Cycle(中断驱动的Wo循环 1o controller device driver initiates CPU executing hecks for interrupts between instructions input ready, output omplete, or error CPU receiving interrupt. sina transfers control to nterrupt handler interrupt handler processes data. returns from interrupt CPU resumes processing of interrupted task Applied Operating System Concepts 12.5 Silberschatz, Galvin, and Gagne @1999
12.5 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts Interrupt-drive I/O Cycle(中断驱动的I/O循环)