《操作系统》课程教学资源(PPT课件)第十二章 I/O Systems(I/O系统)

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循环)

Direct Memory Access(直接内存存取) Used to avoid programmed w/o for large data movement (用来避免编程Ⅳo来传输大量的数据) ° Requires DMA controller(需要DMA控制器) Bypasses CPU to transfer data directly between I/O device and memory(绕过cPU来在O设备和内存之间直接传输数据 Applied Operating System Concepts 12 Silberschatz, Galvin, and Gagne @1999
12.6 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts Direct Memory Access(直接内存存取) • Used to avoid programmed I/O for large data movement (用来避免编程I/O来传输大量的数据) • Requires DMA controller(需要DMA控制器) • Bypasses CPU to transfer data directly between I/O device and memory (绕过CPU来在I/O设备和内存之间直接传输数据)

Six step process to perform DMa transfer 道讨六 传输 1. device driver is told to transfer disk data to buffer at address x CPU DMA controller transfers 2 device driver tells disk bytes to buffer X controller to transfer c increasing memory bytes from disk to buffer cache address and decreasing at address x C until C= 0 6. when C=0. DMA interrupts CPU to signal DMA/bus/interrupt -CPU memory bus controller memorybuffer transfer completion PCI bus 3. disk controller initiates DMA transfer iDE disk controller 4. disk controller send each byte to DMA controller Applied Operating System Concepts 12.7 Silberschatz, Galvin, and Gagne @1999
12.7 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts Six step process to perform DMA transfer (通过六步来完成DMA传输)

Application O Interface(应用程序JO接口) 1O system calls encapsulate device behaviors in generic classes (O子系统设备行为精简成几个常用的类别) e Device-driver layer hides differences among lo controllers from kernel(设备驱动层对核心隐藏了ⅣO控制器的不同细节) Devices vary in many dimensions(设备变化范围非常大) Character-stream or block(字符流或者块设备) Sequential or randon- access(顺序或随机设备) Sharable or dedicated(共享或独占设备) Speed of operation(操作速度的不同) read-write, read only, or write only(读写,只读,只写) Applied Operating System Concepts 128 Silberschatz, Galvin, and Gagne @1999
12.8 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts Application I/O Interface(应用程序I/O接口) • I/O system calls encapsulate device behaviors in generic classes (I/O子系统设备行为精简成几个常用的类别) • Device-driver layer hides differences among I/O controllers from kernel(设备驱动层对核心隐藏了I/O控制器的不同细节) • Devices vary in many dimensions(设备变化范围非常大) – Character-stream or block(字符流或者块设备) – Sequential or random-access(顺序或随机设备) – Sharable or dedicated(共享或独占设备) – Speed of operation(操作速度的不同) – read-write, read only, or write only(读写,只读,只写)

Block and character devices(块或字符设备) Block devices include disk drives(块设备包括磁盘) Commands include read. write, seek (命令包括读,写,搜寻) Raw lo or file-system access (原始的O或文件系统存取) Memory-mapped file access possible (存储器映射文件访问的可能性) Character devices include keyboards, mice, serial ports (字符设备包括键盘,鼠标和串口设备) Commands include get,put(命令有 get, put) Libraries layered on top allow line editing (顶层的函数库允许行编辑) Applied Operating System Concepts 12 Silberschatz, Galvin, and Gagne @1999
12.9 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts Block and Character Devices(块或字符设备) • Block devices include disk drives(块设备包括磁盘) – Commands include read, write, seek (命令包括读,写,搜寻) – Raw I/O or file-system access (原始的I/O或文件系统存取) – Memory-mapped file access possible (存储器映射文件访问的可能性) • Character devices include keyboards, mice, serial ports (字符设备包括键盘,鼠标和串口设备) – Commands include get, put(命令有get,put) – Libraries layered on top allow line editing (顶层的函数库允许行编辑)

Network devices(网络设备) Varying enough from block and character to have own interface (从块设备和字符设备变化而来,有独自的接口) Unix and windows/NT include socket interface (Unx和 Windows/nt包括 socket接口) l_ Separates network protocol from network operation (分离网络协议于网络操作) ncludes select functionality(包括 select功能) Approaches vary widely(pipes, FIFOs, streams, queues mailboxes)(方式广泛:管道,FFOs,流,队列,邮箱) Applied Operating System Concepts Silberschatz, Galvin, and Gagne @1999
12.10 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts Network Devices(网络设备) • Varying enough from block and character to have own interface (从块设备和字符设备变化而来,有独自的接口) • Unix and Windows/NT include socket interface (Unix和Windows/NT包括socket接口) – Separates network protocol from network operation (分离网络协议于网络操作) – Includes select functionality(包括select功能) • Approaches vary widely (pipes, FIFOs, streams, queues, mailboxes)(方式广泛:管道,FIFOs,流,队列,邮箱)
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 《操作系统》课程教学资源(PPT课件)第十九章 Security(安全).ppt
- 《操作系统》课程教学资源(PPT课件)第十三章 Secondary-Storage 二级存储.ppt
- 《操作系统》课程教学资源(PPT课件)第十一章 File-System Interface(文件系统接口).ppt
- 《操作系统》课程教学资源(PPT课件)第六章 CPU Scheduling.ppt
- 《操作系统》课程教学资源(PPT课件)第八章 Deadlocks(死锁).ppt
- 《操作系统》课程教学资源(PPT课件)第五章 Threads线程.ppt
- 《操作系统》课程教学资源(PPT课件)第二章 Computer-System Structures 计算机系统结构.ppt
- 《操作系统》课程教学资源(PPT课件)第九章 Memory Management.ppt
- 《操作系统》课程教学资源(PPT课件)第三章 Operating-System Structures 操作系统结构.ppt
- 《操作系统》课程教学资源(PPT课件)第七章 Process Synchronization.ppt
- 《操作系统》课程教学资源(PPT课件)第一章 Introduction 引论.ppt
- 《操作系统》课程教学资源(PPT课件)Applied Operating System Concepts(AOSC)介绍.ppt
- 国防科技大学:《复杂网络可靠性研究》 概述讲解.ppt
- 《数字图像处理》课程教学资源(PPT课件讲稿)第九章 图象分析(数学形态学图像处理、遥感信息处理).ppt
- 《数字图像处理》课程教学资源(PPT课件讲稿)第九章 图象分析(分割、描绘).ppt
- 《数字图像处理》课程教学资源(PPT课件讲稿)第八章 三维图像处理技术.ppt
- 《数字图像处理》课程教学资源(PPT课件讲稿)预测编码、变换编码、静态图象的一些主要数据文件压缩方式、图象编码的国际标准.ppt
- 《数字图象处理》 第七章(7-5) 算术编码.ppt
- 《数字图象处理》 第七章(7-4) 统计编码.ppt
- 《数字图象处理》 第七章 图象编码.ppt
- 《操作系统》课程教学资源(PPT课件)第十八章 Protection(保护).ppt
- 《操作系统》课程教学资源(PPT课件)第十章 Virtual Memory.ppt
- 《操作系统》课程教学资源(PPT课件)第四章 Processes 进程.ppt
- 《实用网络技术》 第四章(4-1) 网络技术基础.ppt
- 《实用网络技术》 第四章(4-2) 同轴电缆.ppt
- 《实用网络技术》 第四章(4-3) 地球同步卫星.ppt
- 《实用网络技术》 第四章(4-4).ppt
- 北京语言文化大学:《C语言程序设计导论》课程教学资源(PPT课件)内容导航(崔雅娟).ppt
- 北京语言文化大学:《C语言程序设计导论》课程教学资源(PPT课件)第一章 程序设计概述.ppt
- 北京语言文化大学:《C语言程序设计导论》课程教学资源(PPT课件)第七章 指针.ppt
- 北京语言文化大学:《C语言程序设计导论》课程教学资源(PPT课件)第三章 语句及控制结构.ppt
- 北京语言文化大学:《C语言程序设计导论》课程教学资源(PPT课件)第九章 文件.ppt
- 北京语言文化大学:《C语言程序设计导论》课程教学资源(PPT课件)第二章 数据类型、运算符与表达式.ppt
- 北京语言文化大学:《C语言程序设计导论》课程教学资源(PPT课件)第五章 预处理命令.ppt
- 北京语言文化大学:《C语言程序设计导论》课程教学资源(PPT课件)第八章 结构及其它.ppt
- 北京语言文化大学:《C语言程序设计导论》课程教学资源(PPT课件)第六章 数组.ppt
- 京语言文化大学:《C语言程序设计导论》 第四章 函数和程序结构.ppt
- 浙江大学计算机学院:《C语言程序设计》 第一章 用C语言编写程序.ppt
- 浙江大学计算机学院:《C语言程序设计》 第十二章 文件.ppt
- 浙江大学计算机学院:《C语言程序设计》 第二章 基本数据类型和表达式.ppt