• Deebster@infosec.pub
    link
    fedilink
    arrow-up
    1
    ·
    2 days ago

    I was always told that you shouldn’t (dis)connect a keyboard when it was on because it could short circuit and fry something. This was before USB, of course.

    • merc@sh.itjust.works
      link
      fedilink
      arrow-up
      2
      ·
      2 days ago

      Starting around the time of USB, they started designing plugs so that the parts of the plug that carried power were slightly longer than the parts that carried data so that as you plugged it in, the power connected before the data. That wasn’t something that was done with old connectors. In those, everything was the same length, so everything connected at once.

      OTOH, USB is a more complicated protocol than the old serial / keyboard protocols. I think generally systems were built well enough that you were unlikely to “fry” something by plugging in or unplugging something like a keyboard while it was running. Especially because the keyboards used low current and low voltage. And computers used big discrete resistors, capacitors, etc. back in those days. But, you could get some bad data on the keyboard line.

      • Deebster@infosec.pub
        link
        fedilink
        arrow-up
        1
        ·
        2 days ago

        Interesting stuff about the plugs, thanks.

        I did quickly fact-check myself after posting and my brief reading suggested that it was possible to break the port, motherboard, or the peripheral, but that it was rare and more likely to cause corruption and/or crashes.

        E.g. some anecdata in https://superuser.com/questions/172420/is-it-safe-to-hot-swap-a-ps-2-keyboard and https://electronics.stackexchange.com/questions/50883/why-some-computer-peripherals-should-not-be-disconnected-without-turning-off-thi

        • merc@sh.itjust.works
          link
          fedilink
          arrow-up
          2
          ·
          2 days ago

          and more likely to cause corruption and/or crashes.

          Yeah, that’s the neat trick they basically solved by making the power connectors longer. If everything connects at the same time, you connect the data lines while power is still coming up, meaning there’s a few milliseconds of data that you can’t really trust. If the hardware and software on the other side is designed to “trust” the data from the keyboard, who knows what could happen. Probably not something that breaks the hardware, but definitely something that can result in unexpected data for the software.

          But, just by adding a few millimeters to the power lines, you give a few milliseconds of power getting stable before data is attached, and that’s enough for things to be nice and stable.