DOC PREVIEW
UMD CMSC 412 - Operating Systems

This preview shows page 1-2-3-4-5-6 out of 19 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

113.1Silberschatz, Galvin and Gagne ©2005Operating System ConceptsCSMC 412CSMC 412Operating SystemsProf. Ashok K Agrawala© 2005 Ashok AgrawalaSet 1313.2Silberschatz, Galvin and Gagne ©2005Operating System ConceptsI/O SystemsI/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations Streams Performance213.3Silberschatz, Galvin and Gagne ©2005Operating System ConceptsObjectivesObjectives Explore the structure of an operating system’s I/O subsystem Discuss the principles of I/O hardware and its complexity Provide details of the performance aspects of I/O hardware and software13.4Silberschatz, Galvin and Gagne ©2005Operating System ConceptsI/O HardwareI/O Hardware Incredible variety of I/O devices Common conceptsz Portz Bus (daisy chain or shared direct access)z Controller (host adapter) I/O instructions control devices Devices have addresses, used by z Direct I/O instructionsz Memory-mapped I/O313.5Silberschatz, Galvin and Gagne ©2005Operating System ConceptsA Typical PC Bus StructureA Typical PC Bus Structure13.6Silberschatz, Galvin and Gagne ©2005Operating System ConceptsDevice I/O Port Locations on PCs (partial)Device I/O Port Locations on PCs (partial)413.7Silberschatz, Galvin and Gagne ©2005Operating System ConceptsPollingPolling Determines state of device z command-readyz busyz Error Busy-wait cycle to wait for I/O from device13.8Silberschatz, Galvin and Gagne ©2005Operating System ConceptsInterruptsInterrupts CPU Interrupt-request line triggered by I/O device Interrupt handler receives interrupts Maskable to ignore or delay some interrupts Interrupt vector to dispatch interrupt to correct handlerz Based on priorityz Some non-maskable Interrupt mechanism also used for exceptions513.9Silberschatz, Galvin and Gagne ©2005Operating System ConceptsInterruptInterrupt--Driven I/O CycleDriven I/O Cycle13.10Silberschatz, Galvin and Gagne ©2005Operating System ConceptsIntel Pentium Processor EventIntel Pentium Processor Event--Vector TableVector Table613.11Silberschatz, Galvin and Gagne ©2005Operating System ConceptsDirect Memory AccessDirect Memory Access Used to avoid programmed I/O for large data movement  Requires DMA controller Bypasses CPU to transfer data directly between I/O device and memory 13.12Silberschatz, Galvin and Gagne ©2005Operating System ConceptsSix Step Process to Perform DMA TransferSix Step Process to Perform DMA Transfer713.13Silberschatz, Galvin and Gagne ©2005Operating System ConceptsApplication I/O InterfaceApplication I/O Interface I/O system calls encapsulate device behaviors in generic classes Device-driver layer hides differences among I/O controllers from kernel Devices vary in many dimensionsz Character-stream or blockz Sequential or random-accessz Sharable or dedicatedz Speed of operationz read-write, read only, or write only13.14Silberschatz, Galvin and Gagne ©2005Operating System ConceptsA Kernel I/O StructureA Kernel I/O Structure813.15Silberschatz, Galvin and Gagne ©2005Operating System ConceptsCharacteristics of I/O DevicesCharacteristics of I/O Devices13.16Silberschatz, Galvin and Gagne ©2005Operating System ConceptsBlock and Character DevicesBlock and Character Devices Block devices include disk drivesz Commands include read, write, seek z Raw I/O or file-system accessz Memory-mapped file access possible Character devices include keyboards, mice, serial portsz Commands include get, putz Libraries layered on top allow line editing913.17Silberschatz, Galvin and Gagne ©2005Operating System ConceptsNetwork DevicesNetwork Devices Varying enough from block and character to have own interface Unix and Windows NT/9x/2000 include socket interfacez Separates network protocol from network operationz Includes select functionality Approaches vary widely (pipes, FIFOs, streams, queues, mailboxes)13.18Silberschatz, Galvin and Gagne ©2005Operating System ConceptsClocks and TimersClocks and Timers Provide current time, elapsed time, timer Programmable interval timer used for timings, periodic interrupts ioctl (on UNIX) covers odd aspects of I/O such as clocks and timers1013.19Silberschatz, Galvin and Gagne ©2005Operating System ConceptsBlocking and Nonblocking I/OBlocking and Nonblocking I/O Blocking - process suspended until I/O completedz Easy to use and understandz Insufficient for some needs Nonblocking - I/O call returns as much as availablez User interface, data copy (buffered I/O)z Implemented via multi-threadingz Returns quickly with count of bytes read or written Asynchronous - process runs while I/O executesz Difficult to usez I/O subsystem signals process when I/O completed13.20Silberschatz, Galvin and Gagne ©2005Operating System ConceptsTwo I/O MethodsTwo I/O MethodsSynchronousAsynchronous1113.21Silberschatz, Galvin and Gagne ©2005Operating System ConceptsKernel I/O SubsystemKernel I/O Subsystem Schedulingz Some I/O request ordering via per-device queuez Some OSs try fairness Buffering - store data in memory while transferring between devicesz To cope with device speed mismatchz To cope with device transfer size mismatchz To maintain “copy semantics”13.22Silberschatz, Galvin and Gagne ©2005Operating System ConceptsDeviceDevice--status Tablestatus Table1213.23Silberschatz, Galvin and Gagne ©2005Operating System ConceptsSun Enterprise 6000 DeviceSun Enterprise 6000 Device--Transfer RatesTransfer Rates13.24Silberschatz, Galvin and Gagne ©2005Operating System ConceptsKernel I/O SubsystemKernel I/O Subsystem Caching - fast memory holding copy of dataz Always just a copyz Key to performance Spooling - hold output for a devicez If device can serve only one request at a time z i.e., Printing Device reservation - provides exclusive access to a devicez System calls for allocation and deallocationz Watch out for deadlock1313.25Silberschatz, Galvin and Gagne ©2005Operating System ConceptsError HandlingError Handling OS can recover from disk read, device unavailable, transient write failures Most return an error number or code when I/O request fails  System error logs hold problem reports13.26Silberschatz, Galvin and Gagne ©2005Operating System ConceptsI/O ProtectionI/O Protection User process may accidentally or purposefully attempt to disruptnormal operation via illegal I/O instructionsz All I/O instructions defined to be


View Full Document

UMD CMSC 412 - Operating Systems

Documents in this Course
Security

Security

65 pages

Deadlocks

Deadlocks

22 pages

Set 2

Set 2

70 pages

Project 2

Project 2

21 pages

Load more
Download Operating Systems
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Operating Systems and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Operating Systems 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?