feat: cleanup init code, small other refactors
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <myke/libc/ringqueue.h>
|
||||
#include <myke/libk/libk.h>
|
||||
#include <myke/libk/syscall.h>
|
||||
#include <myke/util/init.h>
|
||||
|
||||
|
||||
const char scancode_map_lowercase[] = {
|
||||
@@ -131,7 +132,7 @@ static void keyboard_callback(isr_registers_t *regs) {
|
||||
publish_key_event(scancode);
|
||||
}
|
||||
|
||||
void init_keyboard() {
|
||||
void keyboard_init() {
|
||||
register_interrupt_handler(IRQ1, keyboard_callback);
|
||||
keyboard_state.shift = 0;
|
||||
keyboard_state.ctrl = 0;
|
||||
@@ -139,3 +140,9 @@ void init_keyboard() {
|
||||
keyboard_state.extended = 0;
|
||||
keyboard_event_buffer = create_buffer(256, sizeof(KeyEvent));
|
||||
}
|
||||
|
||||
INIT_FUNCTION(100) = {
|
||||
.name = "keyboard",
|
||||
.stage = INIT_STAGE_LATE_BOOT,
|
||||
.init = keyboard_init,
|
||||
};
|
||||
Reference in New Issue
Block a user