Live data from Hacker News

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

werwolv.net

41–50 of 57 posts

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

#41
post #14

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

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.)

I enjoy that because I have my browser monospace font set to be one that also has those ligatures, your comment isn't enlightening at all (I set it up that way though, so it's not a problem for me :P )

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

#43
post #29
post #13

Earlier quoted context omitted.

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.

No need to pretend to be HID. Windows has WinUSB for userspace USB drivers that don't need special signing.

iirc sending HID feature reports doesn’t need admin rights on windows

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

#44
post #14

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

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.)

Why would anybody think more words more better?

    int main() {

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

#45

Perfect timing. I'm expecting to get my hands on a MOTU MIDI Express XT from my local Guitar Center within the next couple days (I paid for it when it arrived there a couple weeks ago, but they have a mandatory waiting period on used equipment to make sure it ain't stolen), which unfortunately uses some weird proprietary protocol instead of class-compliant MIDI-over-USB — so any use over USB from my PCs (nearly all o…

I could be misremembering but I believe the guitar center waiting period isn't _just_ to make sure it's not stolen (I kind of doubt they're actually doing anything like an investigation) but also because legally their used equipment side of business has to operate like a pawn shop, in that they aren't allowed to sell something they've "bought" until after the window for the pawner to buy it back expires.

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

#46
post #6

Earlier quoted context omitted.

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'…

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 m…

[flagged]

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

#48
post #44

Earlier quoted context omitted.

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.)

Why would anybody think more words more better? int main() {

The trailing return type pattern was added to the standard, IIRC, to make it easier for templated functions to have return types that depend on the types of the arguments, such as in this example:

    template 
    auto multiply(A a, B b) -> decltype(a * b) {
        return a * b;
    }
Its easier for the compiler to parse everything if `decltype(a * b) occurs _after_ the definition of `a` and `b`. Once this pattern was added and people started using it for that purpose, people also started using the pattern for all functions for consistency.

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

#49

Perfect timing. I'm expecting to get my hands on a MOTU MIDI Express XT from my local Guitar Center within the next couple days (I paid for it when it arrived there a couple weeks ago, but they have a mandatory waiting period on used equipment to make sure it ain't stolen), which unfortunately uses some weird proprietary protocol instead of class-compliant MIDI-over-USB — so any use over USB from my PCs (nearly all o…

I have had significant success using Claude to reverse engineer hardware
Post reply on HN