Subject: Re: Pain .. oh, pain.
To: None <port-sparc@NetBSD.ORG>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: port-sparc
Date: 07/31/1997 10:22:10
> To make matters worse, I rebooted into single-user mode and once it
> gets past asking you for root/dump/root-fs-type (I booted -sa), it
> refused to recognize keyboard input (save Stop-A).

I had a very similar problem; after throwing debugging code into
various places, I tracked it down to the keyboard not sending back a
reset code after being reset (or at least kbd.c not getting it).

I added some code so that I could at least get keystrokes.  Every now
and then since then, a machine has gone dead on me at boot until this
code kicked in; I don't know what it is, but _something_ must be losing
those reset codes.

I have several patches in sys/arch/sparc/dev/kbd.c; the part that's
relevant to this discussion is

@@ -345,6 +346,15 @@
                 * Do not know how to translate yet.
                 * We will find out when a RESET comes along.
+/* If a RESET doesn't come along in a little while, fake enough of it
+   to at least get keystrokes. */
+static int n = 0;
+if (++n > 10)
+{ ks->kbd_unshifted = kbd_unshifted;
+ks->kbd_shifted = kbd_shifted;
+ks->kbd_cur = ks->kbd_unshifted;
+printf("[kbd_translate: faking RESET]\n");
                return (-1);
        down = !KEY_UP(c);

I'd written off my problems as a flaky keyboard, but if this patch
fixes anything for you, there is probably something deeper wrong and it
may deserve to be sent-pr; it's unlikely that everybody's keyboards
went flaky at exactly the same time as the kernels got switched.

					der Mouse

		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B