From 5e12467c860372dfa10323365fb0df9db79c8f9b Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Thu, 31 Jul 2025 22:33:56 +0200 Subject: APIC/ACPI/keyboard stuff. I now get interrupts when a key is pressed --- src/interrupt.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/interrupt.c') diff --git a/src/interrupt.c b/src/interrupt.c index 54f9947..6406fc0 100644 --- a/src/interrupt.c +++ b/src/interrupt.c @@ -3,6 +3,7 @@ struct handler { char8_t *description; bool (*fn)(uint32_t code); + bool apic; } handlers[256] = { [0] = { .description = u8"divide-by-zero-error" @@ -73,7 +74,12 @@ struct handler { }, [30] = { .description = u8"security exception" - } + }, + [32] = { + .description = u8"keyboard interrupt", + .fn = keyboard_interrupt_handler, + .apic = true, + }, }; void @@ -87,6 +93,9 @@ interrupt_handler(uint8_t n, uint32_t code) print(u8"Unhandled interrupt: %u8 (%s) with error code %x32\n", n, h->description ? h->description : u8"???", code); panic(); } + + if(h->apic) + apic_end_of_interrupt(); } -- cgit v1.2.3