From 2ce0f8af51dae9e7d591ff5fd038f89d6ca9dbbe Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Sat, 24 Feb 2024 14:44:38 -0600 Subject: arch: i386: cleanup everything and reorganize Clean up everything in the i386 arch directory. This code has been in dire need of refactoring for a long while. All the inline assembly functions and the data structures related to the architecture should be placed into their own header file. Now the scheduler can access registers and ISRs without having to deal with arch-specific code. Signed-off-by: Danny Holman --- arch/i386/kernel/keyboard.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'arch/i386/kernel/keyboard.c') diff --git a/arch/i386/kernel/keyboard.c b/arch/i386/kernel/keyboard.c index 4e4bc9b..96aea3a 100644 --- a/arch/i386/kernel/keyboard.c +++ b/arch/i386/kernel/keyboard.c @@ -100,6 +100,9 @@ static uint8_t* keymaps[4] = { keymap_control, }; +char keyboard_buffer[4096]; +int kbuf_pos = 0; + char keyboard_getchar(void) { static int shift = 0; uint8_t st = inb(KB_STAT); @@ -133,10 +136,9 @@ char keyboard_getchar(void) { return c; } -void keyboard_handler(struct isr_frame *frame) { +void keyboard_handler(void) { char c = keyboard_getchar(); - // TODO: actually put this in a buffer if (c != -1) - fb_putchar(c); + keyboard_buffer[kbuf_pos++]; return; } -- cgit v1.2.3