#USB keyboards can't interrupt the CPU themselves, but the USB controller continuously polls them and will interrupt it on their behalf. Loudly.

#keyboard #shitpost

Welp, my most boosted toot of all time is a #shitpost about #keyboard interrupts. 😵
@argv_minus_one This one will always be hilarious
What Is 'Lord Marquaad E' And Why Is Markiplier's Face On Lord Farquaad? An Inscrutable Relic From Meme History Explained

A meme that only made sense in the late 2010s, and even then it was... a lot to unpack.

Know Your Meme

@svavar @argv_minus_one "only made sense in the late 2010s"

I would say the phrase "made sense" is doing a lot of work here.

@argv_minus_one Better than not receiving interrupts at all
@[email protected] @[email protected]
Why? User interaction distracts the computers from doing really important things. We should seriously consider banning USB 😏
@m0xEE @argv_minus_one You're right, what gives us the right to interrupt the cpu's very important add instruction
@[email protected] @[email protected]
Exactly!
"M-m-mkay, I've been procrastipolling the keyboard all day 🥺" — who needs a slacker computer like that? Let the little guy get the job done!
@argv_minus_one Wasn't that meme about PS/2 keyboards ?

@fcalva

I've heard that the PS/2 keyboard interface has a dedicated interrupt line, but that doesn't appear to be true. https://electronic-engineering.ch/microchip/datasheets/pinout/pinout.html#keyboard_5

Pinouts of various connectors

@argv_minus_one @fcalva Hi, old timer who wrote my own keyboard driver in assembler for a DOS game engine:

- technically, yes: the PS/2 mini DIN port and the older AT DIN port don't have an IRQ line themselves, they are merely some type of bidirectionnal serial.

BUT

- They talk to a keyboard controller at the other end of this serial connection (used to be an Intel 8042 micro controller), and that absolutely DOES fire IRQ 2 whenever there's data from the keyboard.

@argv_minus_one @fcalva so PS/2 do have an IRQ (2), it's just not handled by the keyboard (as you pointed out) but by a microcontroller on the motherboard.

(and the PS/2 protocol natively supports N-key rollover. Another advantage over USB)

@dryak

USB is pretty much the same story: the controller on the motherboard is what signals an interrupt.

There is the difference that the USB controller doesn't necessarily have a dedicated line to the keyboard (there might be a hub in the way) and therefore resorts to polling, but there's still a keyboard interrupt.

@fcalva

@dryak

USB does support n-key rollover. But only if the keyboard implements the full HID protocol.

Most keyboards implement only the HIDBP protocol, not full HID. HIDBP is much simpler but it has only 6 slots for reporting which keys are currently pressed.

@fcalva

@dryak

I do have a keyboard that supports full HID and has n-key rollover, but it has to be toggled on by pushing a button on the keyboard.

I vaguely remember that this is because some BIOSes and/or OSes will try to switch over to full HID but not actually receive keystrokes properly because their full-HID implementation is buggy.

To work around this, the keyboard initially sends keystrokes over HIDBP. It only sends keystrokes over HID when the button is pushed to enable it.

@fcalva

@argv_minus_one damn, we have the "d.bug" anime version of this meme, now we need to commission someone for the cyberpunk version for the caption above...
@argv_minus_one Alt text helped me to really understand the joke