Linux Device Driver to disable/enable keyboard

Theory:

As we have seen in our earlier posts, that there are three registers for keyboard controller.

  • Control Register (0x64) -- Write Operation
  • Data Register (0x60) -- Write/Read Operation
  • Status Register (0x60) -- Read Operation
Process to disable Keyboard:
  • Wait until the keyboard controller is not busy by reading the status register
  • Send the command 0xAD to Control Register
Process to Enable Keyboard:
  • Wait until the keyboard controller is not busy by reading the status register
  • Send the command 0xAE to Control Register.
Code:



Output:




Notes:

We have loaded the module using the command "sleep 1 && insmod ./kbd_disable.ko". If you try only "insmod ./kbd_disable.ko", the keyboard will disable at "Enter Press", so the console will be continuously receiving Enter Press Keys, until keyboard gets enabled back

Comments

Popular posts from this blog

bb.utils.contains yocto

make config vs oldconfig vs defconfig vs menuconfig vs savedefconfig

PR, PN and PV Variable in Yocto