From 866912eb5f7906da2545f27f7bbef01a7d61c87f Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Thu, 31 Jul 2025 22:35:04 +0200 Subject: Oops, commit missing files from last commit --- src/keyboard.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/keyboard.c (limited to 'src/keyboard.c') diff --git a/src/keyboard.c b/src/keyboard.c new file mode 100644 index 0000000..4c9803c --- /dev/null +++ b/src/keyboard.c @@ -0,0 +1,25 @@ +#include "aplos.h" + +void +setup_keyboard(void) +{ + uint8_t n = 1; /* TODO: it isn't always at 1, the ACPI tables should tell us if not */ + + struct ioapic_redirection r = read_redirection(n); + + r.vector = 32; + r.delivery_mode = 0; + r.destination_mode = 0; + r.mask = 0; + r.destination = boot_apic_id(); + + write_redirection(n, r); +} + +bool +keyboard_interrupt_handler(uint32_t) +{ + uint8_t scancode = in_uint8(0x60); + print(u8"KBD INTR: %x8\n", scancode); + return true; +} -- cgit v1.2.3