From 9c928f4962e4c4f9a03104bb0d6bac82f2cfa628 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Tue, 8 Jul 2014 19:19:31 +0200 Subject: added and successfuly tested software interrupt int 88 is issued by the kb driver whenever A is pressed and the the int_test_handler is run. --- kernel/interrupts.c | 4 +++- kernel/kernel.c | 8 +++++--- kernel/keyboard.c | 4 ++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/kernel/interrupts.c b/kernel/interrupts.c index 7b44482..0676732 100644 --- a/kernel/interrupts.c +++ b/kernel/interrupts.c @@ -102,7 +102,9 @@ void int_show() int offset; for(offset=32;offset<40;offset++) { - print_hex(offset-32); //irq + print_hex(offset-32); //ir // install keyboard handler + int_install_ir(33, 0b10001110, 0x08,&int_kb_handler); +q print_string(" -> "); print_hex(*(ptr3+offset*4)); //addrLo print_hex(*(ptr3+1+offset*4)); //sel diff --git a/kernel/kernel.c b/kernel/kernel.c index 9bc3d64..989eab6 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -14,7 +14,7 @@ void int_test_handler() { __asm__("pusha"); - scr_put_string_nl("inside software interrupt handler 8"); + scr_put_string_nl("inside software interrupt handler 88"); __asm__("popa"); @@ -36,13 +36,15 @@ void kernel_main() // install and enable! int_init(0x08); int_install(); - int_enable(); // install keyboard handler int_install_ir(33, 0b10001110, 0x08,&int_kb_handler); // install test handler -// int_install_ir(33, 0b10001110, 0x08,&int_kb_handler); + int_install_ir(88, 0b10001110, 0x08,&int_test_handler); + + // now we can enable interrupts back again + int_enable(); scr_put_string_nl("Interrupts are up and running"); diff --git a/kernel/keyboard.c b/kernel/keyboard.c index d1175c1..5d5e71f 100644 --- a/kernel/keyboard.c +++ b/kernel/keyboard.c @@ -10,6 +10,10 @@ static char last_code=0; void int0(uint8_t in) { + + if(in==0x1e)__asm__("int $88"); // test interrupt 88 + // whenver A is pressed + int i=0; // //print_hex(int_count); -- cgit v1.2.3