diff --git a/kernel/device/ps2_kb.c b/kernel/device/ps2_kb.c index c2cb414..79f80b1 100644 --- a/kernel/device/ps2_kb.c +++ b/kernel/device/ps2_kb.c @@ -217,6 +217,18 @@ int ps2kb_read_key (struct device* device, struct proc* proc, struct reschedule_ return ST_OK; } +static void ps2kb_set_typematic (uint8_t delay, uint8_t rate) { + while (inb (KB_CTL_STATUS) & 0x02) + ; + + outb (KB_DATA, 0xF3); + + while (inb (KB_CTL_STATUS) & 0x02) + ; + + outb (KB_DATA, (delay << 5) | (rate & 0x1F)); +} + bool ps2kb_init (struct device* device, void* arg) { (void)device, (void)arg; @@ -237,6 +249,9 @@ bool ps2kb_init (struct device* device, void* arg) { outb (KB_CTL_STATUS, 0x60); outb (KB_DATA, cb); + /* 250ms delay, 30hz rate */ + ps2kb_set_typematic (0x00, 0x00); + return true; }