Compare commits

...

2 Commits

Author SHA1 Message Date
5682a96d5d PS/2 KB driver ignore ack byte
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m16s
2026-03-08 19:38:09 +01:00
23fffba99b PS/2 KB driver set typematic delay to 250ms for smoother typing 2026-03-08 19:28:24 +01:00

View File

@@ -151,7 +151,7 @@ static void ps2kb_irq (void* arg, void* regs, struct reschedule_ctx* rctx) {
int32_t keycode = ps2kb_keycode (); int32_t keycode = ps2kb_keycode ();
if (keycode <= 0) if (keycode <= 0 || keycode == 0xFA)
return; return;
spin_lock (&ps2kb_ringbuffer_lock); spin_lock (&ps2kb_ringbuffer_lock);
@@ -217,6 +217,18 @@ int ps2kb_read_key (struct device* device, struct proc* proc, struct reschedule_
return ST_OK; 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) { bool ps2kb_init (struct device* device, void* arg) {
(void)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_CTL_STATUS, 0x60);
outb (KB_DATA, cb); outb (KB_DATA, cb);
/* 250ms delay, 30hz rate */
ps2kb_set_typematic (0x00, 0x00);
return true; return true;
} }