0

Is it technically possible to write a kernel module to physically connect a PS/2 keyboard to a USB port using a passive converter? If not, why?

(If I simply wanted my keyboard to work I would buy an active adapter, but the purpose of this question is to learn something)

2
  • Looks like an XY problem. Do you want to connect a PS/2 device to a USB port physically? Or do you want to create a virtual USB device that actually corresponds to your PS/2 device which would be connected to a true PS/2 port? Please add proper details to your question.
    – xhienne
    Aug 17, 2017 at 13:14
  • I want to physically connect a keyboard with a ps/2 plug to a usb-port with a non-active converter. I updated the question.
    – Louic
    Aug 17, 2017 at 13:22

2 Answers 2

2

No.

No USB standard implements backwards compatibility with PS/2. PS/2 mice which predate USB do not contain time-travelled USB descriptors. Nor can an arbitrary USB port be accessed as a GPIO.

USB descriptors: https://blog.digital-scurf.org/posts/stm32-and-rtfm/

https://en.wikipedia.org/wiki/Gpio & https://en.wikipedia.org/wiki/Bit_banging

(Wiki links aren't going to be great, but the introductions here should give the idea).

Converting the opposite way round, passive USB to PS/2 converters require USB support in the USB input device, and recent USB devices don't bother with it: https://en.wikipedia.org/wiki/PS/2_port#Conversion_between_PS.2F2_and_USB

5
  • This is wrong. Enabling "legacy usb" in BIOS let's you use passive USB/PS2 (pin to pin) converters. And they work on windows. No usb logic in them.
    – Zibri
    Mar 13, 2023 at 21:08
  • Congratulations. It would indeed be technically possible to write a kernel module that allows that to work. In fact you could write it in any language! Python would be a good example of a language where this program can be written in zero bytes. :-P.
    – sourcejedi
    Mar 13, 2023 at 22:44
  • Usually when I've seen "legacy USB" in BIOS, it's to allow using a USB device in an OS which only supports PS/2. Did you check that disabling "legacy USB" actually stops this alleged antique wonder from working? You might find the option is not actually necessary for this.
    – sourcejedi
    Mar 13, 2023 at 22:49
  • Pictures would also be very interesting :-).
    – sourcejedi
    Mar 13, 2023 at 22:51
0

Enabling "legacy usb" in BIOS let's you use passive USB/PS2 (pin to pin) converters. And they work on windows.

I've never tried with linux though.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .