Studio render of a tall stack of graded frosted discs, the bottom resting on a small device and the top supporting an application block

Article · 3 min read

How driver stacks are layered

Most devices are served not by one driver but by a small stack of them, each with a narrow job. Seeing the stack as layers explains why a single device can list several files and several providers.

The idea of a stack

Requests to a device pass downward through a sequence of drivers and replies pass back up. Each layer understands only what it needs to. The top may understand a general device type, the middle may add a feature, and the bottom knows how to speak over a particular bus.

This arrangement lets Windows reuse lower layers for many devices and lets makers add behaviour without rewriting everything.

Bus drivers at the base

At the bottom sits the driver for the bus the device is attached to, such as USB or PCI Express. It discovers what is plugged in, reports identifiers, and moves data. It does not understand what a camera image or a sound sample means; it only knows how to deliver packets reliably.

Because one bus driver serves many devices, issues at this layer tend to affect several devices at once, a useful clue when reading symptoms.

Function and class drivers in the middle

The function driver is the main driver for the device, the one that knows what the device is for. Sometimes this is a class driver supplied with Windows; sometimes it is a maker's own driver. It turns general operating-system requests into device-specific work.

In some designs a class driver is paired with a small maker-supplied minidriver that handles the device's particular quirks while the class driver handles everything shared.

Filters along the way

Filter drivers sit above or below the function driver and adjust traffic. A filter might add audio effects, translate special keys, or enforce a security policy. Antivirus products and storage encryption commonly use filters.

Filters explain why software that appears unrelated to a device can affect it: if a filter is in the stack, it sees every request.

Seeing the stack yourself

The Driver Details window for a device lists the files currently associated with it, and different providers among those files often correspond to different layers. Viewing devices by connection shows which bus and controller each device hangs from, which is the bottom of its stack.

Recognising the layers makes release notes easier to place. A fix described for a USB controller lives low in the stack; a fix for an equaliser panel lives near the top.

Why layering helps reliability

Layering also contains change. When Microsoft improves the USB bus driver, every USB device benefits without its maker shipping anything new. When a maker fixes a bug in its function driver, the bus driver underneath is untouched. Each layer can evolve on its own schedule, which is one reason Windows can handle an enormous range of hardware with a manageable amount of shared code.

The cost is that a problem can arise from the interaction between layers rather than from any single one, which is why careful notes about every component are valuable.