export_week 11chapter 9 input output Flashcards
,
Basic Model of Processing speed or program execution
determined primarily by ability of I/O operations to stay ahead of processor.
,
I/O Requirements
▪ Means for addressing different peripheral devices ▪ A way for peripheral devices to initiate communication with the CPU ▪ An efficient means of transferring data directly between I/O and memory for large data transfers since programmed I/O is suitable only for slow devices and individual word transfers
,
I/O Requirements
▪ Buses that interconnect high-speed I/O devices with the computer must support high data transfer rates ▪ Means for handling devices with extremely different control requirements
,
I/O Interfaces Are necessary because of ?
▪ Different formats required by the devices ▪ Incompatibilities in speed between the devices and the CPU make synchronization difficult ▪ Bursts of data vs. streaming data ▪ Device control requirements that would tie up too much CPU time
,
Examples of I/O Devices
,
Simple I/O Configuration D?
https://s3.amazonaws.com/classconnection/655/flashcards/7082655/png/image77u8qx-14A61DE34A91D5DD827.png
,
More Complex I/O Module
https://s3.amazonaws.com/classconnection/655/flashcards/7082655/png/imager61jrx-14A61DDE2410D2FE1D4.png
,
Advanced I/O Techniques
▪ Programmed I/O ▪ CPU controlled I/O ▪ Interrupt Driven I/O ▪ External input controls ▪ Direct Memory Access Controllers ▪ Method for transferring data between main memory and a device that bypasses the CPU
,
Programmed I/O traits ?
I/O data and address registers in CPU ▪ One word transfer per I/O instruction ▪ Address information for each I/O device ▪ LMC I/O capability for 100 devices ▪ Full instruction fetch/execute cycle
,
where is programmed I/O used ?
▪ Primary use: ▪ keyboards ▪ communication with I/O modules (see DMA)
,
Programmed I/O Example
https://s3.amazonaws.com/classconnection/655/flashcards/7082655/png/imageqqw8qx-14A617B1C6C30C28BFD.png
,
Programmed I/O Example
https://s3.amazonaws.com/classconnection/655/flashcards/7082655/png/image3oq4qx-14A617B679E34F0849B.png
,
Interrupt Terminology ▪ Interrupt lines (hardware
▪ One or more special control lines to the CPU
,
Interrupt request
dont know
,
▪ Interrupt handlers
▪ Program that services the interrupt ▪ Also known as an interrupt routine or device driver
,
▪ Context of interrupts
▪ Saved registers of a program before control is transferred to the interrupt handler ▪ Allows program to resume exactly where it left off when control returns to interrupted program
,
Use of Interrupts ?
▪ Notify that an external event has occurred ▪ real-time or time-sensitive ▪ Signal completion ▪ printer ready or buffer full ▪ Allocate CPU time ▪ time sharing ▪ Indicate abnormal event (CPU originates for notification and recovery) ▪ illegal operation, hardware error ▪ Software interrupts
,
The CPU - The Interrupt Cycle how ?D
https://s3.amazonaws.com/classconnection/655/flashcards/7082655/png/selection_220-14A617DC32A55AC6970.png
,
Servicing the Interrupt
- Lower priority interrupts are held until higher priority interrupts are complete 2. Suspend program in progress 3. Save context, including last instruction executed and data values in registers, in the PCB or the stack area in memory 4. Branch to interrupt handler progra
,
Servicing an Interrupt
https://s3.amazonaws.com/classconnection/655/flashcards/7082655/png/imagefprjrx-14A617E93147EADFB7D.png
,
what are Interrupt Processing Methods?
1.Vectored interrupt ▪ Address of interrupting device is included in the interrupt ▪ Requires additional hardware to implement 2.▪ Polling ▪ Identifies interrupting device by polling each device ▪ General interrupt is shared by all devices
,
Vectored Interrupts
https://s3.amazonaws.com/classconnection/655/flashcards/7082655/png/imagel8jzqx-14A6180E5F022506E5A.png
,
Polled Interrupts
https://s3.amazonaws.com/classconnection/655/flashcards/7082655/png/image3rserx-14A618128902A20A81B.png
,
Print Handler Interrupt
https://s3.amazonaws.com/classconnection/655/flashcards/7082655/png/imagenyvyqx-14A61DF1902346C64BB.png
,
Using an Interrupt for Time Sharing
https://s3.amazonaws.com/classconnection/655/flashcards/7082655/png/imagevwbkrx-14A6181D25060221D4B.png
,
Multiple Interrupts Example
https://s3.amazonaws.com/classconnection/655/flashcards/7082655/png/imaged1nyqx-14A61DFB4C90E1A1FE0.png
,
how is Direct Memory Access happen ?
- Transferring large blocks of data 2. Direct transfer to and from memory 3. CPU not actively involved in transfer itself
,
Required conditions for DMA ?
▪ The I/O interface and memory must be connected ▪ The I/O module must be capable of reading and writing to memory ▪ Conflicts between the CPU and the I/O module must be avoided ▪ Interrupt required for completion
,
DMA Instructions
Application program requests I/O service from operating system privileged programmed I/O instructions
,
To initiate DMA, programmed I/O is used to send the following information:
- location of data on I/O device 2. the starting location in memory 3. the size of the block 4. read/write
,
when Interrupt to CPU in DMA?
Interrupt to CPU upon completion of DMA
,
DMA Initiation and Control
https://s3.amazonaws.com/classconnection/655/flashcards/7082655/png/imagep4aarx-14A6185B9AE2C403B9B.png
,
I/O Module Interfaces
https://s3.amazonaws.com/classconnection/655/flashcards/7082655/png/imaget54erx-14A6185FE06671AB35A.png
,
I/O Module Functions
▪ Recognizes messages from device(s) addressed to it and accepts commands from the CPU ▪ Provides a buffer where the data from memory can be held until it can be transferred to the device ▪ Provides the necessary registers and controls to perform a direct memory transfer ▪ Physically controls the device ▪ Copies data from its buffer to the device/from the CPU to its buffer ▪ Communicates with CPU
,
Input/Output Characteristics
– Many orders of magnitude slower than memory – Character vs. block based – Burst vs. steady transfers
,
Three approaches to I/O
– Programmed – Interrupt-driven – Direct memory acces
,
Programmed I/O
– CPU is responsible for reading/writing to devices – Special “input” instruction on CPU – I/O data register and I/O address register – Each device is assigned a unique address.
,
Programmed I/O types
– Memory mapped I/O alternative – Treat the I/O device as a memory address for reads and writes. Simplifies programmer interface; slightly more complicated control circuitry. – Problems with all programmed I/O – Must check status bits to see if I/O is “ready.” – Use a polling loop (busy-wait) to send and receive data to devices.
,
Interrupts
– Busy-waits (polling) wastes resources but has simpler hardware. – Alternative: After an I/O request from the CPU, let the I/O device notify the CPU when data is ready to be read (called an interrupt)
,
Alternative: After an I/O request from the CPU, let the I/O device notify the CPU when data is ready to be read (called an interrupt).
Each device is assigned an IRQ line (signal). I/O controller sets IRQ line status high. CPU detects IRQ at beginning of fetch/execute. CPU saves state of running program and switches to an IRQ handler routine. Routine services the request. Control is returned to the previously running code
,
Problems with interrupt driven I/O
CPU still involved with each interrupt – Only transfers a single byte/word
,
did you know Only transfers a single byte/word
Disk or network transfers may be hundreds or thousands of bytes. IRQ handler code may be hundreds of instructions. Still too much overhead.
,
DMA
– Direct Memory Access (DMA) – Add a specialized kind of CPU that can directly transfer data from device to memory.
,
Purely programmed I/O requires special I/O instructions,
, I/O data and address registers, and polling loops that waste CPU resources.
,
Interrupt-driven I/O avoids
busy-waiting but is unsuitable for large block transfers due to interrupt handler execution overhead.
,
DMA combines PIO and IRQ handlers
with a special controller to transfer large amounts of block data efficiently directly to memory.