diff options
author | Danny Holman <dholman@gymli.org> | 2024-05-27 13:58:00 -0500 |
---|---|---|
committer | Danny Holman <dholman@gymli.org> | 2024-05-27 13:58:00 -0500 |
commit | 61760f9301427ea56a62ec02af3d0d8ae4745be7 (patch) | |
tree | c63057d16075b2b411eab36424f1d481b4a8c9f1 /drivers/input/keyboard.c | |
parent | libk: create a subset libc for kernel use (diff) | |
download | box-61760f9301427ea56a62ec02af3d0d8ae4745be7.tar.gz box-61760f9301427ea56a62ec02af3d0d8ae4745be7.tar.zst box-61760f9301427ea56a62ec02af3d0d8ae4745be7.zip |
drivers: create a subdir just for driver code
Create a subdirectory branching from the project root. This directory
will contain nothing but driver and device code.
Signed-off-by: Danny Holman <dholman@gymli.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/input/keyboard.c (renamed from arch/i386/kernel/keyboard.c) | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/arch/i386/kernel/keyboard.c b/drivers/input/keyboard.c index 96aea3a..f2a8eba 100644 --- a/arch/i386/kernel/keyboard.c +++ b/drivers/input/keyboard.c @@ -1,8 +1,9 @@ -#include <kernel/keyboard.h> -#include <kernel/framebuffer.h> +#include <kernel/input/keyboard.h> +#include <kernel/tty/tty_vga.h> +#include <kernel/tty.h> +#include <kernel/kthread.h> #include <kernel/pic.h> - -#define C(k) (k - '@') +#include <libk/string.h> static uint8_t keymap_modifiers[256] = { [0x1D] KB_CTL, @@ -100,9 +101,6 @@ 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); @@ -136,9 +134,9 @@ char keyboard_getchar(void) { return c; } -void keyboard_handler(void) { +void keyboard_handler(struct isr_frame *frame) { char c = keyboard_getchar(); if (c != -1) - keyboard_buffer[kbuf_pos++]; + tty_getchar(c); return; } |