diff options
author | Peter Mikkelsen <petermikkelsen10@gmail.com> | 2025-07-31 22:33:56 +0200 |
---|---|---|
committer | Peter Mikkelsen <petermikkelsen10@gmail.com> | 2025-07-31 22:33:56 +0200 |
commit | 5e12467c860372dfa10323365fb0df9db79c8f9b (patch) | |
tree | 13e81afa3accb633fdb0ab0d655244ea752814a5 /src/interrupt.c | |
parent | 0a817a5a74c328229f8a732fc3ec22d8fd7dc20d (diff) |
APIC/ACPI/keyboard stuff. I now get interrupts when a key is pressed
Diffstat (limited to 'src/interrupt.c')
-rw-r--r-- | src/interrupt.c | 11 |
1 files changed, 10 insertions, 1 deletions
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(); } |