operating system操作系统ch13io systems38_第1页
operating system操作系统ch13io systems38_第2页
operating system操作系统ch13io systems38_第3页
operating system操作系统ch13io systems38_第4页
operating system操作系统ch13io systems38_第5页
已阅读5页,还剩33页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

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 aspects o

2、f 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 devi

3、ce 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 nonmaskab

4、leninterrupt 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-driver l

5、ayer 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, write,

6、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 include

7、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) covers o

8、dd 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 with c

9、ount 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 trans

10、ferring 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 request

11、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 nsystem

12、 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 too1

13、3.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.30nconside

14、r 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-level p

15、rocess 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 tr

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论