10#ifndef KERNEL_ARCH_X86_64_KEYBOARD_H
11#define KERNEL_ARCH_X86_64_KEYBOARD_H
18#define PS2_STATUS 0x64
19#define PS2_COMMAND 0x64
21#define KBD_BUF_SIZE 256
35extern bool shift_down, ctrl_down, alt_down, caps_on;
Provides utilities for IO operations with the hardware.
uint8_t inb(uint16_t port)
Inputs a byte from the specified port.
bool shift_down
Keyboard modifier key status.
int kbd_buf_pop(void)
Pops byte from the keyboard key buffer.
static void ps2_wait_write(void)
Wait until ps/2 input buffer is empty.
bool kbd_decode(uint8_t raw, struct key_event *ev)
Convert a keyboard byte into the correct char.
void keyboard_init(void)
Initialize the keyboard driver and register the handler with the IRQ handler.
int kbd_getchar(void)
Waits for a key to be pressed and returns the character.
static void ps2_wait_read(void)
wait until a byte is waiting
bool extended
came after an 0xE0 prefix
uint8_t scancode
the code with bit 7 removed
char ascii
0 if the key has no printable character
bool pressed
true = key down, false = key up