half assed keyboard driver yippegit add .git add .git add .git add .git add .git add .git add .git add .git add .git add .git add .git add .!

This commit is contained in:
2025-06-01 23:58:23 -04:00
parent 3ffb3aa181
commit 0fc2e6a199
4 changed files with 197 additions and 3 deletions

View File

@ -7,6 +7,7 @@
#include <kernel/x86/idt.h>
#include <kernel/x86/pic.h>
#include <kernel/x86/io.h>
#include <kernel/x86/keyb.h>
__attribute__((aligned(0x10)))
static idt_entry_t idt[256];
@ -27,9 +28,13 @@ void exception_handler(unsigned int i)
if (i == PIC_KEYB) {
#ifdef __TESTING__
kinfo("Sending EOI instruction to KEYB");
//kinfo("Sending EOI instruction to KEYB");
#endif
printf("Scancode: %x\n", inb(0x60)); // read from kb
unsigned char in = inb(0x60);
char to_print = decode_key_enum(decode_scancode(in));
if (to_print != '\0')
printf("%c", to_print);
/**
* TODO: this is a cute temporary fix but lets do a real keyboard driver please?
*/