Subject: Keyboard difficulties
To: NetBSD-Users <tech-kern@netbsd.org>
From: Matthew Fincham <matthewf@cat.co.za>
List: netbsd-users
Date: 12/04/2001 09:36:38
Hello

I have already posted this message on netbsd-help, but haven't had any
feedback, so I am trying again, on tech-kern, and netbsd-users. :-)

I am having difficulty getting the keyboard to work when the system boots up
without a keyboard, and then has the keyboard plugged in after the boot-up
sequence is complete.

The actions I take are these:

1. unplug the keyboard, and reboot the system. Leave the keyboard unplugged.
2. once the system has booted up, plug the keyboard in and try to login.

If the keyboard is not working, then repeat step 1. What I find is that the
keyboard works on alternate reboots (works, doesn't work, works, ....).

I have added debug info to the kernel, and have included the relevant (??)
parts in the e-mail. Essentailly, there are three cases to look at:
a) boot with keyboard plugged in
b) boot without keyboard plugged in, and when plugged in, keyboard works
c) boot without keyboard plugged in, and when plugged in, keyboard does not
work

a) Keyboard Plugged In
=================
pckbc0 at isa0 port 0x60-0x64
pckbdprobe: reset succeeded!
pckbdprobe:resp[0]=0xaa -> continuing
pckbdprobe: flushing kbd buffer
pckbd: the 8042 is translating -> use AT codes
pckbdprobe: succeeded setting xtscancode
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot

wskbd_match
Console unspecified
wskbd0 at pckbd0
wskbd_attach: console keyboard
wskbd_add_mux: 0 dmux0 0xc0866e00
wskbd_set_display()
Ebusy 1, using wsdisplay0
pmsi0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pmsi0wsmux_attach: n=0
mux 0

b) Boot without keyboard plugged in, and when plugged in, keyboard works
======================================================
pckbc0 at isa0 port 0x60-0x64
pckbdprobe: reset error 5
pckbdprobe: returning 1
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot

wskbd_match
Console unspecified
wskbd0 at pckbd0
wskbd_attach: console keyboard
wskbd_add_mux: 0 dmux0 0xc0866e00
wskbd_set_display()
Ebusy 1, using wsdisplay0
pmsi0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pmsi0wsmux_attach: n=0
mux 0

c) Boot without keyboard plugged in, and when plugged in, keyboard does not
work
=========================================================
pckbc0 at isa0 port 0x60-0x64
pckbdprobe: reset succeeded!
pckbdprobe:resp[0]=0xaa -> continuing
pckbdprobe: flushing kbd buffer
pckbd: the 8042 is translating -> use AT codes
pckbd: error setting scanset 2
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot

wskbd_match
Console unspecified
wskbd0 at pckbd0
wskbd_attach: console keyboard
wskbd_add_mux: 0 dmux0 0xc0866e00
wskbd_set_display()
Ebusy 1, using wsdisplay0
pmsprobe: reset error 5
pmsiprobe: reset error 5


The most obvious thing I can see is that in case (c), when the keyboard is
not present and when plugged in fails, the reset command works! This seems
strange, because the reset command polls for a response...but there is no
keyboard. In case (b) the reset command fails, which makes a lot more sense.

The situation this needs to be solved for is where a number of systems use a
single montior and keyboard with a switch-box. We need the systems to be
able to boot without the switch-box switched to the booting machine. (the
tests done here did not involve the switch-box, but just a single keyboard
and system, so I don't think it is an issue with the switch-box)

I have tried this on NetBSD 1.4 and 1.5 with the same results. The
motherboard being used is a CS62-TC DFI motherboard . On other motherboards
(e.g. the GIGABYTE GA-6BX7) this has not been a problem.

Does anyone have any ideas why case (c) behaves as it does? Any help would
be appreciated.

Thank you
Matthew Fincham