From b86f48da7fc46934d576698bb4f16be9b2a7eaf9 Mon Sep 17 00:00:00 2001 From: Miguel Date: Wed, 26 Sep 2018 23:58:14 +0200 Subject: some bugfixes --- driver/keyboard.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'driver/keyboard.c') diff --git a/driver/keyboard.c b/driver/keyboard.c index b9a1dad..f667396 100644 --- a/driver/keyboard.c +++ b/driver/keyboard.c @@ -4,11 +4,14 @@ #include "log.h" #include "e1000.h" #include "kmalloc.h" +#include "interrupts.h" #include #include "inet.h" +ringbuffer kb_in; + static bool ctrl_l=false; static bool shift_l=false; static bool shift_r=false; @@ -31,8 +34,17 @@ static void put(uint8_t c) syscall_generic(SYSCALL_WRITE,kb_stream, (char *)&c , 1, 0); } +uint32_t keyboard_interrupt(uint32_t esp) +{ + + ringbuffer_put(&kb_in,x86_inb(0x60)); + return esp; +} + void keyboard_init(uint32_t s) { + kb_in=ringbuffer_init(1);// 4096 bytes ringbuffer; + interrupt_register(INTERRUPT_KEYBOARD,&keyboard_interrupt); kb_stream=s; } -- cgit v1.2.3