summaryrefslogtreecommitdiff
path: root/kernel/keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/keyboard.c')
-rw-r--r--kernel/keyboard.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/kernel/keyboard.c b/kernel/keyboard.c
index 653d2ba..ede71a2 100644
--- a/kernel/keyboard.c
+++ b/kernel/keyboard.c
@@ -1,4 +1,5 @@
#include "kernel.h"
+#include "x86.h"
#include "console.h"
#include "../lib/logger/log.h" // logger facilities
#define FOOLOS_MODULE_NAME "keyboard"
@@ -11,6 +12,7 @@
void keyboard_handle(uint8_t in)
{
+ log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"scancode 0x%x",in);
int i=0;
//
@@ -129,30 +131,14 @@ void keyboard_handle(uint8_t in)
void int_kb_handler()
{
- __asm__("pusha");
-
- __asm__("in $0x60, %al");
+ X86_IRQ_BEGIN
static uint8_t kb_in;
-
+ __asm__("in $0x60, %al");
__asm__("mov %%al, %0"::"m" (kb_in));
+ keyboard_handle(kb_in);
- // scr_nextline();
- //scr_put_string("irq 1 -> kb scancodes : ");
- //scr_put_hex(kb_in);
-
-
-
- keyboard_handle(kb_in); //TODO!!
-
- // send EOI to primary PIC
- __asm__("mov $0x20, %al");
- __asm__("out %al, $0x20");
- //
-
- __asm__("popa");
- __asm__("leave");
- __asm__("iret");
+ X86_IRQ_END
}