Major interrupt change

This commit is contained in:
2024-10-23 14:11:22 +02:00
parent 11feab5014
commit f163659f0c
38 changed files with 498 additions and 468 deletions
+2 -11
View File
@@ -1,6 +1,5 @@
#include <keyboard/keyboard.h>
#include <interrupt/idt.h>
#include <interrupt/pic.h>
#include <interrupt/isr.h>
#include <keyboard/keys.h>
#include <memory/addresses.h>
#include <ports/io.h>
@@ -10,8 +9,7 @@
static const uint8_t US_Keyboard[2][128] = US_KEYBOARD;
keyboardState_t* keyboard = (keyboardState_t*)KEYBOARD_STATE_LOC;
__attribute__ ((interrupt))
void keyboardHandler(intFrame_t* iframe) { // TODO: Make this better and be able to read multi-byte scancode
void keyboardHandler(intFrame_t*) { // TODO: Make this better and be able to read multi-byte scancode
uint8_t scancode = inb(0x60);
char c = US_Keyboard[keyboard->shift][scancode];
@@ -25,12 +23,5 @@ void keyboardHandler(intFrame_t* iframe) { // TODO: Make this better and be able
} else if (c != '\0') {
keyboard->character = c;
}
sendPicEOI(1);
}
void setupKeyboard() {
idtSetGate(0x21, keyboardHandler, INT_GATE_FLAGS);
unsetIrqMask(1);
}