
i've always been curious about how to write a Linux USB device driver and this blog post looks like a great intro: https://crescentro.se/posts/writing-drivers/
i've always been curious about how to write a Linux USB device driver and this blog post looks like a great intro: https://crescentro.se/posts/writing-drivers/
@b0rk I spent a lot of time breaking Linux USB device drivers
Maybe I should write one too :neobot_woozy:
@b0rk ooh, interesting! Last time I wrote a device driver for Linux was Lo Those Many Decades Ago so I'm sure everything has changed, and USB didn't even exist back then. I guess debugging is either gonna be a lot harder than sticking oscilloscope probes on the bus, like the last driver I wrote, or a lot easier :rofl:
@b0rk I would be curious to know the answer to a question that’s been in the back of my mind for years: does device driver code have to be a horrible mess of endless switch-case statements and weird edge cases? A long time ago I had a look at some Linux device drivers and I felt really sorry for the people who wrote them. 😳
@b0rk Once in the past I wrote a fake USB host driver for April Fool's. Including pictures where to solder the wires. Yes, the hardware had support for USB, but the pins where all used for other stuff.
@b0rk It's an interesting article, but I would like to clarify it talks about *userspace* drivers, not about *kernel* drivers. I am highlighting this since when I think about *device drivers* I am thinking about kernel development by default, and that's not the case here.