diff --git a/kernel/arch/i386/ps2.nim b/kernel/arch/i386/ps2.nim new file mode 100644 index 0000000..21c2247 --- /dev/null +++ b/kernel/arch/i386/ps2.nim @@ -0,0 +1,16 @@ +import io + +const keyboardAddress = 0x60 + +type + KeypressEvent = tuple + character: char + pressed: bool + +proc getScancode(): char = + while true: + let c = io.inb(keyboardAddress) + if(c > 0): return c + +proc getChar*(): char = + discard # TODO: Implement lookup to a scan table to get actual character