Everything Is Plural Now

In The Jenga Tower of Drivers I wrote about how drivers stack: every generation of hardware pretends to be the one before it, and we keep adding blocks on top. This post is about the other half of the problem. The tower stands on a picture of the machine that is decades old, and nobody updated the picture.
The picture is simple. A computer has one screen with one framebuffer behind it. It has zero or one GPU, and that GPU drives the screen. It has CPUs that are all the same, and they all speak one instruction set, the one the kernel was compiled for. Everything else is a peripheral hanging off a bus.
Every one of those singulars is wrong now. Most of them have been wrong since the start of the century. The kernel bolted the plurals on as exceptions and kept the singulars at the core.
I did not get here by reading spec sheets. I got here through a gamepad.
A Gamepad Is Not a Joystick¶
In December 2024 I started writing a gamepad driver for FreeBSD. It was probably one of the first drivers I ever wrote, and it was for the DualSense, because FreeBSD did not have one. The PlayStation 4 runs an operating system built on FreeBSD, so I had what I thought was a brilliant plan: write the driver, then copy it into the PS4’s filesystem. My reasoning was simple. In my head, Windows still loaded drivers from the Windows 98 era, so a FreeBSD driver should load on any FreeBSD. I did not know what a kernel ABI was yet. I was running FreeBSD 15-CURRENT at the time, and the PS4 is nowhere near that version. FreeBSD keeps its kernel interfaces stable within one release branch, and a module built for one major version does not load on another. That plan died, and the driver kept going as a full rewrite, from scratch.
I assumed a gamepad was an input device, because that is what the word means: buttons and two sticks. Report the axes and the buttons, and you are done.
A modern PlayStation controller is a small ecosystem. It has buttons and sticks, and it also has a gyroscope and an accelerometer, a touchpad, rumble motors, a light bar, player LEDs, a battery, a speaker, a headset jack, a microphone and its own firmware. It pairs over Bluetooth and it talks over USB, and you can have it plugged in and paired at the same time.
The kernel has no shape for that. It has input devices and sound devices, but nothing for an object that is both and several other things besides. So the driver has to cut the controller into pieces the kernel understands. Mine ends up as four separate devices for one controller: the gamepad, the motion sensors, the touchpad, and the headset jack with the battery. Sony’s own Linux driver makes the same cut and registers the motion sensors and the touchpad as input devices of their own, because Linux has the same model.
flowchart TB
C[One controller in your hand] --> G[Gamepad device]
C --> M[Motion sensor device]
C --> T[Touchpad device]
C --> H[Headset jack and battery device]
C --> A["Audio: a different driver entirely"]
C --> L["Lights and rumble: no class at all"]
Then come the outputs. Input devices take input. The rumble motors and the lights are outputs living on an input device, and there is no class for them, so they end up as tuning knobs hanging off the side of the driver.
Pairing is my favorite. To pair the controller with your machine, you plug it in over USB and the driver writes the host’s Bluetooth address and a link key into the controller. Unplug it, and it reconnects over Bluetooth. To the kernel, that is a brand new device on a different bus with no relation to the one that just left. One object in your hand, two identities in the kernel, and nothing in the device model that says they are the same thing.
The sound was the last straw. The speaker and the headset audio do not go through my driver at all. They go through uaudio(4), the generic USB audio driver, which has no idea it is talking to a gamepad. It works. The longer I lived with it, the more it felt like a hack, and that is the reason I am reworking the driver now. The code is fine. The kernel’s idea of what a device is has the wrong shape.
FreeBSD base has since gained a DualSense driver of its own, ps5dsense(4), which landed in September 2026. It handles the gamepad and the lights. Haptics, the adaptive triggers, the touchpad, the motion sensors and Bluetooth are all listed as unsupported. Mine predates it and handles the rest. I will talk about it properly once the rework is done.
Touching Other People’s Drivers¶
Fixing the controller currently means moving the sound into the same device as the buttons and the lights. The sound lives in uaudio(4), and uaudio(4) is somebody else’s driver. With today’s device model, every fix of this kind ends the same way: you have to open drivers you did not write, and that is where the real cost shows up.
Part of it is ownership. Every driver you touch is one more you do not fully own. You inherit its users, and you inherit its maintainer’s opinions. René Rebe leads T2 SDE, a Linux distribution built to cross-compile for unusual architectures, and he regularly rants on stream when someone refactors a driver in Linux mainline and the PS3 stops booting. T2 is one of the last distributions still building for the PS3, so they are the ones who find out. The refactor was correct for every machine its author could test. The PS3 was not one of them.
The bigger part is quirks. Every driver carries a pile of workarounds: for one chip revision with a bug, or for a board vendor who wired something backwards in 2003. The hardware moves on and the quirk stays, because nobody can prove it is dead. Deleting it means somebody has to say “nobody runs that anymore” in public, and nobody wants to be wrong on a mailing list.
I have said it in public, and it works if you give people a way to answer. In flashrom, thirteen old programmers were candidates for removal in 2.0.0: mostly PCI network cards and disk controllers, that once doubled as flash programmers. Each one got a deletion commit and a deadline: adopt it and keep it working, or watch it go. Petr Cvek adopted three of them. The other ten were merged out of the tree in September 2026. The three that survived now have someone named in MAINTAINERS who answered the question.
With flashrom I gave notice. In DragonFly nobody had given notice, so the dead code just sat there.
I use DragonFly BSD too, which is why I ported my FreeBSD asmc(4) work there, the driver for the System Management Controller in Intel Macs. Beyond that, I am mostly a janitor. In May 2026 I removed 3,274 lines of #if 0 blocks across seventeen files in the kernel, drivers, VFS and userland. Some of those blocks carried comments from their original authors asking for someone to delete them. Nobody had. I removed 150 lines of i386 code from a system that has been x86_64-only since DragonFly 4.0 in 2014. I removed an AHCI command coalescing implementation that had never compiled: it had a missing closing parenthesis and used an OpenBSD macro that could not work in DragonFly’s bus framework. Code that could not even build sat in the tree for years, because deleting it was nobody’s job.
The i386 leftovers are the best part. Sascha Wildner ran a cleanup series literally titled “i386 removal, part N/x”. Part 4 landed in June 2015. Part 70 landed in January 2019. Four years of deliberately hunting one architecture out of the tree, and in 2026 I still found it hiding in the kernel and the regression tests.
Dead code is the easy part. Live quirks are harder, and I write them too. The Samsung SSD that Apple put in its Macs speaks AHCI, but its reset does not follow the spec. So DragonFly now carries a workaround for that one drive: skip the checks it fails and cut the reset waits from a full second to 10 milliseconds, or the controller hangs at boot. It is correct today. In ten years, when the last of those Macs is gone, it will be another block nobody dares to pull, and some janitor will have to ask whether anybody still runs one.
The quirk debt is the main reason the device model never changes. Every workaround was written against the singular picture, against “the GPU” and “the device”. Change the picture and you have to walk through every quirk in the tree to find out which ones break.
The GPU Stopped Being One Thing¶
The kernel’s “the GPU” fits in one sentence: a PCI device with its own memory that drives the screen. Every machine on my desk breaks a different part of that sentence.
Its own memory. My laptop has an AMD APU, where the CPU and the GPU are one piece of silicon. It has 16 GB installed and about 14.9 GiB usable, because the firmware carves out a block of RAM for the GPU before the OS ever boots and the driver reports that block as VRAM. Past the carve-out, the GPU borrows more system memory on demand. Is that memory system RAM or VRAM? It is both, and the model only has room for one answer.
Drives the screen. My old iMac has two GPUs. The Radeon drives the display. The Intel GPU is present and working, and it shows up on the bus as “other display controller” instead of a VGA device, which usually means the firmware gave the display role to the Radeon. A consumer machine with a GPU that drives nothing. In the datacenter this is the normal case: NVIDIA’s H100 has no display connectors at all and identifies itself as a 3D controller. AMD’s MI300X is a module on a baseboard with nowhere to plug a monitor. These are compute cards that inherited a display stack’s plumbing because in 1995 a GPU was the thing that drove the monitor.
One of them. My main desktop has the Intel iGPU in its CPU and a Radeon AI PRO R9700 with 32 GB, a card sold for compute that happens to have outputs. Resizable BAR maps all 32 GB of its memory through one PCI window, so the CPU can address the whole card directly. Two vendors in one box, and the kernel still has one console. FreeBSD’s vt(4) keeps a single global display device. When a better backend registers, it replaces the old one. There is no console per display and no console per GPU.
And the APU breaks the sentence from the other side. If the GPU is part of the CPU package and has no memory of its own, calling it a PCI device is a polite fiction the hardware maintains for the OS’s comfort.
The Four-GPU Box¶
Here is a machine I do not own. Start from the same kind of AMD APU in a desktop and put a discrete card from every GPU vendor next to it. With a big case and enough slots, nothing in the hardware stops you. That is four GPUs from three vendors.
The firmware picks one of them to show the boot screen. The others stay dark until a driver claims them. Then the console picks one framebuffer, and we are back to the singular. Each vendor’s driver stack assumes it is the GPU in the machine. Userland assumes it too. Compositors default to “the GPU”, and so does the code that picks a device for OpenGL or Vulkan, with per-application choice bolted on later.
On FreeBSD the box is a three-GPU box before you even start. drm-kmod does not support Intel Arc. Alchemist cards panic under i915, and there is no port of xe, the driver Battlemage needs.
The uncomfortable part is that this problem has been solved before, at least in the driver layer. Windows 7 shipped WDDM 1.1 in 2009, and it allows display drivers from different vendors to run side by side. Vista could not do it: every display adapter had to use the same driver. Microsoft decided the singular was wrong and changed the model seventeen years ago. Even there, userland lagged. For years an application could only ask for “power saving” or “high performance”, and choosing a specific card arrived with Windows 11.
So this is a design decision, and the BSDs and Linux have not made it yet. Nobody builds the four-GPU box because the software is flaky, and the software stays flaky because nobody builds the box.
One Keyboard With Lots of Duplicated Keys¶
The console that picks one framebuffer also listens to one keyboard. Input went through the same collapse. The AT and PS/2 era gave the PC one keyboard port and one mouse port, so the machine had one keyboard and one mouse, and the hardware enforced it. USB removed the limit. You can plug in as many keyboards as you have ports and hubs.
The kernel’s answer was to merge them back into one. FreeBSD has a driver for exactly this, kbdmux(4), in the tree since FreeBSD 6.0. Its man page describes the design better than I can: it acts as a “super keyboard” that consumes input from every keyboard attached to it, and the caveats section says it “is logically equivalent to one keyboard with lots of duplicated keys.” Plug in five keyboards and you get one keyboard with five copies of every key. Press A on any of them and the machine sees the same A.
With a plural architecture, a keyboard could belong to a framebuffer. Give each person a keyboard and a screen, and several people can type into the same machine at once, each in their own session. The hacker-movie setup, with a few people around one box hammering on separate keyboards, is something the hardware has supported since USB. The console cannot do it, because the console has one display device and one super keyboard.
The irony is that Unix started out plural. The original machines had one CPU and a room full of terminals, each with its own keyboard and its own screen, and many people typing at once was the whole point of a time-sharing system. The PC collapsed that to one seat, and the kernel kept the collapse long after the hardware went back to supporting many. Linux has multiseat support in its session manager, which assigns keyboards and GPUs to seats in userland. The console underneath on FreeBSD still has one seat, and anything more has to be assembled above it.
Devices With No Drawer¶
A keyboard at least has a drawer to go into. The kernel sorts devices into drawers: display, network, storage, input, sound. A whole family of hardware fits in none of them.
My build server has a Coral Edge TPU in it. On Linux, it uses a framework called gasket with a driver called apex on top. They lived in the staging tree from 4.19 to 5.12 and were removed in 5.13 as abandoned. Since then the driver lives out of tree, and Google archived its repository in April 2026. On FreeBSD there was nothing, so I wrote a gasket framework and an apex driver on top of it. Both are in review now, and Adrian Chadd bought a Coral just to test my diff. The first goal is to land it. The second is bigger: a framework for anything that can compute, TPUs and NPUs included, so the next accelerator plugs into something that already exists.
NPUs are the same story at a bigger scale. Linux finally admitted the problem in 6.2 with a new subsystem, drivers/accel, and device nodes of its own under /dev/accel/. The first release shipped the framework with no drivers in it. Habana’s Gaudi driver moved in and Intel’s NPU driver arrived in 6.3, Qualcomm’s AI 100 followed in 6.4, and AMD’s XDNA in 6.14. Linux at least built the drawer. FreeBSD has no equivalent in base yet, so every accelerator invents its own character device and its own ioctl soup. That is the drawer I want to build.
Compute GPUs never got a drawer either. They ride the graphics stack’s render nodes, a graphics interface used for work that has nothing to do with graphics.
FPGAs are the strangest case. Load one bitstream and the card is a network interface. Load another and it is a crypto engine. The device model assumes a device knows what it is when the driver probes it. An FPGA changes what it is while the system is running.
One CPU, Many Kinds¶
The CPU has the opposite problem: it has a slot, and the slot assumes too much. I need to be careful here, because “the kernel assumes one CPU” is a sentence that gets you corrected by people who were running SMP in 1996. The kernel has known about multiple CPUs for decades. What it assumes is that they are all the same.
They are not. My desktop runs an i9-14900K: 8 performance cores and 16 efficiency cores, 32 threads in total. Intel even ships hardware feedback that tells the OS which core suits which work. FreeBSD’s ULE scheduler does not use it. As of today it treats all 24 cores as identical. Patches for hybrid awareness have been posted since 2024, and none of them are merged.
Hybrid cores at least get a scheduler slot, even a wrong one. Some processors in the machine get none, because the kernel does not even count them.
The Computers You Never Boot¶
Every Intel machine since the mid-2000s contains a second computer in the chipset, the Management Engine, with its own firmware and its own operating system. Its architecture depends on the year you bought the board. The first generations ran on ARC cores. From ME 11 onward, starting with Skylake in 2015, it is a small 32-bit x86 core running a derivative of MINIX. The low-power Bay Trail chips used a SPARC core for the same job. Intel kept the job and swapped the instruction set underneath it.
AMD’s version is the Platform Security Processor, an ARM Cortex-A5 with TrustZone inside your x86 CPU. It boots first from its own ROM and verifies the firmware before it releases the x86 cores from reset. Recent AMD firmware for Zen 6 mentions a trusted environment based on RISC-V, so even that answer is starting to change.
So “x86 machine” describes the cores the OS happens to run on. Something else runs first, on an architecture the kernel never sees and has no way to drive. The machine was multi-architecture all along. The kernel just never looked.
Same Bet, Twice¶
Sometimes the other architecture is the whole machine. I own an Itanium and an Elbrus. I bought them because they were cheap, and they were cheap because nobody needs them. A dead architecture is one the market stopped paying for, and the price tag tells the whole story.
They are the same bet, made twice. Both are wide-issue designs, VLIW in Elbrus and what Intel called EPIC in Itanium, built to replace x86 while still running x86 code.
Itanium was Intel’s own exit from x86. The early chips ran 32-bit x86 code in hardware. Starting with Montecito in 2006, Intel removed that and moved x86 compatibility into software, the IA-32 Execution Layer. Then the world moved on from Itanium itself. FreeBSD dropped ia64 in 11.0 in 2016. Linux removed it in 6.7 in 2024.
Elbrus kept the idea alive. It runs x86 code through binary translation, either a whole x86 operating system through Lintel or individual Linux binaries through a second translator, with help from the hardware, which implements x86 memory modes and 80-bit floating point so the translator does not have to fake them. The company that owned x86 tried to leave it and gave up. x86 compatibility ended up as a translation layer on a foreign architecture, and that is the Jenga tower again at CPU scale. The compatibility block outlived the architecture it was built to protect.
Elbrus is not alone. Loongson went from MIPS to its own LoongArch in 2021 and added instructions specifically to speed up translating x86 and ARM code. Baikal shipped MIPS in one generation and ARM in the next, then went bankrupt in 2023. Add a GPU from whoever would sell one and firmware from a third vendor, and you get machines that are a mix of everything, built because the singular was not available to them.
Plural First¶
None of this needs one magic design. It needs a habit: write the framework first, and write it for many.
video(4) already works that way, as I described last time. The compute framework and the gamepad rework are where I apply it next. Every accelerator on FreeBSD gets a drawer instead of its own ioctl soup, and each controller becomes one object with many functions instead of four strangers.
The rule underneath is to assume plurality from the first line of code. A GPU may have six outputs or none, and a device may span two buses. Make the single case the special one.
Somebody will have to delete a lot of quirks to get there, and somebody’s PS3 will stop booting. I know who will be holding the broom.
🔗Interstellar Communications
No transmissions detected yet.Be the first to establish contact!
Related Posts
The Jenga Tower of Drivers
Your SSD still introduces itself as spinning rust. The platters, not the language. Your WiFi card and your GPU run their own computers, and the driver stack holding all of it together is a forty-year Jenga tower. Time to stop stacking.
SeurOS: The Operating System I Never Wrote
One vain question to ChatGPT became four months, $8,000, and 20,000 commits of an operating system that only loved one ThinkPad. Then came the autopsy: borrowed kernels, erased attribution, and a filesystem I reinvented years after Matthew Dillon shipped HAMMER. From SeurOS to GaslightOS, my Linux phone experiment with voice control and three hours of battery life, this is how I learned that generating code is not authorship, booting is not proof, and the reading is the work.
flashrom 2.0 Will Ask Your Chip for Its Papers
flashrom 1.8.0 shipped three days ago. There won't be a 1.9.0. The next release is 2.0.0, exactly 25 years after the first commit, and it ships with a model that never hallucinates, scores 100% on chip identification, and fits in a PDF.