A FreeBSD committer is making the case that modern driver stacks have become layers of compatibility shims, and that the layers now cost more than they save. The argument for rethinking operating system drivers starts with a simple observation: most hardware no longer works the way the software pretends it does.
The developer, who is building new video and wireless frameworks for FreeBSD 16, compares the situation to a Jenga tower. Each generation of hardware added a block on top without touching the ones underneath, and nobody remembers what the bottom blocks were for.
The SSD that pretends to be a hard disk
A SATA SSD is a chip full of flash memory posing as a spinning disk. It speaks ATA, a command set built for platters and read heads, behind AHCI, a controller interface Intel published in 2004. AHCI offers one queue of 32 commands, which suits a mechanical arm that can do one thing at a time. Flash has dozens of dies that can all work at once, and the operating system never sees that.
The disguise goes further. Flash can’t overwrite a page in place, so every SSD carries a small computer, the Flash Translation Layer, that remaps writes and runs garbage collection. Because hard drives never needed to know about deleted files, the industry later had to add TRIM so a filesystem could tell the drive which blocks were free.
NVMe 1.0 arrived in March 2011 as a clean break, with up to 65,535 queues of 65,536 commands each. Yet FreeBSD has routed NVMe through its CAM layer, built around SCSI in the 1990s, by default since version 14.0. The drive also still hides its real geometry. With ZFS, which never overwrites blocks, you end up with two garbage collectors working the same flash without seeing each other.
Honest alternatives exist. NVMe Zoned Namespaces were ratified in June 2020, and Flexible Data Placement followed in 2023. Hyperscalers pushed both, and most laptops use neither.
Devices that are really computers
The same pattern shows up in WiFi and graphics. WiFi chips come in two designs: SoftMAC, where the operating system builds 802.11 frames itself, and FullMAC, where the chip does everything and the driver forwards commands. FreeBSD’s net80211 stack grew up around SoftMAC, so FullMAC hardware such as Broadcom’s brcmfmac has long been an awkward fit.
Since Turing, every NVIDIA card has carried a RISC-V coprocessor called the GSP, and NVIDIA’s open kernel modules hand initialization and power management to it. Nouveau on Linux added GSP support in 6.7 and can’t drive RTX 40 cards without it. As of 6.18 it is the default on Turing and Ampere. AMD cards need the gpu-firmware-kmod package so amdgpu can load firmware for the small processors on the card.
In practice, a modern GPU or WiFi driver is mostly an RPC client. It sends requests across the bus and waits for another computer to answer. The firmware has no stable ABI, so the nouveau GSP code works only with firmware from one NVIDIA driver series, R535.
One chip, two drivers, and a stack of shims
On an Intel AX200 or AX210, WiFi and Bluetooth share one chip and its antennas. The operating system still sees two unrelated devices: WiFi over PCIe and Bluetooth over an internal USB link. On FreeBSD 16, the WiFi half runs through iwlwifi(4), a Linux driver on top of LinuxKPI and net80211. The Bluetooth half uses ng_ubt(4) and ng_ubt_intel, with firmware pushed from userland by iwmbtfw(8). Meanwhile the chip’s firmware decides which radio gets airtime, out of the OS’s sight.
LinuxKPI is the bigger shim. It implements enough of the Linux kernel API to run Linux drivers, which is how FreeBSD gets amdgpu, i915 and Realtek’s rtw88 and rtw89 drivers. The result is a FreeBSD kernel emulating Linux interfaces, running a Linux driver that talks to a firmware blob on a coprocessor. The committer wants LinuxKPI gone, a goal they measure in years, since every driver on it needs a native replacement first.
Compatibility once made sense because hardware lasted a decade and the emulation cost spread over ten years. Storage controllers and GPUs now turn over every year or two, so the cost never pays off.
What a rewrite would look like
- Expose flash as flash, and let the filesystem tell the drive which data is hot or cold.
- Treat firmware as a peer, with a versioned interface negotiated at startup.
- Model a combo chip as one device with a shared view of airtime.
- Build the framework before the driver, so drivers stop reinventing the same plumbing.
The developer has already done the last step once. The video(4) capture framework lands in FreeBSD 16, owns the device nodes and buffer management, and speaks V4L2 to userland. Two drivers use it today: uvideo(4) for USB webcams and fwcam(4) for FireWire cameras.
What comes next for FreeBSD wireless
The same approach is now going into a new set of wireless drivers, written from scratch on a new architecture. The developer reverse-engineered the hardware behavior where needed, and none of the code comes from the vendor. The wireless framework is finished and in testing. The driver already runs on FreeBSD and DragonFly, and it also works in UEFI before any operating system boots.
The code stays semi-closed until it matures. Access goes to people who can show they are BSD veterans. Replacing the shims will take years, but this is the first working sign that the stack can be rebuilt instead of patched.
Source: Seuros Blog