diff options
author | Marvin Borner | 2019-09-22 14:09:10 +0200 |
---|---|---|
committer | Marvin Borner | 2019-09-22 14:09:10 +0200 |
commit | 678407d44a28b7a7afd6f3873aa2fc36bbcf5e55 (patch) | |
tree | 3c2c37e3c96cc344548a8b332f9e812a0fe64a8b | |
parent | d62ea94750d6b2cd1eb1b754b40eada92c094e4e (diff) |
Added faster keyboard rate
Needs a fix for Qemu though
-rw-r--r-- | src/kernel/input/ps2/keyboard.c | 13 | ||||
-rw-r--r-- | src/kernel/kernel.c | 5 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/kernel/input/ps2/keyboard.c b/src/kernel/input/ps2/keyboard.c index c40f1f5..e092630 100644 --- a/src/kernel/input/ps2/keyboard.c +++ b/src/kernel/input/ps2/keyboard.c @@ -2,7 +2,7 @@ #include "../../io/io.h" #include "../../graphics/graphics.h" -unsigned char keymap[128] = { +char keymap[128] = { 0 /*E*/, 27, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', '\b', '\t', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n', 0 /*C*/, 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`', 0 /*LS*/, @@ -44,7 +44,18 @@ void keyboard_handler(struct regs *r) { } } +void keyboard_acknowledge() { + while (receive_b(0x60) != 0xfa); +} + +void keyboard_rate() { + send_b(0x60, 0xF3); + keyboard_acknowledge(); + send_b(0x60, 0x0); // Rate{00000} Delay{00} 0 +} + /* Installs the keyboard handler into IRQ1 */ void keyboard_install() { + keyboard_rate(); irq_install_handler(1, keyboard_handler); } diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c index 4ef53c0..282a9a2 100644 --- a/src/kernel/kernel.c +++ b/src/kernel/kernel.c @@ -3,7 +3,6 @@ #include "interrupts/interrupts.h" #include "input/input.h" #include "timer/timer.h" -#include "sound/sound.h" void kernel_main(void) { asm volatile ("sti"); @@ -13,11 +12,11 @@ void kernel_main(void) { irq_install(); terminal_initialize(); - vesa_init(); + // vesa_init(); terminal_write_string("Melvix loaded successfully!\n"); timer_install(); keyboard_install(); - mouse_install(); + // mouse_install(); // __asm__ ("div %0" :: "r"(0)); // Exception testing x/0 }
\ No newline at end of file |