aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/dev
diff options
context:
space:
mode:
authorEmulatedSeasons <89668582+EmulatedSeasons@users.noreply.github.com>2023-12-17 17:18:02 -0500
committerEmulatedSeasons <89668582+EmulatedSeasons@users.noreply.github.com>2023-12-17 17:18:02 -0500
commitd286be47997ecfc4038ded9442770d603ce53b30 (patch)
tree697a58914befc58adbe7a7f27dfed049c9a6c5d2 /kernel/dev
parenta78033acc941fc4bcf6188f1d48fd8e012673fff (diff)
forgot what i did this commit it's been so long
Diffstat (limited to 'kernel/dev')
-rw-r--r--kernel/dev/ps2kbd.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/dev/ps2kbd.cpp b/kernel/dev/ps2kbd.cpp
index a98ae51..ee282b6 100644
--- a/kernel/dev/ps2kbd.cpp
+++ b/kernel/dev/ps2kbd.cpp
@@ -3,8 +3,23 @@
#include <arch/i386/pic.h>
#include <io.h>
+// Keycodes are sorted from left to right, up to down starting with esc
+// 0x80 is reserved for nonexistant scancodes
+// used for scan code set 2
+constexpr uint8_t scancodes[] = {
+ 9, 0x80, 5, 3, 1, 2, 12, 0x80,
+ 10, 8, 6, 4, 27,
+};
+
void keyboard_init() {
irq_clear_mask(1);
outb(0x60, 0xF4);
inb(0x60);
+}
+
+void keyboard_write(uint8_t scancode) {
+ printf("a\n");
+ /*for (int i = 0; i < 7; i++) {
+ inputbuffer |= inb(PS2_DATA) << (i * 8); // lsb is the first scan code
+ }*/
} \ No newline at end of file