DOC PREVIEW
Pitt CS 1550 - INPUT OUTPUT SYSTEMS

This preview shows page 1-2-3-4-29-30-31-32-33-60-61-62-63 out of 63 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 63 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 63 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 63 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 63 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 63 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 63 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 63 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 63 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 63 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 63 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 63 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 63 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 63 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 63 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Chapter 5: I/O SystemsInput/OutputHow fast is I/O hardware?Device controllersMemory-Mapped I/OHow is memory-mapped I/O done?Direct Memory Access (DMA) operationHardware’s view of interruptsI/O software: goalsProgrammed I/O: printing a pageCode for programmed I/OInterrupt-driven I/OI/O using DMALayers of I/O softwareInterrupt handlersWhat happens on an interruptDevice driversDevice-independent I/O softwareWhy a standard driver interface?Buffering device inputAnatomy of an I/O requestDisk drive structureDisk drive specificsDisk “zones”Disk “addressing”Building a better “disk”RAIDs, RAIDs, and more RAIDsCD-ROM recordingStructure of a disk sectorSector layout on diskSector interleavingWhat’s in a disk request?Disk request schedulingDisk scheduling algorithmsFirst-Come-First Served (FCFS)Shortest Seek Time First (SSTF)SCAN (elevator algorithm)C-SCANC-LOOKHow to pick a disk scheduling algorithmWhen good disks go bad…Clock hardwareMaintaining time of dayDoing multiple timers with a single clockSoft timersCharacter-oriented terminalsBuffering for inputSpecial terminal charactersSpecial output charactersMemory-mapped displayHow characters are displayedInput softwareOutput software for WindowsSkeleton of a Windows programSkeleton of a Windows program (cont’d)Character outlines at different point sizesX WindowsArchitecture of the SLIM terminal systemThe SLIM Network TerminalPower Management (1)Power management (2)Power Management (3)Power Management (4)Chapter 5: I/O SystemsChapter 52CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)Input/OutputPrinciples of I/O hardwarePrinciples of I/O softwareI/O software layersDisksClocksCharacter-oriented terminalsGraphical user interfacesNetwork terminalsPower managementChapter 53CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)How fast is I/O hardware?Device Data rateKeyboard 10 bytes/secMouse 100 bytes/sec56K modem 7 KB/secPrinter / scanner 200 KB/secUSB 1.5 MB/secDigital camcorder 4 MB/secFast Ethernet 12.5 MB/secHard drive 20 MB/secFireWire (IEEE 1394) 50 MB/secXGA monitor 60 MB/secPCI bus 500 MB/secChapter 54CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)Device controllersI/O devices have componentsMechanical component Electronic componentElectronic component controls the deviceMay be able to handle multiple devicesMay be more than one controller per mechanical component (example: hard drive)Controller's tasksConvert serial bit stream to block of bytesPerform error correction as necessaryMake available to main memoryChapter 55CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)Memory-Mapped I/OSeparateI/O & memoryspace0xFFF…0MemoryI/O portsMemory-mapped I/O Hybrid: bothmemory-mapped &separate spacesChapter 56CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)How is memory-mapped I/O done?Single-busAll memory accesses go over a shared busI/O and RAM accesses compete for bandwidthDual-busRAM access over high-speed busI/O access over lower-speed busLess competitionMore hardware (more expensive…)CPU Memory I/OCPU Memory I/OThis port allows I/O devicesaccess into memoryChapter 57CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)Direct Memory Access (DMA) operationChapter 58CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)Hardware’s view of interruptsBusChapter 59CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)I/O software: goalsDevice independencePrograms can access any I/O device No need to specify device in advance Uniform namingName of a file or device is a string or an integerDoesn’t depend on the machine (underlying hardware)Error handlingDone as close to the hardware as possibleIsolate higher-level softwareSynchronous vs. asynchronous transfersBlocked transfers vs. interrupt-drivenBufferingData coming off a device cannot be stored in final destinationSharable vs. dedicated devicesChapter 510CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)Programmed I/O: printing a pagePrintedpageABCDEFGHKernel UserAPrintedpageABCDEFGHABCDEFGHABPrintedpageABCDEFGHABCDEFGHChapter 511CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)Code for programmed I/Ocopy_from_user (buffer, p, count); // copy into kernel bufferfor (j = 0; j < count; j++) { // loop for each char while (*printer_status_reg != READY) ; // wait for printer to be ready *printer_data_reg = p[j]; // output a single character}return_to_user();Chapter 512CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)Interrupt-driven I/Ocopy_from_user (buffer, p, count);j = 0;enable_interrupts();while (*printer_status_reg != READY) ;*printer_data_reg = p[0];scheduler(); // and block userif (count == 0) { unblock_user();} else { *printer_data_reg = p[j]; count--; j++;}acknowledge_interrupt();return_from_interrupt();Code run by system callCode run at interrupt timeChapter 513CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)I/O using DMAcopy_from_user (buffer, p, count);set_up_DMA_controller();scheduler(); // and block useracknowledge_interrupt();unblock_user();return_from_interrupt();Code run by system callCode run at interrupt timeChapter 514CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)Layers of I/O softwareUser-level I/O software & librariesDevice-independent OS softwareDevice driversInterrupt handlersHardwareOperatingsystem(kernel)UserChapter 515CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)Interrupt handlersInterrupt handlers are best hiddenDriver starts an I/O operation and blocksInterrupt notifies of completionInterrupt procedure does its taskThen unblocks driver that started itPerform minimal actions at interrupt timeSome of the functionality can be done by the driver after it is unblockedInterrupt handler mustSave regs not already saved by interrupt hardwareSet up context for interrupt service procedureDLXOS: intrhandler (in dlxos.s)Chapter 516CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)What happens on an interruptSet up stack for interrupt


View Full Document

Pitt CS 1550 - INPUT OUTPUT SYSTEMS

Download INPUT OUTPUT 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 INPUT OUTPUT 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 INPUT OUTPUT 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?