From 678407d44a28b7a7afd6f3873aa2fc36bbcf5e55 Mon Sep 17 00:00:00 2001
From: Marvin Borner
Date: Sun, 22 Sep 2019 14:09:10 +0200
Subject: Added faster keyboard rate

Needs a fix for Qemu though
---
 src/kernel/input/ps2/keyboard.c | 13 ++++++++++++-
 src/kernel/kernel.c             |  5 ++---
 2 files changed, 14 insertions(+), 4 deletions(-)

(limited to 'src')

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
-- 
cgit v1.2.3