What is a device controller, and where does it fit in between the kernel and the device?

8,589

Solution 1

Was the idea behind the controller to be able to control devices from a different manufacturers with the same driver?

No. The primary purpose is to provide part of the interface between devices and the processor. A controller has its own driver; this is in addition to any drivers necessary for the devices connected to it.

The reason the interface is necessary is that the processor is highly specialized; controllers are sort of translators from the specialized world of the processor to the multiverse of devices. The processor only has one physical data connection to the outside (the bus), not a variety of them, and in fact, generally intermediary between controllers and the processor are bridges which connect the processor to the motherboard. Device controllers are then connected to the motherboard and communicate via a bridge. So there are four discrete physical entities in the chain: processor -> bridge -> controller -> device, all of which involve their own software drivers (a driver for the processor, for the bridge chipset, then for each of the controllers, and for each of the devices).

If you look at the diagram below from this wikipedia article, the blue boxes at the bottom represent device controllers.

enter image description here

[By Alexander Taubenkorb, Creative Commons Attribution-Share Alike 3.0]

Solution 2

Device controllers are typically bus arbiters. You're often not talking to the devices on a given bus directly but to the controller. The controller is then determining when and how to send commands to the devices on it's bus based on what you've requested through the controller.

Wikipedia has the following on the subject, http://simple.wikipedia.org/wiki/Device_controller.

excerpt

The Device Controller receives the data from a connected device and stores it temporarily in some special purpose registers (i.e. local buffer) inside the controller. Then it communicates the data with a Device Driver . For each device controller there is an equivalent device driver which is the standard interface through which the device controller communicates with the Operating Systems through Interrupts. Device controller is a hardware whereas device driver is a software.

Share:
8,589

Related videos on Youtube

TheMeaningfulEngineer
Author by

TheMeaningfulEngineer

I like to think of myself as a Hardware/Software guy who will gladly discuss referential transparency during a code review and the next moment take a circular saw to build a casing for a self made power supply. My main interest can be summarized into Linux related software development, low power electronics and general DIY projects.

Updated on September 18, 2022

Comments

  • TheMeaningfulEngineer
    TheMeaningfulEngineer over 1 year

    Can someone please explain the concept of a device controller (hard disc controller, NEC PD765 compatible controller etc.).


    Here are some definition of key terms which might be needed for the explanation. Just to maintain the term sync :)

    Kernel - The software which provides abstraction for accessing hardware devices

    Drivers - low level programs written by hardware manufacturers which are loaded as kernel modules and provide the kernel with the knowledge on how to control the devices

    Firmware - hardware specific programs which define the internal logics on the hardware. The kernel usually has nothing to do with them except for the cases when the the firmware is uploaded to the device upon each start in which case the kernel does the uploading


    Where does the device controller fit in and is it located on the device itself of on the motherboard?

    Do drivers provide the kernel with the interface towards the controller and not directly to the device itself?

    Was the idea behind the controller to be able to control devices from a different manufacturers with the same driver?