summaryrefslogtreecommitdiff
path: root/kernel/src/devices
diff options
context:
space:
mode:
authorAleksa Vuckovic <aleksav013@gmail.com>2022-08-05 14:33:51 +0200
committerAleksa Vuckovic <aleksav013@gmail.com>2022-08-05 14:33:51 +0200
commitbd7d4366b6643b5c6cd04f40dd32f5d9c9575fd6 (patch)
tree92429e897be007d46c8f063a39a986df2124111a /kernel/src/devices
parentbe3274c49d0ca5e31daa855c4c109d830fdead67 (diff)
organised files; switched to recursive make
Diffstat (limited to 'kernel/src/devices')
-rw-r--r--kernel/src/devices/keyboard.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/src/devices/keyboard.c b/kernel/src/devices/keyboard.c
new file mode 100644
index 0000000..105c3a8
--- /dev/null
+++ b/kernel/src/devices/keyboard.c
@@ -0,0 +1,20 @@
+#include <stdint.h>
+#include <pic.h>
+#include <io.h>
+#include <graphics.h>
+#include <debug.h>
+
+#define KEYBOARD_DATA_PORT 0x60
+#define KEYBOARD_STATUS_PORT 0x64
+
+uint8_t i = 0;
+
+void keyboard_handler(void)
+{
+ uint8_t status = inb(KEYBOARD_STATUS_PORT);
+ if (!(status & 0x1)) {
+ return;
+ }
+ uint8_t keycode = inb(KEYBOARD_DATA_PORT);
+ fb_draw_character(fb, keycode, 0, 0, RED, BLACK);
+}