summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-08-29 11:09:11 +0200
committerMichal Idziorek <m.i@gmx.at>2014-08-29 11:09:11 +0200
commit7e9328b4d3d0949efd2554d13d5ca936572d383f (patch)
tree3caf6521512ab065edb946ef30709d2ce7ef2a42
parent88fa56f1f6cbb99d865b9040003af0b46a6a1725 (diff)
keyboard handler debugging log
-rw-r--r--kernel/kernel.c2
-rw-r--r--kernel/keyboard.c26
-rw-r--r--kernel/shell.c2
3 files changed, 9 insertions, 21 deletions
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<COMMAND_LENGTH-2);
command[pos]=x;