From 2bc8a824fd424aa3e21bc394fd0be3191b830888 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Mon, 9 Nov 2026 23:42:19 +0800 Subject: [mubios] Initialize the 8042 keyboard controller POST only unmasked IRQ1 in the PIC and never configured the 8042 itself, so the keyboard stayed in its post-reset disabled state: the clock was inhibited and no scan code ever reached the output buffer. IRQ1 never fired, the BDA keyboard buffer stayed empty, and GRUB polling INT 16h AH=01h never saw a key. Add kbd_init() to disable both ports, drain the output buffer, clear the clock inhibit bits in the command byte, enable the keyboard and auxiliary IRQs and select set 1 translation, then enable scanning with 0xF4. The IRQ1 handler now checks the status register for a pending output byte before reading the data port and drops auxiliary port bytes. The set 2 break prefix tracking is gone because translation is enabled. --- mubios/include/bios.h | 1 + 1 file changed, 1 insertion(+) (limited to 'mubios/include/bios.h') diff --git a/mubios/include/bios.h b/mubios/include/bios.h index c4eb465..c1c70d8 100644 --- a/mubios/include/bios.h +++ b/mubios/include/bios.h @@ -44,6 +44,7 @@ void serial_init (void); void serial_putc (u8 value); void serial_write (const char *text); +void kbd_init (void); void pic_init (void); void pit_init (void); void ioapic_init (void); -- cgit v1.2.3