DOC PREVIEW
UCLA COMSCI M151B - ch7

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

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

Unformatted text preview:

Chapter 7: I/O SystemI/O ArchitecturesProgrammed I/OInterrupt-Driven I/ODMA I/OChannel I/OI/O Accessing and AddressingI/O Control LinesInterrupt ControllerDisk TechnologyDisk AccessFloppy vs. Hard DisksOptical Disk DrivesMagnetic TapeRAIDRAIDS 1, 2 and 3RAID 4, 5 and 6Chapter 7: I/O System•The I/O subsystem is treated as an independent unit in the computer–The CPU initiates I/O commands generically•Read, write, scan, etc•This simplifies the CPU–I/O modules are components that connect an I/O device to the I/O bus•The I/O module is an intermediary between CPU and the I/O device, and possibly between memory and the I/O device–This allows us to tailor I/O devices to specific uses without having to worry about how the CPU might be able to handle that new type of device–In addition, while the CPU may initiate an I/O operation, once begun, the I/O module takes over so that the CPU can get back to doing whatever it was doing•There are 4 general forms of I/O control, we will cover eachI/O Architectures•I/O subsystem will typically include–Blocks of memory dedicated to I/O buffering–I/O bus(es)–I/O devices–Specialized interfaces (for instance for keyboard and monitor) and interface cards–Possibly other connections (network, cable, etc)Programmed I/O•Programmed I/O –The CPU monitors the I/O module so that the CPU is not free to work on other things•This is an inefficient form of I/O, and the oldest form, it is typically not used today unless the program directly calls for input from keyboard or other device–The process:•I/O instruction in the program causes CPU to examine I/O module’s control register’s ready bit – if it is ready, then the CPU issues the I/O command by setting the proper bits in this register•the I/O module issues the command to the I/O device and watches over device•when the I/O device has completed the task the I/O module sets the proper bits in its control register•the CPU, which has been watching this register, then cleans up the operation (on input, moves the input datum from the I/O module’s data register to the CPU register or memory location)Interrupt-Driven I/O•Here, the Interrupt system is used so that the CPU does not have to watch and wait for the I/O module–The process:•The CPU issues the command to the I/O module•The CPU then continues with what it was doing•The I/O module, like before, issues the command to the I/O device and waits for the I/O to complete•Upon completion of one byte input or output, the I/O module sends an interrupt signal to the CPU•The CPU finishes what it was doing, then handles the interrupt–This will involve moving the resulting datum to its proper location on input•Once done with the interrupt, the CPU resumes execution of the program–This is much more efficient than Programmed I/O as the CPU is not waiting during the (time-consuming) I/O process•However, if the I/O itself takes more than 1 input or output (that is, if the amount being transferred is greater than 1 byte), then this interrupts the CPU often, so instead…DMA I/O•Direct memory access allows an I/O module to communicate directly with memory so that the CPU does not have to be interrupted for each data movement–In any large transfer, DMA I/O is preferable to Interrupt-driven I/O–The DMA controller only interrupts the CPU once, once the entire data transfer is complete–Note: memory is a slave device so it cannot initiate bus transfers, the DMA controller then acts as a memory master–The DMA controller includes a count register set by the CPU to count the number of bytes still to be transferred–The DMA controller acts as an interface between I/O device and memoryChannel I/O•In DMA I/O, if there is a failure of the I/O device, the I/O module interrupts the CPU to handle the problem•A more sophisticated I/O module is known as an I/O channel –this is an I/O module with its own mini-processor (known as an I/O processor)–these processors contain their own ALUs and control units so that they can perform comparisons and make branches in their own mini-programs•Channel I/O can handle any problem without having to interrupt the CPUI/O architecture with I/O ChannelsI/O Accessing and Addressing•I/O accesses use the Expansion bus and System bus–as multiple devices might need access at the same time, bus access must be governed–three approaches are:•bus arbiter, a controller to select the device that next gets to use the bus based on a priority scheme•an I/O monitor checks for bus traffic and if it is busy, waits•use the CPU as an arbiter•To determine which device is to handle a CPU command, the CPU sends the device’s address on the address bus (along with the control command of read or write)–There are two forms of addressing used in computers:•Isolated I/O – every device has a unique address and so device j watches for address j over the address bus, and the CPU uses two sets of control lines, one to memory, one to the I/O subsystem•Memory-mapped I/O – some memory addresses are reserved for I/O module registers, and communication from the CPU to memory & I/O is generic•Memory-mapped while being cheaper because of the need for fewer control lines takes away some memory addresses so those memory locations are never usedI/O Control LinesHere we see more detail on the I/O bus including control linesRequest from CPU goes to I/O module – basically asking “are you ready?”Ready goes from I/O module to CPURead/write indicates the type of operationClock is used to synchronize transfer if availableError denotes that the I/O module wants the CPU’s attentionInterrupt Controller •One final controller is the interrupt controller–All interrupts go directly to a controller rather than to the CPU–The controller then interrupts the CPU and waits for the interrupt to be acknowledged•The interrupt controller prioritizes interrupts from the devices based on the importance of the device–Prioritization is established by the architects when the controller is designedThe data lines D0, D1are used to specify the interrupting deviceSome architectures donot have data lines,instead the interruptingdevice must be determined some other wayDisk TechnologyWe now turn to some specific I/O devicesDisk includes both magnetic disk (floppy, hard)and optical diskIn both cases, the surface of the disk isbroken into tracks, and on magnetic media,sectorsThe track/sector is used to


View Full Document

UCLA COMSCI M151B - ch7

Download ch7
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 ch7 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 ch7 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?