tty_t *tp;
{
/* Initialize the keyboard driver. */
- static int count = 0;
- int i;
tp->tty_devread = kb_read; /* input function */
+}
+
+/*===========================================================================*
+ * kb_init_once *
+ *===========================================================================*/
+PUBLIC void kb_init_once(void)
+{
+ int i;
+
set_leds(); /* turn off numlock led */
scan_keyboard(); /* discard leftover keystroke */
- /* The following initialization should only run once. */
- if (! count ++) {
-
/* Clear the function key observers array. Also see func_key(). */
for (i=0; i<12; i++) {
fkey_obs[i].proc_nr = NONE; /* F1-F12 observers */
if ((i=sys_irqenable(&irq_hook_id)) != OK)
panic("TTY", "Couldn't enable keyboard IRQs", i);
kbd_irq_set |= (1 << KEYBOARD_IRQ);
- }
}
/*===========================================================================*
/* Initialize the TTY driver. */
tty_init();
- printf("\n");
-
/* Get kernel environment (protected_mode, pc_at and ega are needed). */
if (OK != (s=sys_getmachine(&machine))) {
panic("TTY","Couldn't obtain kernel environment.", s);
}
+ /* Final one-time keyboard initialization. */
+ kb_init_once();
+
+ printf("\n");
+
while (TRUE) {
/* Check for and handle any events on any of the ttys. */
/* keyboard.c */
_PROTOTYPE( void kb_init, (struct tty *tp) );
+_PROTOTYPE( void kb_init_once, (void) );
_PROTOTYPE( int kbd_loadmap, (message *m) );
_PROTOTYPE( void do_panic_dumps, (message *m) );
_PROTOTYPE( void do_fkey_ctl, (message *m) );