Handle ps2 keyboard, no APIC for now

This commit is contained in:
2025-09-07 14:25:23 +02:00
parent 0cbf308d95
commit 4f3053bc8e
13 changed files with 61 additions and 226 deletions

View File

@ -0,0 +1,19 @@
#include <stdint.h>
#include "ps2kb.h"
#include "hal/hal.h"
#include "kprintf.h"
void ps2kb_write(uint8_t val) {
while (io_in8(0x64) & 2);
io_out8(0x64, val);
}
uint8_t ps2kb_read(void) {
while (!(io_in8(0x64) & 1));
return io_in8(0x60);
}
void ps2kb_intr(void) {
uint8_t scancode = ps2kb_read();
kprintf("%02x\n", scancode);
}

View File

@ -0,0 +1,10 @@
#ifndef DRIVERS_PS2KB_H_
#define DRIVERS_PS2KB_H_
#include <stdint.h>
void ps2kb_write(uint8_t val);
uint8_t ps2kb_read(void);
void ps2kb_intr(void);
#endif // DRIVERS_PS2KB_H_