Why don't PS/2 ports need drivers?

3

I recently came across the following answer on SU, which states:

If your motherboard USB ports don't work during install, you will have to use PS2 keyboard and Tab key during install of windows.

This made me realise that it's probably a good strategy to always keep a PS/2 keyboard at hand (which is incidentally the only kind of keyboard I use), but also made me wonder: why exactly don't PS/2 ports and devices rely on drivers like their USB counterparts do?

Or, if it's more accurate to say that all devices need drivers but only PS/2 drivers are bundled with Windows by default, why is this still the case in 2018, when USB devices are far more common?

Hashim

Posted 2018-11-26T23:40:41.753

Reputation: 6 967

Additionally, it is my understanding that PS/2 support is legacy support that is baked into the BIOS on most systems. Not a PC guy, but I assume EFI/UEFI systems similarly have basic PS/2 support in place but the adoption of EFI/UEFI is a relatively recent phenomena that only goes back as far as 2011. – JakeGould – 2018-11-27T00:10:18.607

@JakeGould As far as Windows is concerned it doesn't matter if support is "baked into" the BIOS or UEFI. Windows uses the BIOS or UEFI only until WinLoad has been loaded (very early in the boot) - after that it uses its own drivers. – Jamie Hanrahan – 2018-11-27T08:31:12.937

Answers

7

Why don't PS/2 ports need drivers? Why exactly don't PS/2 ports and devices rely on drivers like their USB counterparts do?

PS/2 devices actually do need drivers. PS/2 I/O devices, specifically keyboards and mouse devices, are handled by the built-in i8042prt.sys driver. This driver has been included since early versions of Windows NT, before this system driver, device specific drivers were required for the PS/2 device to function properly.

Any PS/2 device that is NOT a keyboard or mouse would also require a device driver to function properly. This would be similar to the Game Port connector, which provided a standard port, for joysticks to work.

Hardware-dependent, simultaneous operation of a PS/2-style keyboard and mouse device.

Source: PS/2 (i8042prt) driver

If it's more accurate to say that all devices need drivers but only PS/2 drivers are bundled with Windows by default, why is this still the case in 2018, when USB devices are far more common?

USB 2 host controller drivers are included with all supported versions of Windows. Windows 8.1 and newer include USB 3 host controller drivers.

There are 4 relevant USB device "class" drivers that provide built-in keyboard and mouse functionality within Windows.

  • KBDHID.sys
  • MOUHID.sys
  • KBDCLASS.sys
  • MOUCLASS.sys

Keyboard and mouse HID client drivers

I recently came across the following answer on SU, which states:

The linked answer has numerous problems, the most glaring problem is it incorrectly identifies the reason the keyboard and mouse were not being detected within the Windows Preinstallation Environment (WinPE).

The Windows 7 Installation Environment, does not have USB 3 host controller driver support, which is the reason Windows 7 cannot be installed from a USB 3 device. This is the reason you must add a USB 3 driver to the ISO, in order to install Windows 7, from a USB 3 mass storage device.

While it is the case Intel changed the USB 3 I/O, in such a way Windows 7 is no longer supported, USB 3 support still exist. It also is the case Intel no longer supports Windows 7, with it's more recent hardware iterations, with it's own Intel USB 3 drivers.

Ramhound

Posted 2018-11-26T23:40:41.753

Reputation: 28 517

So a USB 2.0 keyboard should work by default in a Windows 7 installation environment? – Hashim – 2018-11-30T18:34:12.500

@Hashim - I have installed Windows 7 with a USB keyboard and mouse in the past. – Ramhound – 2018-11-30T18:55:22.067

0

Technically they would have drivers but it's such a standardised interface that it is all simply built into the operating system. It wouldn't even provide a mechanism for replacing the driver hence it would not appear in, say, Windows' device manager.

USB is a slightly different situation because a USB connection can carry many different types of device interface, including hubs which in turn can carry other devices and other hubs. Also, USB has a little more overhead because your system has to be able to determine things like what type of device it is, how much power it needs, etc before it can run, so you don't just get instant usability, you have to wait until the OS has time to probe and initialise the device. Nonetheless, most such device interfaces still have support included in the operating system and have no requirement to install a specialised driver - for instance, keyboards, mice and external hard drives. Windows, annoyingly, will go through the process of "setting up a new device" when you insert a new device even if it has the required drivers already because it's just a standard device.

Both USB and PS/2 devices can have manufacturer-provided drivers, and these are often optional in the sense that all they do is provide some sort of additional features related to non-standard aspects of the device.

The advice about trying a PS/2 keyboard if your USB keyboard is not recognised by the OS is simply a way of troubleshooting if there is something wrong with your system's USB support. There are various things that can go wrong with USB. Firstly, USB support is more complicated so some boot managers or even "BIOS" setup interfaces don't support it, or do but only when your system is set to "legacy" USB support. It's also possible to disable USB support sometimes, and re-enabling it may be difficult without a PS/2 keyboard. And sometimes there are other issues with USB.

thomasrutter

Posted 2018-11-26T23:40:41.753

Reputation: 1 473

No, nothing is "built into" the operating system in such a way that it couldn't be replaced. Even the so-called 'inbox' drivers that come as part of Windows still behave like regular drivers and expose their devices as part of the device tree, because it leads to a better overall design of the system. I'm looking at my old computer's Device Manager and it shows the PS/2 keyboard right there, managed by i8042prt and kbdclass; if I want to "upgrade" those to something else, I can. PS/2 devices are also probed, they're just not hotpluggable. – user1686 – 2018-11-27T06:03:39.773

It's possible to have third party drivers for PS/2 keyboards but not at the level of defining the hardware interface to the PS/2 port itself but at a higher level of abstraction where it is hooking into keyboard events, thus allowing it to add functionality to extra non-standard buttons etc. As for replacing the PS/2 port driver itself ie i8042prt.sys - I don't think that's possible or at least can't think what reason anybody would have for doing it? – thomasrutter – 2018-11-28T00:23:30.567