Device Driver
A device driver is a translator between the operating system and a piece of hardware. Every printer, network card, and graphics card speaks its own language. The driver knows that language, so the operating system can just say “send this data” without knowing the details. Missing or wrong drivers are why a device shows up but does not work.
A device driver is kernel code (on Linux, usually a loadable kernel module, .ko) that binds to a device and exposes it through a standard interface: a network interface, a block device, a sound card, or a framebuffer.
How Linux matches drivers: devices announce IDs on their bus (PCI vendor:device such as 8086:125c, USB IDs). udev and the kernel match those against each module’s alias table and load the right one automatically.
Sources of drivers:
- In-tree: shipped with the kernel. Most hardware works out of the box.
- Out-of-tree: built separately, often with DKMS so they rebuild for each new kernel (NVIDIA proprietary, some Wi-Fi chips, VirtualBox host modules). Must be signed for Secure Boot.
- Firmware blobs: some drivers also load device firmware from
/lib/firmware(linux-firmware package).
Windows and macOS use the same idea with different packaging (.sys and .inf files, kexts or DriverKit).
When no driver binds, the device shows in lspci or lsusb without a “Kernel driver in use” line.
Source: Linux kernel documentation: Driver implementer’s API guide
Finding and managing drivers
# Which driver each PCI device uses
$ lspci -k
02:00.0 Ethernet controller: Intel Corporation Ethernet Controller I226-V
Kernel driver in use: igc
Kernel modules: igc
# Loaded modules and details for one
$ lsmod | grep igc
$ modinfo igc | head -5
# Load and unload by hand
$ sudo modprobe -r igc && sudo modprobe igc
# Firmware load failures
$ sudo dmesg | grep -iE "firmware|failed to load"
# Out-of-tree modules built with DKMS
$ dkms status Driver trouble usually shows up right after new hardware or a kernel update. The workflow: find the device with lspci -k or lsusb, check whether a driver is bound, read dmesg for errors, and search the PCI ID. On Ubuntu, ubuntu-drivers devices covers the common proprietary cases. Buying hardware with in-tree Linux support, such as Intel NICs and AMD or Intel graphics, avoids most of this.