Polled I/O

Polled I/O

Interrupts are the usual way of determining when a device needs service. There is an alternative called polled I/O.

With polled I/O the CPU loops on a device constantly checking its status to determine whether it needs service.

The drawback of polled I/O is that it ties up the CPU. For example, initiating a read from the keyboard would hang the machine until a character was received.

It is mostly old systems whose devices could not generate interrrupts that use polled I/O. Still, most devices that can support interrupt-driven I/O can also be operated in polled mode. XINU uses interrupt driven I/O (as you would expect) except for a special console display routine - kputc(). There it uses polled I/O so kputc() can be used for debugging the kernel before the interrupt vectors are set up.

1