A driver stack is the ordered set of layered drivers that together handle input and output requests for a single hardware device, with each layer adding, transforming or forwarding the request before it reaches the hardware. In the area of Drivers & devices within operating systems, the term is most closely tied to the Windows Driver Model, where every device is represented by a device stack of device objects created by a bus driver, a function driver and optional filter drivers.
Layering lets an operating system separate responsibilities: one driver knows the bus, another knows the device, and others add encryption, monitoring or compatibility fixes without rewriting the core driver. The same idea appears in Linux and macOS, where storage, USB and network subsystems pass requests through several cooperating driver layers.
How a driver stack is built and traversed
In Windows, the stack is assembled during device enumeration by the Plug and Play manager. The bus driver detects the device and creates the physical device object (PDO) at the bottom. The system then loads the function driver, which creates the functional device object (FDO) above it, and any registered filter drivers, which attach their own filter device objects above or below the FDO.
An application request enters at the top. The I/O manager builds an I/O request packet (IRP) and sends it to the highest device object. Each driver handles the request, completes it or passes it down with IoCallDriver. Completion travels back up the stack in reverse order, so drivers can inspect results through completion routines.
The following table lists the layers from top to bottom.
| Layer | Device object | Responsibility |
|---|---|---|
| Upper filter driver | Filter DO | Adds features or inspects requests above the device logic |
| Function driver | FDO | Implements device behavior and power policy |
| Lower filter driver | Filter DO | Adjusts requests before they reach the bus |
| Bus driver | PDO | Enumerates the device and controls bus access |
Device stacks, driver stacks and device trees
Microsoft documentation distinguishes a device stack, the chain of device objects for one device node, from a driver stack, the chain of drivers that serve a request. In practice the two terms are often used interchangeably. A single request can cross several device stacks: a file read passes through the file system stack, the volume stack, the disk stack and the storage controller stack.
The table compares related structures that are easy to confuse.
| Concept | Scope | What it describes |
|---|---|---|
| Driver stack | One request path | Drivers that process a request in order |
| Device stack | One device node | Device objects attached to one PDO |
| Device tree | Whole system | Parent-child relationships among all devices |
| Hardware abstraction layer | Platform | Kernel layer hiding chipset and firmware details |
| Driver model | Operating system | Rules for writing and stacking drivers |
The device tree links stacks together: the bus driver of a child device is the function driver of its parent bus. A USB storage device, for example, sits under the USB hub, which sits under the USB host controller, which sits under the PCI bus.
Driver stacks across operating systems
Every major operating system uses layered I/O paths, though the vocabulary differs. Windows formalizes stacking through device objects and IRPs, while Linux composes layers through subsystem interfaces and function pointers.
| Platform | Layering mechanism | Example stack |
|---|---|---|
| Windows (WDM, KMDF) | Device objects and IRPs | Volume, disk class, storport miniport |
| Linux | Subsystem cores and operations tables | File system, block layer, SCSI, USB storage, host controller |
| macOS (IOKit) | Provider and client objects in the I/O Registry | Media, block storage, USB device, controller |
| FreeBSD (CAM, GEOM) | Transformation classes and peripheral drivers | File system, GEOM partition, CAM disk, controller |
Linux has no formal filter driver type, but device mapper, netfilter hooks and stackable block devices fulfill similar roles. On macOS, Apple increasingly moves drivers out of the kernel into DriverKit system extensions, which still form layered provider-client chains.
Filter drivers and their uses
Filter drivers are the main reason driver stacks exist. They let vendors extend device behavior without modifying the function driver, which may belong to another company. The trade-off is that every filter adds latency, complexity and a new failure point.
| Role | Typical position | Example purpose |
|---|---|---|
| Encryption | Above the volume or disk | Full-disk encryption of sectors |
| Antivirus file filtering | File system minifilter | Scanning files on open and write |
| Input remapping | Above keyboard or mouse class | Remapping keys or filtering gestures |
| Hardware workaround | Lower filter | Correcting device firmware errors |
| Backup and snapshots | Above the volume | Tracking changed blocks |
Failure modes and troubleshooting
Because every layer runs in kernel mode in most stacks, one faulty driver can crash the whole system. Diagnosing stack problems usually means identifying which layer mishandled the request.
- Orphaned filter entries: a filter listed in the registry after its software is removed can prevent a device from starting.
- Incorrect completion handling: a driver that completes an IRP twice or never completes it causes crashes or hung I/O.
- Filter ordering conflicts: two security products filtering the same stack may deadlock or double-scan data.
- Diagnostic tools: Device Manager, the
!devstackdebugger command and Driver Verifier reveal stack composition and errors.
In simple terms
When a program saves a file, the request does not jump straight to the disk. It passes through several helpers stacked on top of each other. Each helper does one job.
Think of a letter in a mail system. A clerk checks it. A sorter routes it. A courier drives it to the right street. The driver stack is that chain of helpers for one device. Extra helpers can join the chain to add things like encryption.
A practical example
An IT department rolls out full-disk encryption to 400 Windows laptops. After the rollout, about 30 machines fail to boot and show a storage-related stop error. The other laptops work normally.
A support engineer attaches a kernel debugger to one failed laptop and inspects the disk device stack. It shows two lower filter drivers: the new encryption filter and an older backup agent filter that was never fully uninstalled. The old filter attaches in the wrong order and passes unencrypted requests below the encryption layer. The engineer removes the stale filter entry from the registry with a deployment script. All 30 laptops boot normally on the next restart, and the team adds a filter inventory check to its rollout procedure.