版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、整理课件13.2nI/O HardwarenApplication I/O InterfacenKernel I/O SubsystemnTransforming I/O Requests to Hardware OperationsnStreamsnPerformance13.3nExplore the structure of an operating systems I/O subsystemnDiscuss the principles of I/O hardware and its complexitynProvide details of the performance aspec
2、ts of I/O hardware and software13.4nIncredible variety of I/O devicesnCommon conceptslPort lBus (daisy chain or shared direct access)lController (host adapter)nI/O instructions control devicesnDevices have addresses, used by lDirect I/O instructionslMemory-mapped I/O13.513.613.7nDetermines state of
3、device lcommand-readylbusylErrornBusy-wait cycle to wait for I/O from device13.8nCPU Interrupt-request line triggered by I/O devicenInterrupt handler receives interruptsnMaskable to ignore or delay some interruptsnInterrupt vector to dispatch interrupt to correct handlerlBased on prioritylSome nonma
4、skablenInterrupt mechanism also used for exceptions13.913.1013.11nUsed to avoid programmed I/O for large data movement nRequires DMA controllernBypasses CPU to transfer data directly between I/O device and memory 13.1213.13nI/O system calls encapsulate device behaviors in generic classesnDevice-driv
5、er layer hides differences among I/O controllers from kernelnDevices vary in many dimensionslCharacter-stream or blocklSequential or random-accesslSharable or dedicatedlSpeed of operationlread-write, read only, or write only13.1413.1513.16nBlock devices include disk driveslCommands include read, wri
6、te, seek lRaw I/O or file-system accesslMemory-mapped file access possiblenCharacter devices include keyboards, mice, serial portslCommands include get, putlLibraries layered on top allow line editing13.17nVarying enough from block and character to have own interfacenUnix and Windows NT/9x/2000 incl
7、ude socket interfacelSeparates network protocol from network operationlIncludes select functionalitynApproaches vary widely (pipes, FIFOs, streams, queues, mailboxes)13.18nProvide current time, elapsed time, timernProgrammable interval timer used for timings, periodic interruptsnioctl (on UNIX) cove
8、rs odd aspects of I/O such as clocks and timers13.19nBlocking - process suspended until I/O completedlEasy to use and understandlInsufficient for some needsnNonblocking - I/O call returns as much as availablelUser interface, data copy (buffered I/O)lImplemented via multi-threadinglReturns quickly wi
9、th count of bytes read or writtennAsynchronous - process runs while I/O executeslDifficult to uselI/O subsystem signals process when I/O completed13.20SynchronousAsynchronous13.21nSchedulinglSome I/O request ordering via per-device queuelSome OSs try fairnessnBuffering - store data in memory while t
10、ransferring between deviceslTo cope with device speed mismatchlTo cope with device transfer size mismatchlTo maintain “copy semantics”13.2213.2313.24nCaching - fast memory holding copy of datalAlways just a copylKey to performancenSpooling - hold output for a devicelIf device can serve only one requ
11、est at a time li.e., PrintingnDevice reservation - provides exclusive access to a devicelSystem calls for allocation and deallocationlWatch out for deadlock13.25nOS can recover from disk read, device unavailable, transient write failuresnMost return an error number or code when I/O request fails nSy
12、stem error logs hold problem reports13.26nUser process may accidentally or purposefully attempt to disrupt normal operation via illegal I/O instructionslAll I/O instructions defined to be privilegedlI/O must be performed via system calls4Memory-mapped and I/O port memory locations must be protected
13、too13.2713.28nKernel keeps state info for I/O components, including open file tables, network connections, character device statenMany, many complex data structures to track buffers, memory allocation, “dirty” blocksnSome use object-oriented methods and message passing to implement I/O13.2913.30nCon
14、sider reading a file from disk for a process: lDetermine device holding file lTranslate name to device representationlPhysically read data from disk into bufferlMake data available to requesting processlReturn control to process13.3113.32nSTREAM a full-duplex communication channel between a user-lev
15、el process and a device in Unix System V and beyondnA STREAM consists of:- STREAM head interfaces with the user process- driver end interfaces with the device- zero or more STREAM modules between them.nEach module contains a read queue and a write queuenMessage passing is used to communicate between queues13.3313.34nI/O a major factor in system performance:lDemands CPU to execute device driver, kernel I/O codelContext switches due to interruptslData copyinglNetwork traff
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026新疆民用建筑设计院有限公司招聘4人考试备考题库及答案解析
- 2026贵州从江县春季招考幼儿园编外专任教师234人考试备考题库及答案解析
- 2026福建三明大田县农业农村局补招聘编外工作人员1人考试备考题库及答案解析
- 2026江西省交院路桥工程有限公司招聘劳务派遣人员2人笔试参考题库及答案解析
- 2026年甘肃省平凉市泾川县窑店中心卫生院招聘乡村医生考试参考题库及答案解析
- 2026山东新岚智慧城市运营科技有限公司招聘2人考试备考题库及答案解析
- 2026广东警官学院招聘事业单位工作人员5人考试参考题库及答案解析
- 2026广东江门市城市发展投资集团有限公司招聘2人考试参考题库及答案解析
- 2026年福建电信校园招聘笔试备考试题及答案解析
- 2026广东汕尾市市直单位第一批公益性岗位招聘10人笔试参考题库及答案解析
- 2026年汽车销售店员工劳动合同三篇
- 5.1 拆盒子 课件 2025-2026学年三年级数学下册北师大版
- 2025急诊科护理指南
- 江苏省安全员c证考试题库及答案
- 四川省算力发展蓝皮书
- 软件供应链安全培训内容课件
- 2025年浙江省杭州市辅警协警笔试笔试真题(含答案)
- 抗菌药物使用分级管理流程操作指南
- 国家安全与保密教育题库及答案解析
- 塑料注塑机基础调试操作培训资料
- 2026年晋中职业技术学院单招职业适应性考试题库必考题
评论
0/150
提交评论