Subject: More on the saga of keyboard hang on boot
To: None <>
From: John C. Hayward <>
List: current-users
Date: 03/13/1994 23:22:54
Dear NetBSDers,
   I spent a chunk of time playing with pccons.c with my Gateway-2000 DX33V
Phinox 80486 ROM BIOS PLUS version 0.10 GLB01
(c) 1985-1990

   If I add a few lines of code to pccons.c I can get my machine to boot
without the keyboard hung:

   First after the reset command has been issued and the status indicates
that there is another data in buffer it seems that one must input the
status one more time before reading the buffer.  Without this my machine 
hangs. Below is the code which works for me.
        while ((inb(KBSTATP) & KBS_DIB) == 0);
        /* this seems to be necessary for Gateways with Phinox bios? - jch */
        if ((inb(KBSTATP) & KBS_DIB) == 0)
            printf("pcprobe: status changed\n");
        /* end of addition - jch */

   Second after the reset done is read from the buffer it seems that what 
ever a printf statement does allows it not to hang.  If the printf statement
is removed my machine hangs.

        if (inb(KBDATAP) != KBR_RSTDONE) {
                printf("pcprobe: reset error %d\n", 2);
                goto lose; 
        /* this seems to be necessary for Gateways with Phinox bios? - jch */
        printf("pcprobe: past reset check\n");
        /* end of addition - jch */

   Third the code which drains the extra ACs etc will cause my keyboard 
to hang.  So I disable it.
#if 0    

It seems to me that there is some hardware problem in that if you try to
read the data in the data buffer too soon after a reset things get messed up
on my machine.  It also seems that there should be some time between reading
the reset result before going on to other things.

Are there others who are still having this keyboard hang and if so you might
try these changes and see if it helps in your case.