[HN Gopher] Writing a basic Linux device driver when you know no...
       ___________________________________________________________________
        
       Writing a basic Linux device driver when you know nothing about
       Linux drivers
        
       Author : sbt567
       Score  : 122 points
       Date   : 2025-06-22 10:29 UTC (3 days ago)
        
 (HTM) web link (crescentro.se)
 (TXT) w3m dump (crescentro.se)
        
       | ianlevesque wrote:
       | It's a userspace USB HID driver in rust, which is honestly more
       | interesting/applicable to me than a kernel driver, which is what
       | I thought it meant from the title.
        
       | ahartmetz wrote:
       | > I also thought I'd message the vendor and ask them if they
       | could share any specifications or docs regarding their protocol.
       | To my surprise, Nanoleaf tech support responded to me within 4
       | hours, with a full description of the protocol that's used both
       | by the Desk Dock as well as their RGB strips.
       | 
       | How cool is that? Too many vendors still think that they have
       | valuable intellectual property in such relative trivialities. And
       | that handing out the specs freely helps their competitors more
       | than themselves.
        
         | starkrights wrote:
         | I had the same reaction. Nano leaf is extremely cool for that.
        
           | baby_souffle wrote:
           | This has to put them in the top 0.01% of companies that make
           | consumer electronics.
           | 
           | I can think of only a few companies that bother to publish
           | any details... And most of them are focused on industrial
           | customers where it isn't unreasonable to need certain
           | protocol details for integration or even just compliance with
           | certain regulatory systems.
           | 
           | Maybe things are changing?
           | 
           | I have noticed that some of the LED light controllers you see
           | on AliExpress are leaning in to open firmware standards. 5
           | years ago, you bought the controller and had to flash your
           | own firmware. Now, there's an option at checkout to select an
           | open source firmware. Some even have a USB port built in for
           | flashing!
        
       | jonnypotty wrote:
       | Thanks for this. Good read and also kinda inspiring.
        
       | dabedee wrote:
       | I really enjoyed the way this post was written, i.e. it includes
       | the code, how it was run, the false paths, etc. You almost get to
       | live through the author's journey and how he figured out just
       | enough to get something working.
        
       | kblissett wrote:
       | I enjoyed this post, but I'm eager to hear what the next step
       | would be for a real "production" userspace driver. Are these
       | typically just daemons that are configured to run at start up?
       | And then some configuration GUI communicates with it over a
       | socket or something?
        
       | shreddit wrote:
       | > Let's run it again to make sure it was not a fluke!
       | 
       | I understood that reference
        
       | 0xbadcafebee wrote:
       | I want to run FreeBSD on my laptop, but they don't have a
       | [complete] driver for my wifi card. I've thought about diving
       | into AI coding-assistant agents just to see if I could use one to
       | finish throwing together a working driver... but figuring out the
       | AI agents is frictiony enough that I'm leaving it be. (I'm not a
       | VSCode user)
        
       | LorenDB wrote:
       | The author should probably have implemented support in OpenRGB
       | instead to better benefit others, but this is cool nonetheless.
        
       ___________________________________________________________________
       (page generated 2025-06-25 23:00 UTC)