From 3bf0631a5e886fec8f0b5c12d8fee3410bd3739f Mon Sep 17 00:00:00 2001 From: mycroft Date: Thu, 3 Mar 1994 19:11:59 +0000 Subject: [PATCH] Flush the keyboard buffer before and after the reset. This should now work on all machines and keyboards. --- sys/arch/i386/isa/pccons.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/arch/i386/isa/pccons.c b/sys/arch/i386/isa/pccons.c index 82365dcb721d..49d6bc7972e3 100644 --- a/sys/arch/i386/isa/pccons.c +++ b/sys/arch/i386/isa/pccons.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)pccons.c 5.11 (Berkeley) 5/21/91 - * $Id: pccons.c,v 1.55 1994/03/02 08:03:02 mycroft Exp $ + * $Id: pccons.c,v 1.56 1994/03/03 19:11:59 mycroft Exp $ */ /* @@ -340,6 +340,9 @@ pcprobe(dev) } #if 0 + /* Flush any garbage. */ + while (inb(KBSTATP) & KBS_DIB) + (void) inb(KBDATAP); /* Reset the keyboard. */ if (!kbd_cmd(KBC_RESET, 1)) { printf("pcprobe: reset error %d\n", 1); @@ -350,6 +353,9 @@ pcprobe(dev) printf("pcprobe: reset error %d\n", 2); goto lose; } + /* Flush any garbage. */ + while (inb(KBSTATP) & KBS_DIB) + (void) inb(KBDATAP); /* Just to be safe. */ if (!kbd_cmd(KBC_ENABLE, 1)) { printf("pcprobe: reset error %d\n", 3);