I cannot find any online resources for learning driver development. Do I have to read x86/arm spec + pcie spec + acpi spec + usb spec? How similar is the driver development story for x86 and arm?
Depends on what you’re doing I guess. I finished writing my first Linux driver recently. A character device that interfaces with an FPGA via PCIe. No assembly language required. The Linux Device Driver book gave more than enough of an overview of PCI to understand what to do without reading the PCIe spec. Like anything you have to do deep dives when needed. I ended up having to learn a bit about the encoding and overhead of data sent on the PCIe bus when we were trying to understand some bandwidth issues we were having. I’ve done a decent bit of embedded work. You’re more likely to have the data sheets for the device you’re working on printed out and marked up than you are the spec for whatever bus the device uses.
> The Linux Device Driver book gave more than enough of an overview of PCI to understand what to do without reading the PCIe spec.
This book comes up a lot for the topic but is it still good? My understanding is that it’s for a rather old kernel version. And I’ve had drivers that couldn’t even compile between minor version differences in the target vs the kernel I was on.
Many drivers are written in C, but you still need to know the underlying assembly code.
At one point, Windows split driver development into 2 types. One at the user level and one in the OS.
Rumor was this was because of printers. Most of the calls for support at MS (blue screen of death) were caused by printer drivers. By moving them out of the OS and into user space the drivers only crashed their application.
I recall there once was a USB driver development kit you could buy. Not sure if it was tied to an OS. But it was a physical device you would plug into a USB port. Cost was like $100-
> Do I have to read x86/arm spec + pcie spec + acpi spec + usb spec?
Pretty much, yeah. There's a reason not everyone is sitting around writing hardware drivers.
The alternative is reading through Linux kernel code. However it typically requires you digging through many layers of abstractions to get a fuller picture.
Generally, x86 is generally more mature, and the specs tend to be fairly large. ARM documentation should be a little simpler to dig into.
I'm no expert, but what do you want to write drivers for ? At the simplest level you can create a Linux device driver that has no corresponding hardware, in which case C will be perfectly adequate and no bus knowledge needed.
If you're just intellectually interested, I'd suggest starting with that and then create some toy hardware project on an Arduino and create a USB driver for it.
I infer from the downvote that I phrased badly - not "what for?" in the uncurious sense of "what loser would want that without a need?", but rather "is this for a specific purpose that would constrain you or purely for joy?"