500
The good old days (sub.wetshaving.social)
you are viewing a single comment's thread
view the rest of the comments
[-] waigl@lemmy.world 134 points 14 hours ago* (last edited 14 hours ago)

This is x86 assembler. (Actually, looking at the register names, it's probably x86_64. On old school x86, they were named something like al, ah (8 bit), ax (16 bit), or eax (32 bit).) Back in the old days, when you pressed a key on the keyboard, the keyboard controller would generate a hardware interrupt, which, unless masked, would immediately make the CPU jump to a registered interrupt handler, interrupting whatever else it was doing at the point. That interrupt handler would then usually save all registers on the stack, communicate with the keyboard controller to figure out what exactly happened, react to that, restore the old registers again and then jump back to where the CPU was before.

In modern times, USB keyboards are periodically actively polled instead.

[-] WhyJiffie@sh.itjust.works 17 points 11 hours ago

does that mean though that if I connect a PS/2 keyboard or mouse to my relatively modern computer (a "gamer" motherboard made ~6 years ago) 's PS/2 port, that it'll still trigger such an interrupt?

[-] Colloidal@programming.dev 9 points 11 hours ago

I think there's a USB device inside the mobo to handle dumb peripherals. So it would still trigger an interrupt, but it wouldn't make it to the CPU. The USB keyboard controller would handle it and cache the strokes locally until polled by the CPU.

[-] grue@lemmy.world 5 points 11 hours ago

I would expect that any motherboard that went to the trouble of including a PS/2 port would handle it with a real hardware interrupt, because the whole point of still having those things is to avoid the latency overhead of USB.

[-] kopasz7@sh.itjust.works 8 points 9 hours ago

Largely an urban legend. The internal electronics of the keyboard/mouse matter more than the protocol for end to end latency.

There are USB keyboards that beat a PS/2 one, at just 125 Hz polling. 1000 Hz polling pulls ahead even more.

https://www.youtube.com/watch?v=eEswl6kZq5k&t=650

load more comments (4 replies)
load more comments (7 replies)
this post was submitted on 23 May 2025
500 points (100.0% liked)

linuxmemes

25040 readers
1893 users here now

Hint: :q!


Sister communities:


Community rules (click to expand)

1. Follow the site-wide rules

2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack users for any reason. This includes using blanket terms, like "every user of thing".
  • Don't get baited into back-and-forth insults. We are not animals.
  • Leave remarks of "peasantry" to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry will not be tolerated.
  • 3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn, no politics, no trolling or ragebaiting.
  • 4. No recent reposts
  • Everybody uses Arch btw, can't quit Vim, <loves/tolerates/hates> systemd, and wants to interject for a moment. You can stop now.
  • 5. ๐Ÿ‡ฌ๐Ÿ‡ง Language/ัะทั‹ะบ/Sprache
  • This is primarily an English-speaking community. ๐Ÿ‡ฌ๐Ÿ‡ง๐Ÿ‡ฆ๐Ÿ‡บ๐Ÿ‡บ๐Ÿ‡ธ
  • Comments written in other languages are allowed.
  • The substance of a post should be comprehensible for people who only speak English.
  • Titles and post bodies written in other languages will be allowed, but only as long as the above rule is observed.
  • 6. (NEW!) Regarding public figuresWe all have our opinions, and certain public figures can be divisive. Keep in mind that this is a community for memes and light-hearted fun, not for airing grievances or leveling accusations.
  • Keep discussions polite and free of disparagement.
  • We are never in possession of all of the facts. Defamatory comments will not be tolerated.
  • Discussions that get too heated will be locked and offending comments removed.
  • ย 

    Please report posts and comments that break these rules!


    Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't remove France.

    founded 2 years ago
    MODERATORS