Section 13: I/O Frameworks - 6 th ed.

Uploaded on:
Category: Art / Culture
Working System Concepts. I/O Hardware. Mind blowing assortment of I/O devicesCommon conceptsPort - essential interface to CPU - status, control, dataBus (daisy chain or shared direct get to) - fundamental and specific neighborhood (ex: PCI for principle and SCSI for circles) Controller (host connector) - HW interface in the middle of Device and Bus - a connector card or mother board module Controller has unique purposes registers (c
Slide 1

Part 13: I/O Systems - 6 th ed I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations Streams Performance Review Chapters 2 and 3, and teachers notes on: "Interfere with plans and DMA" This section gives more center to these parts and points. Educator\'s comments in blue Updated 12/5/03 Operating System Concepts

Slide 2

I/O Hardware Incredible assortment of I/O gadgets Common ideas Port - essential interface to CPU - status, control, information Bus (daisy chain or shared direct get to) - primary and particular neighborhood (ex: PCI for principle and SCSI for plates) Controller (host connector) - HW interface amongst Device and Bus - a connector card or mother board module Controller has uncommon purposes registers (orders, and so forth.) which when kept in touch with causes moves to make place - might be memory mapped I/O guidelines control gadgets - ex: in, out for Intel Devices have addresses, utilized by Direct I/O guidelines - utilizes I/O directions Memory-mapped I/O - utilizes memory guidelines Operating System Concepts

Slide 3

A Typical PC Bus Structure Operating System Concepts

Slide 4

Device I/O Port Locations on PCs (halfway) Various reaches for a gadget incorporates both control and information ports Operating System Concepts

Slide 5

Polling Handshaking Determines condition of gadget summon prepared occupied Error Busy-sit tight cycle to sit tight for I/O from gadget When not occupied - set information in information port, set charge in control port and let \'er tear Not alluring if over the top - since it is a bustling hold up which ties up CPU & meddles with gainful work Remember CS220 LABs Operating System Concepts

Slide 6

Interrupts CPU Interrupt ask for line (IRQ) activated by I/O gadget Interrupt handler gets intrudes on Maskable to overlook or postpone a few interferes with Interrupt vector to dispatch hinder to right handler Based on need Some unmaskable Interrupt component additionally utilized for special cases Application can leave after I/O ask for, yet is til in charge of exchanging information to memory when it gets to be accessible from the gadget. Can have "settled" interferes (with Priorities) See Instructors notes: "Utilization of Interrupts and DMA" Soft hinders or "traps" produced from OS in framework calls. Working System Concepts

Slide 7

Interrupt-Driven I/O Cycle Go away & accomplish Something else ==> Operating System Concepts

Slide 8

Intel Pentium Processor Event-Vector Table Interrupts 0-31 are non-maskable - can\'t be impaired Operating System Concepts

Slide 9

Direct Memory Access With immaculate intrude on plan, CPU was still in charge of exchanging information from controller to memory (on interfere) when gadget distraught it accessible. Presently DMA will do this - all CPU needs to do is set up DMA and client the information when the DMA-complete hinder arrives. … Interrupts still utilized - however just to flag DMA Complete. Used to maintain a strategic distance from customized I/O for vast information development Requires DMA controller Bypasses CPU to exchange information specifically between I/O gadget and memory Cycle taking: impedance with CPU memory directions amid DMA exchange. - DMA takes need - CPU stops on memory some portion of word. Working System Concepts

Slide 10

Six Step Process to Perform DMA Transfer Operating System Concepts

Slide 11

Application I/O Interface The OS programming interface to the I/O gadgets (an API to the developer) Attempts to digest the qualities of the numerous I/o gadgets into a couple general classes. I/O "framework calls" exemplify gadget practices in bland classes Device-driver layer shrouds contrasts among I/O controllers from bit Devices fluctuate in numerous measurements Character-stream or square units for information exchange bytes versus pieces Sequential or arbitrary access - access strategies Synchronous (unsurprising reaction times) versus nonconcurrent (flighty reaction times) Sharable or devoted - suggestions on stop Speed of operation - gadget/programming issue read-compose, read just, or compose just - authorizations Operating System Concepts

Slide 12

A Kernel I/O Structure System calls ==> … "client" API ==> Example: ioctl(… ) nonexclusive call (roll your own) in UNIX (p. 468), and other more particular charges or calls open, read, ... Fig. 13.6 Operating System Concepts

Slide 13

Characteristics of I/O Devices Device driver must manage these at a low level Use of I/O buffering Operating System Concepts

Slide 14

Block and Character Devices Block gadgets incorporate circle drives case areas or division groups on a plate Commands/calls incorporate read, compose, look for Access is commonly through a document framework interface Raw I/O or record framework access - "twofold xfr" of record information - elucidation is in application (identity of document lost) Memory-mapped (to VM) document access conceivable - use memory directions instead of I/O guidelines - exceptionally productive (ex: swap space for plate). Gadget driver xfr\'s squares at once - as in paging DMA exchange is piece situated Character gadgets incorporate consoles, mice, serial ports Device driver xfr\'s byte at once Commands incorporate get, put - character at once Libraries layered on top permit line altering - ex: console info could be bulked up to utilize a line at once (buffering) Block & character gadgets additionally decide the two general gadget driver catagories Operating System Concepts

Slide 15

Network Devices sufficiently varying from piece and character to have own interface - OS makes system gadget interface unmistakable from plate interface - because of huge contrasts between the two Unix and Windows NT/9 i/2000 incorporate attachment interface Separates system convention from system operation Encapsulates subtle elements of different system gadgets for application … comparable to a record and the circle??? Incorporates select usefulness - used to oversee and get to attachments - returns information on bundles holding up or capacity to acknowledge parcels - abstains from surveying Approaches differ generally (pipes, FIFOs, streams, lines, letter drops) … you saw some of these! Working System Concepts

Slide 16

Clocks and Timers Provide flow time, slipped by time, clock If programmable, interim time utilized for timings, occasional hinders ioctl (on UNIX) covers odd parts of I/O, for example, timekeepers and clocks - an indirect access for gadget driver authors (roll your own). Could actualize "mystery" calls which may not be recorded in a clients or programming manual Operating System Concepts

Slide 17

Blocking and Nonblocking I/O Blocking - process (making the solicitation squares - gives different procedure a chance to execute) suspended until I/O finished Easy to utilize and comprehend Insufficient for a few needs multi-threading - relies on upon part of OS in string administration Nonblocking - I/O call returns as much as accessible User interface, information duplicate (supported I/O) Implemented by means of multi-threading Returns rapidly with tally of bytes read or composed - ex: read a "little" divide of a document rapidly, utilize it, and do a reversal for additional, ex: showing video "ceaselessly from a plate" Asynchronous - process (making the asynch demand) runs while I/O executes Difficult to utilize - would it be able to proceed without the consequences of the I/O? I/O subsystem signals process when I/O finished - by means of interfere with (delicate), or setting of shared variable which is occasionally tasted. Working System Concepts

Slide 18

Kernel I/O Subsystem See A Kernel I/O Structure slide - Fig 13.6 Scheduling Some I/O ask for requesting by means of per-gadget line Some OSs attempt decency Buffering - store information in memory while exchanging between gadgets To adapt to gadget speed jumble - de-couples application from gadget activity To adapt to gadget exchange size bungle To keep up "duplicate semantics" - ensure that the variant of information kept in touch with gadget from a cradle is indistinguishable to what was there at the season of the "compose call" - regardless of the possibility that on return of the framework call, the client alters cushion - OS duplicates information to piece support before returning control to client. Twofold or "ping-pong" cushions - write in one and read from another - decouples gadgets and applications … thought can be reached out to different cradles gets to in a round manner Operating System Concepts

Slide 19

Sun Enterprise 6000 Device-Transfer Rates Operating System Concepts

Slide 20

Kernel I/O Subsystem - (kept) Caching - quick memory holding duplicate of information Always only a duplicate Key to execution How can this vary from a support? Spooling - a cushion hold ing yield/(input as well) for a gadget If gadget can serve one and only demand at once Avoids lining applications making demands. Information from an application is spared in a one of a kind record connected with the application AND the specific solicitation. Could be spared in records on a circle, or in memory. Case: Printing Device reservation - gives select access to a gadget System calls for distribution and deallocation Watch out for gridlock - why? Working System Concepts

Slide 21

Error Handling OS can recuperate from circle read, gadget distracted, transient compose disappointments Most give back a blunder number or code when I/O ask for falls flat System mistake logs hold issue reports CRC checks - particularly over system exchanges of a considerable measure of information, for instance video continuously. Working System Concepts

Slide 22

Kernel Data Structures Kernel keeps state information for I/O segments, including open record tables , system associations, character gadget state utilized by gadget drivers as a part of controlling gadgets and information exchange, and in for mistake recuperation information that has pictures on the circle must be kept in sync with plate duplicate. Numerous, numerous unpredictable information structures to track cradles, memory allotment, "filthy" obstructs Some utilization object-situated techniques and message going to actualize I/O Make information structures object arranged classes to embody the low level nature of the "gadget" - UNIX gives a consistent interface, for example, this. Operatin

View more...