Starting work on a PS2 keyboard driver.
This commit is contained in:
parent
c98464d1c7
commit
e636f24995
16
kernel/arch/i386/ps2.nim
Normal file
16
kernel/arch/i386/ps2.nim
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user