maintenance

This commit is contained in:
nub31
2025-08-29 15:51:05 +02:00
parent 827d27e3e3
commit 3e510a3e1b
6 changed files with 33 additions and 20 deletions

View File

@@ -11,6 +11,14 @@
#define KEYBOARD_HANDLERS_LENGTH 32
unsigned const char us_keymap[128] = {
0, 27, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', '\b', '\t', 'q', 'w',
'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n', 0, 'a', 's', 'd', 'f', 'g', 'h',
'j', 'k', 'l', ';', '\'', '`', 0, '\\', 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/',
0, '*', 0, ' ', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, '-', 0, 0, 0, '+', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
bool shift = false;
bool caps_lock = false;
@@ -47,6 +55,7 @@ void handle_keyboard(const isr_frame_t* frame)
.pressed = pressed,
.caps_lock = caps_lock,
.shift = shift,
.ascii = us_keymap[scan_code],
};
for (int i = 0; i < handler_index; i++)
@@ -65,7 +74,7 @@ void register_keypress_handler(const keyboard_handler_t handler)
{
vga_print_error();
vga_print(" Maximum keyboard handlers reached\n");
kpanic();
kernel_panic();
}
keyboard_handlers[handler_index] = handler;