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/
81•WerWolv•2h 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•59m 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•56m 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•51m 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•32m 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•1h 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•55m 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•47m 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•36m 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•26m ago
The C++ looks messed up. I have yet to come across a keyboard that can type an arrow.
Something1234•20m ago
Some developers like ligature based fonts. They combine 2 characters into one glyph
tosti•13m ago
Thank you and the others who were kind enough to explain this. I've avoided such fonts like the plague. Didn't know it did arrows like that.
quietbritishjim•20m ago
It's just a programming font ligature. If you copy and paste it you'll see the actual characters e.g.

   auto main() -> int {
(It's also modern C++ trailing return type.)
bheadmaster•17m ago
It's just "->" - the ligature font just renders it as a unitary arrow

I ported Mac OS X to the Nintendo Wii

https://bryankeller.github.io/2026/04/08/porting-mac-os-x-nintendo-wii.html
946•blkhp19•5h ago•186 comments

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

https://werwolv.net/posts/usb_for_sw_devs/
84•WerWolv•2h ago•15 comments

Git commands I run before reading any code

https://piechowski.io/post/git-commands-before-reading-code/
1604•grepsedawk•12h ago•348 comments

Understanding the Kalman filter with a simple radar example

https://kalmanfilter.net
137•alex_be•4h ago•21 comments

Muse Spark: Scaling towards personal superintelligence

https://ai.meta.com/blog/introducing-muse-spark-msl/?_fb_noscript=1
196•chabons•5h ago•249 comments

Expanding Swift's IDE Support

https://swift.org/blog/expanding-swift-ide-support/
40•frizlab•2h ago•20 comments

Pgit: I Imported the Linux Kernel into PostgreSQL

https://oseifert.ch/blog/linux-kernel-pgit
35•ImGajeed76•3d ago•3 comments

They're made out of meat (1991)

http://www.terrybisson.com/theyre-made-out-of-meat-2/
325•surprisetalk•10h ago•98 comments

Veracrypt project update

https://sourceforge.net/p/veracrypt/discussion/general/thread/9620d7a4b3/
1054•super256•14h ago•391 comments

ML promises to be profoundly weird

https://aphyr.com/posts/411-the-future-of-everything-is-lies-i-guess
296•pabs3•8h ago•334 comments

MegaTrain: Full Precision Training of 100B+ Parameter LLMs on a Single GPU

https://arxiv.org/abs/2604.05091
235•chrsw•9h ago•43 comments

Škoda DuoBell: A bicycle bell that penetrates noise-cancelling headphones

https://www.skoda-storyboard.com/en/skoda-world/skoda-duobell-a-bicycle-bell-that-outsmarts-even-...
462•ra•12h ago•502 comments

Understanding Traceroute

https://tech.stonecharioteer.com/posts/2026/traceroute/
57•stonecharioteer•2d ago•2 comments

What does ⍋⍋ even mean? (2023)

https://blog.wilsonb.com/posts/2023-08-04-what-does-grade-grade-even-mean.html
7•tosh•3d ago•1 comments

Show HN: Orange Juice – Small UX improvements that make HN easier to read

http://oj-hn.com/
50•latchkey•3h ago•77 comments

I've been waiting over a month for Anthropic to respond to my billing issue

https://nickvecchioni.github.io/thoughts/2026/04/08/anthropic-support-doesnt-exist/
192•nickvec•3h ago•98 comments

Who is Satoshi Nakamoto? My quest to unmask Bitcoin's creator

https://www.nytimes.com/2026/04/08/business/bitcoin-satoshi-nakamoto-identity-adam-back.html
199•jfirebaugh•17h ago•105 comments

John Deere to pay $99M in right-to-repair settlement

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

Show HN: Skrun – Deploy any agent skill as an API

https://github.com/skrun-dev/skrun
22•frizull•9h ago•7 comments

Ask HN: Any interesting niche hobbies?

185•e-topy•3d ago•310 comments

US cities are axing Flock Safety surveillance technology

https://www.cnet.com/home/security/when-flock-comes-to-town-why-cities-are-axing-the-controversia...
570•giuliomagnifico•9h ago•330 comments

Microsoft terminates VeraCrypt account, halting Windows updates

https://www.404media.co/microsoft-abruptly-terminates-veracrypt-account-halting-windows-updates/
389•donohoe•6h ago•158 comments

Show HN: Unicode Steganography

https://steganography.patrickvuscan.com
35•PatrickVuscan•1d ago•8 comments

Teardown of unreleased LG Rollable shows why rollable phones aren't a thing

https://arstechnica.com/gadgets/2026/04/teardown-of-unreleased-lg-rollable-shows-why-rollable-pho...
63•DamnInteresting•1d ago•28 comments

We moved Railway's frontend off Next.js. Builds went from 10+ mins to under 2

https://blog.railway.com/p/moving-railways-frontend-off-nextjs
152•bundie•15h ago•145 comments

Study investigates how mass distribution of baseball bat affects performance

https://news.wsu.edu/press-release/2026/04/02/science-confirms-torpedo-bat-works-as-well-as-regul...
18•Magi604•5d ago•17 comments

Show HN: TUI-use: Let AI agents control interactive terminal programs

https://github.com/onesuper/tui-use
29•dreamsome•4h ago•25 comments

Revision Demoparty 2026: Razor1911 [video]

https://www.youtube.com/watch?v=Lw4W9V57SKs&t=5716s
339•tetrisgm•16h ago•119 comments

Audio Reactive LED Strips Are Diabolically Hard

https://scottlawsonbc.com/post/audio-led
172•surprisetalk•1d ago•53 comments

Union types in C# 15

https://devblogs.microsoft.com/dotnet/csharp-15-union-types/
149•0x00C0FFEE•3d ago•143 comments