6 Programmed IO, Interrupt-Driven IO, DMA
6 Programmed IO, Interrupt-Driven IO, DMA
Interrupt-Driven I/O:
• Overview: In interrupt-driven I/O, the CPU doesn't continuously poll
or wait for I/O devices to be ready. Instead, it allows the CPU to perform
other tasks while waiting for I/O operations to complete. When an I/O
operation completes or requires attention, the device signals the CPU
by generating an interrupt.
• Interrupt Handling: When an interrupt occurs, the CPU temporarily
suspends its current task, saves its state (registers, program counter,
etc.), and jumps to an interrupt service routine (ISR) specified by the
interrupt vector table. The ISR then handles the interrupt, which may
involve servicing the I/O request, acknowledging the completion of an
operation, or handling errors.
• Asynchronous Operation: Interrupt-driven I/O allows devices to
operate asynchronously with respect to the CPU, meaning that I/O
operations can occur independently of the CPU's execution. This
asynchronous operation improves system performance by allowing the
CPU to perform other tasks while waiting for I/O operations to
complete.
• Example: Consider a disk I/O operation where data needs to be read
from or written to a disk. Instead of continuously polling the disk to
check if the operation is complete, the CPU can initiate the operation
and continue executing other tasks. When the disk operation completes,
the disk controller interrupts the CPU, allowing it to handle the
completion of the operation.