Unformatted text preview:

Input/OutputPrinciples of I/O HardwareDevice ControllersMemory-Mapped I/O (1)Memory-Mapped I/O (2)Direct Memory Access (DMA)Interrupts RevisitedPrinciples of I/O SoftwareGoals of I/O Software (1)Goals of I/O Software (2)Programmed I/O (1)Programmed I/O (2)Interrupt-Driven I/OI/O Using DMAI/O Software LayersInterrupt Handlers (1)Interrupt Handlers (2)Device DriversDevice-Independent I/O Software (1)Device-Independent I/O Software (2)Device-Independent I/O Software (3)Device-Independent I/O Software (4)User-Space I/O SoftwareDisksDisk Hardware (1)Disk Hardware (2)Disk Hardware (3)Disk Hardware (4)Disk Hardware (5)Disk Hardware (6)Disk Hardware (7)Disk Hardware (8)Disk Formatting (1)Disk Formatting (2)Disk Formatting (3)Disk Arm Scheduling Algorithms (1)Disk Arm Scheduling Algorithms (2)Disk Arm Scheduling Algorithms (3)Error HandlingStable StorageClocksClock HardwareClock Software (1)Clock Software (2)Soft TimersCharacter Oriented TerminalsRS-232 Terminal HardwareInput Software (1)Input Software (2)Output SoftwareDisplay Hardware (1)Display Hardware (2)Input SoftwareOutput Software for Windows (1)Output Software for Windows (2)Output Software for Windows (3)Output Software for Windows (4)Output Software for Windows (5)Output Software for Windows (6)Network TerminalsX Windows (1)X Windows (2)The SLIM Network Terminal (1)The SLIM Network Terminal (2)Power Management (1)Power management (2)Power Management (3)Power Management (4)1Chapter 5Input/Output5.1 Principles of I/O hardware5.2 Principles of I/O software5.3 I/O software layers5.4 Disks5.5 Clocks5.6 Character-oriented terminals5.7 Graphical user interfaces5.8 Network terminals5.9 Power management2Principles of I/O HardwareSome typical device, network, and data base rates3Device Controllers• I/O devices have components:– mechanical component – electronic component• The electronic component is the device controller– may be able to handle multiple devices• Controller's tasks– convert serial bit stream to block of bytes– perform error correction as necessary– make available to main memory4Memory-Mapped I/O (1)• Separate I/O and memory space• Memory-mapped I/O• Hybrid5Memory-Mapped I/O (2)(a) A single-bus architecture(b) A dual-bus memory architecture6Direct Memory Access (DMA)Operation of a DMA transfer7Interrupts RevisitedHow interrupts happens. Connections between devices and interrupt controller actually use interrupt lines on the bus rather than dedicated wires8Principles of I/O SoftwareGoals of I/O Software (1)• Device independence– programs can access any I/O device – without specifying device in advance · (floppy, hard drive, or CD-ROM)• Uniform naming– name of a file or device a string or an integer– not depending on which machine• Error handling– handle as close to the hardware as possible9Goals of I/O Software (2)• Synchronous vs. asynchronous transfers– blocked transfers vs. interrupt-driven• Buffering– data coming off a device cannot be stored in final destination• Sharable vs. dedicated devices– disks are sharable– tape drives would not be10Programmed I/O (1)Steps in printing a string11Programmed I/O (2)Writing a string to the printer using programmed I/O12Interrupt-Driven I/O• Writing a string to the printer using interrupt-driven I/O– Code executed when print system call is made– Interrupt service procedure13I/O Using DMA• Printing a string using DMA– code executed when the print system call is made– interrupt service procedure14I/O Software LayersLayers of the I/O Software System15Interrupt Handlers (1)• Interrupt handlers are best hidden– have driver starting an I/O operation block until interrupt notifies of completion• Interrupt procedure does its task– then unblocks driver that started it• Steps must be performed in software after interrupt completed1. Save regs not already saved by interrupt hardware2. Set up context for interrupt service procedure16Interrupt Handlers (2)3. Set up stack for interrupt service procedure4. Ack interrupt controller, reenable interrupts5. Copy registers from where saved6. Run service procedure 7. Set up MMU context for process to run next8. Load new process' registers9. Start running the new process17Device Drivers• Logical position of device drivers is shown here• Communications between drivers and device controllers goes over the bus18Device-Independent I/O Software (1)Providing a deice-independent block sizeAllocating and releasing dedicate devicesError reportingBufferingUniform interfacing for device driversFunctions of the device-independent I/O software19Device-Independent I/O Software (2)(a) Without a standard driver interface(b) With a standard driver interface20Device-Independent I/O Software (3)(a) Unbuffered input(b) Buffering in user space(c) Buffering in the kernel followed by copying to user space(d) Double buffering in the kernel21Device-Independent I/O Software (4)Networking may involve many copies22User-Space I/O SoftwareLayers of the I/O system and the main functions of each layer23DisksDisk Hardware (1)Disk parameters for the original IBM PC floppy disk and a Western Digital WD 18300 hard disk24Disk Hardware (2)• Physical geometry of a disk with two zones• A possible virtual geometry for this disk25Disk Hardware (3)• Raid levels 0 through 2 • Backup and parity drives are shaded26Disk Hardware (4)• Raid levels 3 through 5• Backup and parity drives are shaded27Disk Hardware (5)Recording structure of a CD or CD-ROM28Disk Hardware (6)Logical data layout on a CD-ROM29Disk Hardware (7)• Cross section of a CD-R disk and laser– not to scale• Silver CD-ROM has similar structure– without dye layer– with pitted aluminum layer instead of gold30Disk Hardware (8)A double sided, dual layer DVD disk31Disk Formatting (1)A disk sector32Disk Formatting (2)An illustration of cylinder skew33Disk Formatting (3)• No interleaving• Single interleaving• Double interleaving34Disk Arm Scheduling Algorithms (1)• Time required to read or write a disk block determined by 3 factors1. Seek time2. Rotational delay3. Actual transfer time• Seek time dominates• Error checking is done by controllers35Disk Arm Scheduling Algorithms (2)InitialpositionPendingrequestsShortest Seek First (SSF) disk scheduling algorithm36Disk Arm Scheduling Algorithms (3)The elevator algorithm for scheduling disk requests37Error Handling• A disk track with a bad sector• Substituting a spare for the bad


View Full Document

UCSC CMPS 111 - Input and Output

Download Input and Output
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 and Output 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 and Output 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?