operating system《操作系統(tǒng)》ch13-io system_第1頁(yè)
operating system《操作系統(tǒng)》ch13-io system_第2頁(yè)
operating system《操作系統(tǒng)》ch13-io system_第3頁(yè)
operating system《操作系統(tǒng)》ch13-io system_第4頁(yè)
operating system《操作系統(tǒng)》ch13-io system_第5頁(yè)
已閱讀5頁(yè),還剩33頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

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. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論