diff options
| author | Miguel <m.i@gmx.at> | 2018-08-18 13:23:53 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-08-18 13:23:53 +0200 |
| commit | 7b0d88b2dff9b635d9ff69f6d51b6832c1ca4c40 (patch) | |
| tree | 22c452e9c7ad586136721e776e0b67b23fb33119 /driver | |
| parent | 17fd357bad5f6c3362cfdab1d807aa463c69a4e9 (diff) | |
cleaning up syscalls and playing with new pipes
Diffstat (limited to 'driver')
| -rw-r--r-- | driver/keyboard.c | 15 | ||||
| -rw-r--r-- | driver/screen.c | 3 |
2 files changed, 12 insertions, 6 deletions
diff --git a/driver/keyboard.c b/driver/keyboard.c index f2a44ec..8d7c8aa 100644 --- a/driver/keyboard.c +++ b/driver/keyboard.c @@ -1,5 +1,5 @@ /// idiots keyboard driver //// -// http://www.computer-engineering.org/ps2keyboard/scancodes1.html +// http://www.computer-engineering.org/ps2keyboard/scancodes1.html #define FOOLOS_MODULE_NAME "keyboard" #include <stdbool.h> @@ -10,11 +10,16 @@ static bool shift_l=false; static bool shift_r=false; static bool capslock=false; -static void (*put)(uint8_t c); +static uint32_t kb_stream; -void keyboard_init(void (*func)(uint8_t c)) +static void put(uint8_t c) { - put=func; + syscall_write(kb_stream,&c,1); +} + +void keyboard_init(uint32_t s) +{ + kb_stream=s; } void keyboard_handle(uint8_t in) @@ -122,10 +127,10 @@ void keyboard_handle(uint8_t in) if(break_caps_lock==in)capslock=!capslock; - char ascii; bool match=false; + // optimize this! if(ctrl_l) { diff --git a/driver/screen.c b/driver/screen.c index 6b47312..f095a15 100644 --- a/driver/screen.c +++ b/driver/screen.c @@ -1,5 +1,5 @@ #include "screen.h" -#include "kernel/config.h" +#include "kernel/kernel.h" //#define FOOLOS_CONSOLE @@ -15,6 +15,7 @@ void update_cursor(uint32_t col,uint32_t row) // cursor LOW port to vga INDEX register x86_outb(0x3D4, 0x0F); x86_outb(0x3D5, (unsigned char)(position&0xFF)); + // cursor HIGH port to vga INDEX register x86_outb(0x3D4, 0x0E); x86_outb(0x3D5, (unsigned char )((position>>8)&0xFF)); |
