diff options
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; +} |