diff options
author | Peter Mikkelsen <petermikkelsen10@gmail.com> | 2025-07-31 22:35:04 +0200 |
---|---|---|
committer | Peter Mikkelsen <petermikkelsen10@gmail.com> | 2025-07-31 22:35:04 +0200 |
commit | 866912eb5f7906da2545f27f7bbef01a7d61c87f (patch) | |
tree | 2472110bcf868837d84893bc257edcbafefe5a59 /src/keyboard.c | |
parent | 5e12467c860372dfa10323365fb0df9db79c8f9b (diff) |
Diffstat (limited to 'src/keyboard.c')
-rw-r--r-- | src/keyboard.c | 25 |
1 files changed, 25 insertions, 0 deletions
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; +} |