Make this compile again after the syscons/psm/kbdio changes that removed
the keyboard IO port definitions from <machine/console.h>. Note: I do not have a machine available to test this yet, I sent this for review to several people who have not replied. This is also totally busted in 2.2, which has half of the syscons/psm/kbdio changes in it. This really desperately needs to be tested and fixed in 2.2 as well.
This commit is contained in:
parent
e48bd55f0d
commit
268f35eacb
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile,v 1.50 1996/10/14 17:25:52 pst Exp $
|
||||
# $Id: Makefile,v 1.51 1996/11/02 02:24:30 pst Exp $
|
||||
#
|
||||
|
||||
PROG= boot
|
||||
@ -11,6 +11,7 @@ BINMODE= 444
|
||||
CFLAGS= -O2 -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
|
||||
-DDO_BAD144 -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT}
|
||||
CFLAGS+= -DBOOTSEG=${BOOTSEG} -DBOOTSTACK=${BOOTSTACK}
|
||||
CFLAGS+= -I${.CURDIR}/../../..
|
||||
CFLAGS+= ${CWARNFLAGS}
|
||||
|
||||
# Probe the keyboard and use the serial console if the keyboard isn't found.
|
||||
|
@ -42,13 +42,15 @@
|
||||
*
|
||||
* This grody hack brought to you by Bill Paul (wpaul@ctr.columbia.edu)
|
||||
*
|
||||
* $Id: probe_keyboard.c,v 1.6 1996/03/08 06:29:07 bde Exp $
|
||||
* $Id: probe_keyboard.c,v 1.7 1996/09/26 20:52:13 pst Exp $
|
||||
*/
|
||||
|
||||
#ifdef PROBE_KEYBOARD
|
||||
|
||||
#include <machine/console.h>
|
||||
#include <machine/cpufunc.h>
|
||||
#include <i386/isa/kbdio.h>
|
||||
#include <i386/isa/isa.h>
|
||||
#include "boot.h"
|
||||
|
||||
int
|
||||
@ -58,9 +60,9 @@ probe_keyboard(void)
|
||||
unsigned char val;
|
||||
|
||||
/* flush any noise in the buffer */
|
||||
while (inb(KB_STAT) & KB_BUF_FULL) {
|
||||
while (inb(IO_KBD + KBD_STATUS_PORT) & KBDS_BUFFER_FULL) {
|
||||
delay1ms();
|
||||
(void) inb(KB_DATA);
|
||||
(void) inb(IO_KBD + KBD_DATA_PORT);
|
||||
}
|
||||
|
||||
/* Try to reset keyboard hardware */
|
||||
@ -69,14 +71,16 @@ probe_keyboard(void)
|
||||
#ifdef DEBUG
|
||||
printf("%d ", retries);
|
||||
#endif
|
||||
while ((inb(KB_STAT) & KB_READY) == KB_READY) delay1ms();
|
||||
outb(KB_DATA, KB_RESET);
|
||||
while ((inb(IO_KBD + KBD_STATUS_PORT) & KBDS_CONTROLLER_BUSY) ==
|
||||
KBDS_CONTROLLER_BUSY)
|
||||
delay1ms();
|
||||
outb(IO_KBD + KBD_DATA_PORT, KBDC_RESET_KBD);
|
||||
for (i=0; i<1000; i++) {
|
||||
delay1ms();
|
||||
val = inb(KB_DATA);
|
||||
if (val == KB_ACK || val == KB_ECHO)
|
||||
val = inb(IO_KBD + KBD_DATA_PORT);
|
||||
if (val == KBD_ACK || val == KBD_ECHO)
|
||||
goto gotack;
|
||||
if (val == KB_RESEND)
|
||||
if (val == KBD_RESEND)
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -92,17 +96,18 @@ gotres:
|
||||
}
|
||||
gotack:
|
||||
delay1ms();
|
||||
while ((inb(KB_STAT) & KB_BUF_FULL) == 0) delay1ms();
|
||||
while ((inb(IO_KBD + KBD_STATUS_PORT) & KBDS_CONTROLLER_BUSY) == 0)
|
||||
delay1ms();
|
||||
delay1ms();
|
||||
#ifdef DEBUG
|
||||
printf("ACK ");
|
||||
#endif
|
||||
val = inb(KB_DATA);
|
||||
if (val == KB_ACK)
|
||||
val = inb(IO_KBD + KBD_DATA_PORT);
|
||||
if (val == KBD_ACK)
|
||||
goto gotack;
|
||||
if (val == KB_RESEND)
|
||||
if (val == KBD_RESEND)
|
||||
goto again;
|
||||
if (val != KB_RESET_DONE) {
|
||||
if (val != KBD_RESET_DONE) {
|
||||
#ifdef DEBUG
|
||||
printf("stray val %d\n", val);
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user