Driver

Device Controller

  • A device controller is in charge of the devices. 
  • It maintains 
    • some local buffer
    • and a set of special purpose registers
  • It is responsible for moving the data between the peripheral devices that it is controls and its local buffer storage.

Device Driver

  • The operating system has a device driver for each device controller
  • This device driver understands the device controller and presents a uniform interface to the device to the rest of the operating system

Interrupt Driver IO

  • Procedure
    • The device driver loads the appropriate registers within the device controller.
    • The device controller, in turn, examines the contents of these registers to determine what action to take.
    • The controller starts the transfer of the data from the device to its local buffer.
    • Once the transfer of data is complete, the device controller informs the device driver via an interrupt that it has finished its operation.
    • The device driver then returns control to the operating system, possibly returning the data or a pointer to the data if the operation was a read.
  • Drawback
    • High overhead when used for bulk data movement such as disk I/O.
    • To solve this problem, directed memory access (DMA) is used.

Directed Memory Access (DMA)

  • After setting up buffer, pointers and counters for the I/O device, the device controller transfers an entire block of data directly to or from its own buffer storage to the memory, with no intervention by the CPU.

Leave a Reply