1
0
mirror of https://gitlab.os-k.eu/os-k-team/os-k.git synced 2023-08-25 14:03:10 +02:00

Keyboard in progress

This commit is contained in:
Adrien Bourmault 2019-04-24 11:55:15 +02:00
parent 516a92973b
commit f005894088

View File

@ -26,9 +26,30 @@
#include <kernel/iomisc.h>
extern void KeybIsr(void);
extern void IdtRegisterIrq(void (*isr)(void), uchar irq, uchar flags);
void KeybSetup(void)
{
CpuRegisterIrq(KeybIsr, 0x21, 0x8E);
IdtRegisterIrq(KeybIsr, 0x21, 0x8E);
}
uchar KeybHandler(void)
{
uchar status;
uchar code;
// write EOI
outb(0x20, 0x20);
status = IoReadByteFromPort(KeybStatusPort);
if (status & 0x01) {
code = IoReadByteFromPort(KeybDataPort);
if(code < 0) return 0;
return code;
}
}