.{memory, log, string, buffer} := @use("../../../libraries/stn/src/lib.hb") send_byte := fn(byte: u8): u8 { memory.outb(0, 96, byte) input := memory.inb(0, 96) return input } main := fn(): int { log.info("PS/2 Driver Loaded\0") if send_byte(238) == 238 { log.info("PS/2 Keyboard Echoed\0") } if send_byte(244) == 250 { log.info("Enabled scanning\0") } buf := buffer.create() ptr := memory.request_page(1) prev_input := 250 loop { input := memory.inb(0, 96) if input == prev_input { continue } prev_input = input keycode_str := string.display_int(input, ptr) log.info(string.display_int(buf)) buffer.send_message(buf, keycode_str, string.length(keycode_str)) } return 0 }