From 7e9328b4d3d0949efd2554d13d5ca936572d383f Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Fri, 29 Aug 2014 11:09:11 +0200 Subject: keyboard handler debugging log --- kernel/kernel.c | 2 +- kernel/keyboard.c | 26 ++++++-------------------- kernel/shell.c | 2 ++ 3 files changed, 9 insertions(+), 21 deletions(-) (limited to 'kernel') diff --git a/kernel/kernel.c b/kernel/kernel.c index df5e276..deb1b1a 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -78,7 +78,6 @@ void kernel_main() // keyboard = 33 (irq 1) // floppy = 38 (irq 6) // etc.. - // install PIT interrupt handler int_install_ir(32, 0b10001110, 0x08,&int_clock_handler); @@ -105,6 +104,7 @@ void kernel_main() shell_init(); + while(1); // never ending loop 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 } diff --git a/kernel/shell.c b/kernel/shell.c index 2c7fc95..45e8620 100644 --- a/kernel/shell.c +++ b/kernel/shell.c @@ -20,6 +20,8 @@ void shell_init() void shell_put(char x) { + log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"char:%c",x); + if(pos