3

Please help me straight my understanding about this:

From what I understand, motherboards contain pre-installed device controllers. A controller is a chip that's responsible for communicating with the device itself. E.g. there's a controller for a screen, a controller for a keyboard, for a mouse, etc.

I read this paragraph in a book about operating systems:

The software that talks to a controller, giving it commands and accepting responses, is called a device driver. Each controller manufacturer has to supply a driver for each operating system it supports.

So it seems that the driver is the software that talks to the controller. If it is correct that the controller is a piece of hardware on my motherboard, seemingly, I only need one driver to talk to it, no matter the actual device connected to it. That's supported from what the author says about that you need a different driver for each controller, not for each device, so why is it e.g. when you buy a new printer or something, you need to install a driver for it?

1
  • Printers have controllers as well, but they are not on the motherboard. – DavidPostill Dec 23 '20 at 21:09
3

Are device drivers for controllers or devices?

Could be both or either. Depends on what the actual hardware interface is to the CPU (or system/peripheral bus), the software interface(s), and what needs software control.

Some devices have a simple hardware interface that can connect directly to the system (or peripheral) bus, e.g. a UART. Such devices do not require a controller. So the OS would have a (device) driver that interacts with that UART device.

Some devices have a more complex hardware interface that cannot connect directly to the system (or peripheral) bus. Older devices such as ST506 hard drives and floppy drives had analog signals that required a controller rather a direct connection. Multimedia memory cards (e.g. MMC and SD cards) require a controller for connection with a computer (although PCs typically also use USB). So the OS would have a driver that interacts with that device's controller, and possibly a driver for the device.

Some devices have a hardware interface that is an extension bus or link, e.g. SATA, USB, HDMI and I2C. An interface controller would connect directly to the CPU's system (or peripheral) bus. So the OS would have a driver that interacts with that controller, and possibly a driver for the device.

... when you buy a new printer or something, you need to install a driver for it?

It is simply a matter of standardization and how much software control the OS (or you) wants/needs. SSD and HDD conform to SATA specifications, so the OS has only one driver for all SATA drives. Printers do conform to standards such as USB or IEEE-1284 or Postscript or PCL, but there is no standard in regards to paper handling and multifuction capabilities. Hence the need for a driver specific to the printer.

BTW after many years/decades in software/kernel development, I do not recall hearing the phrase "controller driver". Rather the specific controller would be mentioned, e.g. the "DMAC driver" or "EMAC driver". In SW a controller is also a device. SunOS/Solaris has "nexus devices" and Linux has "platform devices" to refer to devices (e.g. controllers) that have have other devices connected to them, i.e. a device tree or hierarchy.


In summary, for every type of device (including controllers) that is attached (locally or integrated/built-in) to the computer that has accessible control registers that the CPU can write to and/or status registers that the CPU can read from, then the OS will have code (i.e. a driver) in order to access, control, and maintain status of that device. The OS will also have drivers for pseudo-devices in order to maintain a state machine for a device or media that is accessed indirectly through its controller (e.g. a SD card).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.