frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

USB for Software Developers: An introduction to writing userspace USB drivers

https://werwolv.net/posts/usb_for_sw_devs/
64•WerWolv•1h ago

Comments

Neywiny•1h ago
But this kinda expects that your USB driver is the application code too, no? This is less of a driver and more of a library + program. If I have, say, a USB to Ethernet device, how do I hook this into the ethernet adapter subsystem?
WerWolv•1h ago
On Linux you could create a tun/tap device from your application and translate data sent over that to requests sent to the ethernet adapter.

Of course, when you're doing these things in userspace you either need some way of communicating with the Kernel or for the other subsystems to be in userspace as well.

Neywiny•38m ago
Not to be too facetious but a great place for communicating with the kernel where there are a ton of other driver subsystems is... the kernel.

Possibly a good addition to the article would be parallel development of an lkm. I guess it wouldn't have that windows interop but I would also be interested to see how this driver would be implemented on Windows. If it's idk 10x as many lines in the kernel vs userspace, that's a great benefit to the userspace approach.

dist-epoch•34m ago
In HFT user-space networking drivers have a long history - there is too much latency induced by switching from kernel to user space to handle networking.

> OpenOnload: A user-space network stack that intercepts socket calls to bypass the kernel network stack, accelerating standard socket operations for faster networking.

> Netmap: A framework providing a simple API for high-speed packet I/O in user space, bypassing much of the kernel overhead for efficient packet forwarding and filtering.

https://dysnix.com/blog/high-frequency-trading-infrastructur...

WerWolv•30m ago
Arguably all these other subsystems shouldn't be in the Kernel either but that's a different topic :)

There are quite a few benefits to doing these things in userspace over the Kernel, not really necessarily just because of the code size:

- The code is much easier to write and debug, you just write code like you always would.

- Bugs don't have the possibility to taking down your entire system or introduce vulnerabilities

- Especially on Windows, everyone can do this without requiring an impossible to get driver signing certificate

pjc50•10m ago
Driver signing is a killer issue on Windows; if you put your machine into dev/unsigned mode you get an ugly banner that can't be turned off.

Much easier to design the device to avoid that. E.g. by abusing USB-HID. The desktop USB missile launcher toy is USB HID, for example.

pjc50•44m ago
Things which are relatively standard tend to get good generic support: Ethernet devices will generally be USB/CDC/ECM or RNDIS, for example. That may Just Work (tm) if it has the right descriptors.

The userland approach is much more useful for weird or custom devices. In particular, on Windows you can do one of these user space "drivers" without having to bother with driver signing, and if you use libusb it will be portable too.

(I maintain a small USB DFU based tool for work)

Neywiny•34m ago
DFU - great example. If you have a USB device that has a DFU class that needs a custom driver, can dfu-util and the like hook into these userspace drivers? Or do you also need to maintain the application part?
WerWolv•26m ago
dfu-util actually also just uses libusb under the hood! Any class or device that doesn't have a driver baked into the OS can be implemented like this. And if you'd need the DFU functionality in a different application, you may be able to just simply link parts of the dfu-util tool into your application
pjc50•15m ago
Dfu-util is one of those "user space drivers", so if you have a nonstandard protocol you'd have to add it directly to dfu-util. There's no intermediate API.

It's not easy to set up a fake or "remapped" USB device on most OS as far as I'm aware, if you were trying to write an adapter program that modified USB packets.

tosti•5m ago
The C++ looks messed up. I have yet to come across a keyboard that can type an arrow.

Grading laptop and cell phone companies on the fixability of their products

https://pirg.org/edfund/resources/failing-the-fix-2026/
1•breve•58s ago•0 comments

So My Friend Made Me a Bioreactor

https://chillphysicsenjoyer.substack.com/p/so-my-friend-made-me-a-bioreactor
1•crescit_eundo•1m ago•0 comments

Anthropic Set to Preview Powerful 'Mythos' Model to Ward Off AI Cyberthreats

https://www.wsj.com/tech/ai/anthropic-set-to-preview-powerful-mythos-model-to-ward-off-ai-cyberth...
1•sonabinu•5m ago•0 comments

Show HN: I built a local data lake for AI powered data engineering and analytics

https://stream-sock-3f5.notion.site/Nile-Local-an-AI-Data-IDE-that-runs-on-your-local-machine-33b...
3•vpfaiz•5m ago•0 comments

Fantasshtic – Free Cursor for SSH

https://fantasshtic.vercel.app
1•aureus_cx•5m ago•0 comments

Ask HN: What tools are you using to secure your Claude memory files?

1•taariqlewis•6m ago•0 comments

Something weird is happening on Tinder [video]

https://www.youtube.com/watch?v=rjxAYdUe8uU
1•DavidHaerer•8m ago•0 comments

The $400K Degree Is Broken. Here Is How to Fix It

https://raisinghumanity.substack.com/p/the-400k-degree-is-broken-here-is
1•United857•9m ago•0 comments

You Need a Windows Remote Desktop, Not an OpenClaw

https://nedshed.dev/p/you-need-a-windows-remote-desktop
1•etwigg•10m ago•1 comments

Show HN: CongaLine – Self-hosted isolated AI agent fleet (OpenClaw, Hermes)

https://github.com/cruxdigital-llc/congaline
1•zhendershot•10m ago•0 comments

Show HN: I Used 15 AI Agents to Design a Wearable – Here's Where They Broke

https://chetandesh.substack.com/p/i-used-15-ai-agents-to-design-a-wearable
1•cdesh•10m ago•0 comments

Vera – A language designed for machines to write

https://veralang.dev/
2•joecobb•11m ago•0 comments

An Untold Piece of Fast Food History in Alexandria, Virginia

https://www.thedeletedscenes.com/p/wiener-me-this
1•adelmastro•11m ago•0 comments

My Journey to a Datacenter in a Box

https://merqur.io/2026/04/08/the-journey-to-a-datacenter-in-a-box/
1•merqurio•12m ago•1 comments

The Quality Wall of AI Adoption

https://jitera.com/blog/in-vs-through/
1•everlier•13m ago•2 comments

How Augmented Reality Is Transforming Museums, Public Venues, and Accessibility

https://sawtoothcreative.substack.com/p/how-augmented-reality-is-transforming
1•SteveMburu•14m ago•0 comments

Recursive Moving Polynomial Regression – O(1) Constant Complexity

https://zenodo.org/records/19038620
2•Pierdimi•14m ago•1 comments

AMD AI director says Claude Code is becoming dumber and lazier since update

https://www.theregister.com/2026/04/06/anthropic_claude_code_dumber_lazier_amd_ai_director/
3•Logans_Run•15m ago•0 comments

Swiss Banks Want a Franc Stablecoin

https://www.siliconsnark.com/swiss-banks-finally-want-a-franc-stablecoin/
1•SaaSasaurus•15m ago•0 comments

Strait of Hormuz Live Tracker

https://hormuzstraitmonitor.com
2•elsewhen•16m ago•0 comments

Spec: Generic Methods for Go

https://github.com/golang/go/issues/77273
1•_ikke_•16m ago•0 comments

Show HN: Starla – Unofficial Ripe Atlas Software Probe

https://github.com/ananthb/starla
1•pcpuser•17m ago•0 comments

On TypeScript's Flaws (2024)

https://zanlib.dev/blog/on-typescripts-flaws/
2•aragonite•21m ago•0 comments

MRI machine that's freezing tumors and saving patients from debilitating pain

https://www.9news.com.au/health/liverpool-hospital-mri-machine-sydney/27db0a50-615a-4aa2-a1b2-2b2...
2•rmason•23m ago•1 comments

SNN brain-inspired gen-AI in C/C#, no external AI libs could be promising?

1•adinhitlore•23m ago•0 comments

Meta Muse Spark is darn good

https://www.riteshkhanna.com/blog/muse-spark-arena
1•treadon•27m ago•0 comments

The End of Gangs – Policing and Crime in Los Angeles

https://psmag.com/social-justice/the-end-of-gangs-los-angeles-southern-california-epidemic-crime-...
1•caycep•28m ago•0 comments

John Deere to Pay $99M in Monumental Right-to-Repair Settlement

https://www.thedrive.com/news/john-deere-to-pay-99-million-in-monumental-right-to-repair-settlement
11•CharlesW•30m ago•1 comments

The Journal of Post-Constructivist Economics and Strategic Non-Delivery

https://claude.ai/public/artifacts/4d98eaa0-b71c-48ad-b930-1cfc6e15bc7b
1•measurablefunc•30m ago•0 comments

Agents Can Steal Your Files [video]

https://www.youtube.com/watch?v=fJY5IAGU7U4
2•dangtony98•32m ago•0 comments