12

I/O Hardware

As we defined it previously, a device controller is a piece of hardware in the device whose purpose is to control the device's transfer of I/O data.

To be able to communicate with the device, a CPU would use the registers located on the controller of the device.

A device's controller has minimally 4 registers:

  1. The CPU reads data from the data-in register (has the size of 1 to 4 bytes.)
  2. The CPU sends data to the device via the data-out register (has the size of 1 to 4 bytes.)
  3. Each bit in the status register represents an aspect of the device's status (a bitmap!) These include whether a transaction was completed already or not, whether the device is sleeping, whether the device is ready, whether it is busy, and whether any errors occurred.
  4. The CPU changes the current settings of the device (e.g., the length of a word) via the bits of the control register.