InputOutput Subsystem
InputOutput Subsystem
I/O System
• 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
Handling Interrupts
• Here we see more detail on the I/O bus including control lines
• Request from CPU goes to I/O module – basically asking “are you
ready?”
• Ready goes from I/O module to CPU
• Read/write indicates the type of operation
• Clock is used to synchronize transfer if available
• Error denotes that the I/O module wants the CPU’s attention
Interrupt 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 designed
• The data lines D0, D1 are used to specify the interrupting device
• Some architectures do not have data lines, instead the interrupting device
must be determined some other way