# Kernel Keyboard Problems [solved]

## TheAmazingRando

I've been using linux/gentoo for over 5 years now, but I've come across a problem that has me stumped. When booting off the LiveCD (2005.0 or .1), or on my own compiled kernel, my keyboard doesn't work. I've tried both a MS Wireless keyboard and a standard PS2 keyboard. However! If while booting, I keep pressing a key (say, Numlock, so I can see the lights and make sure its working), then when it gets to the login prompt, the keyboard works great. I only have to press the key during the kernel part of booting (before the init-scripts start).

Dmesg reveals some interesting stuff when I press keys to make it work (clipped to the relevant parts):

```

...

ACPI: Fan [FAN] (on)

ACPI: Thermal Zone [THRM] (49 C)

PNP: PS/2 controller doesn't have AUX irq; using default 0xc

PNP: PS/2 Controller [PNP0303:PS2K] at 0x60,0x64 irq 112

serio: i8042 KBD port at 0x60,0x64 irq 1

...

atkbd.c: Failed to enable keyboard on isa0060/serio0

input: AT Translated Set 2 keyboard on isa0060/serio0

hda: ST3200822A, ATA DISK drive

atkbd.c: Unknown key pressed (translated set 2, code 0xd9 on isa0060/serio0).

atkbd.c: Use 'setkeycodes e059 <keycode>' to make it known.

...

```

That last "Unknown key pressed" is repeated several times throughout, I guess thats me hitting Numlock

This is a standard Intel chipset, but it is on a fairly cheap motherboard. I've also looked at several posts on the forums regarding kernel configs on the keyboard, but none of them changed anything. I'm open to any suggestions you might have. Also, it all works fine in WindowsXP.

Thanks!

Update:

I've found out some more stuff.

After completely rebooting, and the keyboard not working, if I unplug the PS/2 cable, then plug it back in, the keyboard magically starts working.

Here's some more relevant information from dmesg, I'm hoping someone can explain what it means.

Shortly after starting boot, it enables the PS/2 controller:

```
PNP: PS/2 controller doesn't have AUX irq; using default 0xc

PNP: PS/2 Controller [PNP0303:PS2K] at 0x60,0x64 irq 112

serio: i8042 AUX port at 0x60,0x64 irq 12

serio: i8042 KBD port at 0x60,0x64 irq 1

Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled

ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

mice: PS/2 mouse device common for all mice

```

What is the AUX irq, and is that bad?

USB init, a little later:

```
usb 2-1: new low speed USB device using uhci_hcd and address 2

usb 2-2: new low speed USB device using uhci_hcd and address 3

HID device not claimed by input or hiddev

input: USB HID v1.11 Mouse [Microsft Microsoft Wireless Optical Desktop® 2.10] on usb-0000:00:1d.0-2

usbcore: registered new driver usbhid

drivers/usb/input/hid-core.c: v2.01:USB HID core driver

```

"HID device not claimed by input or hiddev" ? I think this is the core of the problem. Why doesn't HID input like my keyboard at first? after re-plugging the PS2, it finds it, and works fine (see below)

After unplugging the PS2 cable (USB part still in):

```
usb 2-2: USB disconnect, address 3

usb 2-2: new low speed USB device using uhci_hcd and address 4

input: USB HID v1.11 Keyboard [Microsft Microsoft Wireless Optical Desktop® 2.10] on usb-0000:00:1d.0-2

usb 2-2: USB disconnect, address 4

usb 2-2: new low speed USB device using uhci_hcd and address 5

input: USB HID v1.11 Keyboard [Microsft Microsoft Wireless Optical Desktop® 2.10] on usb-0000:00:1d.0-2

usb 2-2: USB disconnect, address 5

usb 2-2: new low speed USB device using uhci_hcd and address 6

... (repeats, address always increasing until 128, then starts over)...

```

For some reason, the device gets disconnected as soon as its found, then it gets found again.

On plugging the PS2 cable back in (after which, the keyboard works prefectly):

```

usb 2-2: new low speed USB device using uhci_hcd and address 16

input: AT Translated Set 2 keyboard on isa0060/serio0

usb 2-2: new low speed USB device using uhci_hcd and address 17

input: USB HID v1.11 Mouse [Microsft Microsoft Wireless Optical Desktop® 2.10] on usb-0000:00:1d.0-2

```

This time, input finds the keyboard (why now, and not before?) I think that this right here is the root of the problem. Is this a gentoo thing, or does it need to be submitted to the kernel devs as a bug?

When the keyboard is working, if I just sit there and not touch anything, I get this:

```
atkbd.c: Unknown key released (translated set 2, code 0x81 on isa0060/serio0).

atkbd.c: Use 'setkeycodes e001 <keycode>' to make it known.

atkbd.c: Unknown key pressed (translated set 2, code 0xd9 on isa0060/serio0).

atkbd.c: Use 'setkeycodes e059 <keycode>' to make it known.

```

e001 and e059 are the only ones that show (01 rarely, 59 every few seconds). Why would the keyboard be sending signals even if I don't hit any buttons?

I've fiddled with settings in the BIOS, and anything seemingly USB or keyboard related in the kernel. I've tried kernels 2.6.12 and 2.6.13, both do the exact same thing. I have two of these cheapie motherboards (ECS, Intel chipset), and both motherboards have the problem.

Should I post my problem on bugs.gentoo, or is it a configuration error on my part? Anyone know?Last edited by TheAmazingRando on Tue Nov 01, 2005 7:57 pm; edited 2 times in total

----------

## TheAmazingRando

And a shameless bump to get my updates back to the front of the forum. Hopefully a knowledgeable person's eyeballs will see it now   :Smile: 

----------

## dtor

Does it help if you boot with "usb-handoff" option on the kernel command line?

----------

## dwcrowe

I'm having problems similar to yours:

https://forums.gentoo.org/viewtopic-t-388299-highlight-wireless+optical.html

----------

## ph0

I've got the same problem as you, since 2.6.7 kernel. Except for that it neither always helps to press numlock, nor does it work after replugging  :Sad:  And my problem is too unspecific for the LKML. Golly, that freaks me out.

Has somebody any hint?

----------

## sisooktom

I have a similar issue that I saw when booting the 2005.1 Installation CD last night.  Although the keyboard "sort of" works, it intermittently prints a message similar to the following when I'm tying (this is not my system):

```

Dec  1 09:25:50 biglaptop kernel: atkbd.c: Unknown key pressed

(translated set 2, code 0xd9 on isa0060/serio0).

Dec  1 09:25:50 biglaptop kernel: atkbd.c: Use 'setkeycodes e059

<keycode>' to make it known.

```

After doing some research, it appears the problem is limited to wireless keyboards, and the "Unknown Keys" are actually ACPI power notifications coming from the keyboard.  See this page for details

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=141505

I have yet to try and fix the problem, but when I do I'll post the results.

----------

## dwcrowe

 *sisooktom wrote:*   

> I have a similar issue that I saw when booting the 2005.1 Installation CD last night.  Although the keyboard "sort of" works, it intermittently prints a message similar to the following when I'm tying (this is not my system):
> 
> ```
> 
> Dec  1 09:25:50 biglaptop kernel: atkbd.c: Unknown key pressed
> ...

 

As it has been described, this seems to be the lesser problem.  In our case(those who don't have PS2 ports), we are unable to type at all.  Furthermore, the system suffers slowdown due to the constant polling and reassignment of usb addresses.  We never reach any "keyboard" error messages.

To the OP,  were you trying to plug in the PS/2 and USB connections at the same time?

----------

## dtor

Please try booting with "usb-handoff" option. It is known to cure bunch of problems with USB and PS/2 iteractions.

----------

## dwcrowe

 *dtor wrote:*   

> Please try booting with "usb-handoff" option. It is known to cure bunch of problems with USB and PS/2 iteractions.

 

Doesn't help here.

----------

## ph0

usb-handoff seems to help here, big thanks  :Wink: 

----------

## TheAmazingRando

usb-handoff worked great for me, too

----------

## carl.anderson

I saw the same issue while using an install CD and a Microsoft Wireless Multimedia Keyboard.  It seems that these messages did not affect the commands I was typing, since I was able to press Ctrl-U to clear the screen and have my command restored.  I assigned e059 to 120, e001 to 121 and e002 to 122.  Those are the only key codes I came across while going through an install.

```
bash # setkeycodes e059 120

bash # setkeycodes e001 121

bash # setkeycodes e002 122

```

booting with usb-handoff did not work for me.

After completing the install, it seems that this is no longer an issue.  Truth be told, I have done several installs using this keyboard and have simply ignored the messages (as annoying as that was) in the past.

----------

## mlapeyre

Update - 

Happened to me during install but only affected the Function keys so I couldn't get a second terminal during the install.  An annoyance, really, but I fixed it with the setkeycodes command using keycodes from this handy table:

http://www.comptechdoc.org/os/linux/howlinuxworks/linux_hlkeycodes.html

Regards, 

MikeL

----------

