• waigl@lemmy.world
      link
      fedilink
      arrow-up
      210
      ·
      8 months 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.

      • starman2112@sh.itjust.works
        link
        fedilink
        arrow-up
        90
        ·
        8 months ago

        The virgin USB: hey, uh, when you get a chance, uh, if it’s not too much trouble, could you, uh, put an ‘e’ there? Whenever you get the chance is fine

        The chad PS/2: THE USER SAID E.

      • WhyJiffie@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        29
        ·
        8 months 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?

        • atomicbocks@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          29
          ·
          8 months ago

          The other commenter is on the right track but the chip controls both USB and PS/2 as well as others;

          In the 90s and 2000s, for x86 machines, slower I/O was handled by a chip called the Southbridge which worked in conjunction with a chip called the Northbridge that handled faster I/O like IDE and PCI. Later these were integrated into a single chip and, as of recent processor generations, into the processor itself.

          AFAIK ghosting and key rollover are issues when using PS/2 but it can offer some milliseconds off latency when used in high cpu games.

          • DeRp_DaWg@lemmy.world
            link
            fedilink
            arrow-up
            10
            ·
            8 months ago

            AFAIK ghosting and key rollover are issues when using PS/2

            I think it’s more of an issue for USB keyboards than PS/2 keyboards.

            • herrvogel@lemmy.world
              link
              fedilink
              arrow-up
              18
              ·
              8 months ago

              They are wholly independent from the protocol or interface. Ghosting is an electrical issue that is a result of keyboards being a bunch of switches arranged in a matrix. It makes the keyboard’s controller register an extra keypress in certain conditions. Nothing to do with how the thing communicates with the host computer.

              Key rollover issues can be related to ghosting. The limit for it is once again the keyboard’s design at the circuit level, not its communication protocol.

              Really they’re both related to how cheaply built the keyboard is. That’s the only thing.

        • Colloidal@programming.dev
          link
          fedilink
          English
          arrow-up
          14
          ·
          8 months 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
            link
            fedilink
            arrow-up
            9
            ·
            8 months 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.

              • MonkderVierte@lemmy.ml
                link
                fedilink
                arrow-up
                3
                ·
                8 months ago

                But honestly, 1000 Hz polling is just for bigger numbers game. Even 300 ms are barely noticeable by humans, not to mention 10 ms of 100 Hz.

            • Pup Biru@aussie.zone
              link
              fedilink
              English
              arrow-up
              3
              ·
              8 months ago

              there are loads of things in the gamer space that are just branding BS… i could definitely see dodgy (or honestly even reputable) motherboard manufacturers adding PS/2 ports that are just basically a USB dongle built into the board and adding $40 for the dubious privilege

        • falcunculus@jlai.lu
          link
          fedilink
          arrow-up
          6
          ·
          8 months ago

          My guess would be yes, the whole point of including a legacy port like this would be compatibility. Laptops used (still use?) PS/2 long after desktops moved to USB keyboards because the lack of polling meant improved battery life, so it’d make sense for the hardware support to still be there.

        • Klear@lemmy.world
          link
          fedilink
          English
          arrow-up
          12
          ·
          8 months ago

          Oh, you’re right! I completely forgot that was a thing. But I do remember the “keyboard not found, press f1” message.

      • lunachocken@lemm.ee
        link
        fedilink
        arrow-up
        12
        ·
        8 months ago

        I had to write a mini os and it handled keyboard interrupts. Certainly made it make a lot more since after writing it for my uni course

      • chrisbtoo@lemmy.ca
        link
        fedilink
        arrow-up
        6
        ·
        8 months ago

        Thanks for the explanation. Ironically this was the bit I didn’t know:

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

        I was thinking the implication was that some computer had faulty interrupt handling that would smash the status register or something.

        Honestly I think I’m just too old to understand memes.

    • Something Burger 🍔@jlai.lu
      link
      fedilink
      arrow-up
      33
      ·
      8 months ago

      The small bird is a CPU executing its instructions. The big bird is a keyboard sending an interrupt for the CPU to process immediately.

    • killeronthecorner@lemmy.world
      link
      fedilink
      English
      arrow-up
      24
      ·
      8 months ago

      Think of it like breaking news for your processor

      “WE INTERRUPT THE CURRENTLY RUNNING APPLICATION TO BRING YOU THIS MESSAGE: e”

  • istdaslol@feddit.org
    link
    fedilink
    arrow-up
    47
    ·
    8 months ago

    And their interrupt routine has an error that leads to changed memory and you don’t know why your Programm calculates „2+6=E“ and that only sometimes on every other run.

    • perishthethought@lemm.ee
      link
      fedilink
      English
      arrow-up
      8
      ·
      8 months ago

      !!! I just learned about this recently because my PC has an Nvidia GPU and it sometimes wakes up from sleeping to a blank screen with just the mouse cursor showing.

      I try that REISUB first but if that doesn’t do anything, I have to go to Ctrl-Alt-F3 and do “sudo reboot”.

      Linux is fun except for when it’s not.

      • hddsx@lemmy.ca
        link
        fedilink
        arrow-up
        7
        ·
        8 months ago

        I’m confused. Why would you REISUB/O if you can use the reboot command?

        REISUB is a last resort before hitting the physical power button

          • lime!@feddit.nu
            link
            fedilink
            English
            arrow-up
            11
            ·
            8 months ago

            reisub is not “safe”. it is the “safest” way when your system has reached an otherwise broken state, but you’re still interrupting things that may be saving state or changing configurations. if your system is working behind the scenes you may very well break it more.

          • hddsx@lemmy.ca
            link
            fedilink
            arrow-up
            9
            ·
            8 months ago

            You should really use the reboot command first because you don’t have to control the order and timing. REISU(B/O) requires pauses between letters for the specific action to run. It also requires those letters to be in that particular order - you can’t sync the file system if you put it into read only. If REISUB is sometimes not working but you can go elsewhere and reboot, you’re likely not doing it right and you should err on the side of caution and use the reboot command

      • Trainguyrom@reddthat.com
        link
        fedilink
        English
        arrow-up
        1
        ·
        8 months ago

        I once kept opening new terminal sessions then launching a fresh X session while doing something that had a tendency to crash X. I ended up with about 3 crashed graphical sessions by the time I finished what I was doing and actually rebooted!

      • dual_sport_dork 🐧🗡️@lemmy.world
        link
        fedilink
        English
        arrow-up
        16
        ·
        8 months ago

        Never mind recent motherboards, I’m still salty about the era of boards from 2004-2010 or so which had USB ports but the BIOS would refuse to accept inputs from them until after POST so you’d have to dredge up a separate PS/2 keyboard and jack it in to be able to configure the damn thing or use the boot menu.

        And I had at least one board from that time period which has this same flaw, but with the added layer of joy and excitement that they’ve removed the PS/2 port block in order to appear “modern.” It’s still there, of course, but only as a pin header that you need to access from inside the case and plug a breakout board into. If you lose that board the gods themselves couldn’t even help you. I used to keep it stuck with painters tape to the inside of the case side panel.

        • sylver_dragon@lemmy.world
          link
          fedilink
          English
          arrow-up
          6
          ·
          8 months ago

          Never mind recent motherboards, I’m still salty about the era of boards from 2004-2010 or so which had USB ports but the BIOS would refuse to accept inputs from them until after POST so you’d have to dredge up a separate PS/2 keyboard and jack it in to be able to configure the damn thing or use the boot menu.

          Had one of these in a server rack. Which was all kinds of fun because the rack KVM was USB. We ultimately just left the PS/2 keyboard plugged in and sitting on top of the server in the rack. Given the shitshow which was cable management in those racks (we shared them with several departments), that keyboard was hardly the worst sin.

      • istdaslol@feddit.org
        link
        fedilink
        arrow-up
        6
        ·
        8 months ago

        Don’t want break your illusion but for the most part those were just USB adapters so you didn’t had any of the implementational benefits because under the hood it was still USB

      • grue@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        8 months ago

        I don’t know about AM5, but I’m running a 5700X3D on a motherboard that still has a PS/2 port. (Not that I’m using it, but it’s there.) You can still have a pretty modern system with PS/2 if you really want it.

          • grue@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            8 months ago

            Mine is a B350 – I’m still running the same motherboard I used 7 years ago with my old Ryzen 1700X. Considering how much depends on the CPU these days instead of the chipset, does it even really matter if the chipset is older?

            • fuckwit_mcbumcrumble@lemmy.dbzer0.com
              link
              fedilink
              arrow-up
              1
              ·
              8 months ago

              Chipset itself doesn’t matter, it it dates the board.

              On AM4 basically every board has it. Maybe the really dire boards would skit it, but they’re skipping so much more first. Starting with early AM5 (6XX) and it actually started disappearing and now with 8XX it’s getting much less popular.

              Also how’s your B350 board holding up? My X370 board died after about 3.5 years, and my friends X370 had been acting up after about 5. Maybe the higher end chipsets are cursed? I sure hope my new board lasts because I paid a fuck ton for it.

              • grue@lemmy.world
                link
                fedilink
                arrow-up
                1
                ·
                8 months ago

                Also how’s your B350 board holding up?

                Just fine so far, but thanks a lot for jinxing it! 😠

                It’s a Gigabyte AB350N-Gaming WiFi, which is a mini-ITX board, so having the B-series chipset was probably less about making it cheap and more about the features of fancier chipsets being wasted on a board that didn’t have enough space to implement the connectors for them. Therefore, it might like slightly higher quality than some other B350 boards.

  • Estradiol Enjoyer
    link
    fedilink
    arrow-up
    9
    ·
    8 months ago

    someone should have stolen this meme for my intro computer architecture course it would have helped