KBC Input Port

Motherboard Keyboard Controller Input Port

The Intel 8042 or equivalent keyboard controller which is directly accessible to OS software via ports 0x60 and 0x64 has an eight-bit input port as defined below and an eight-bit output port. The AT meanings of the input port pins are obsolete.

The Input Port

Bit Meaning on AT Systems Meaning on PS/2 Systems
7 Keyboard inhibit switch input
0 = Inhibited
1 = Not inhibited (atr)
Reserved (kadc)
6 Display type switch
0 = Colour graphics adapter
1 = Monochrome adapter (atr)
Reserved (kadc)
5 Manufacturing jumper
0 = Installed
1 = Not installed (atr)
Reserved (kadc)
4 RAM on the system board
0 = Disable second 256Kbyte
1 = Enable second 256Kbyte (atr)
Reserved (kadc)
3 Undefined (atr) Reserved (kadc)
2 Undefined (atr) Reserved (kadc)
1 Undefined (atr) Mouse data input (kadc)
0 Undefined (atr) Keyboard data in (kadc)

Reading the Port

In normal operation the serial data streams received by the keyboard controller's input port are made available to the CPU as bytes. The KBC's input port is not directly accessible to programs as it is on the 'other' side of the device from the computer's CPU. However, its state at a point in time can be read using keyboard controller command 0xC0. PS/2s have commands 0xC1 and 0xC2 to mirror nibbles of the input port to the status register until another command is sent.

Writing the Port

It would not make sense to write to the input port and there is no standard command to do so. However, you can write a byte to the controller in such a way that it will treat it as a byte from the keyboard (command 0xD2) or from the mouse (command 0xD3).

Sources

Sources for the above are

  • (atr) - IBM Personal Computer AT Technical Reference
  • (kadc) - IBM PS/2 Reference Manual: Keyboard and Auxiliary Device Controller
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License