summaryrefslogtreecommitdiff
path: root/src/keyboard.c
blob: 4c9803c1e355ddd79a4b9d309d237e282823f27a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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;
}