Some attempts at PS/2 kbd stuff

This commit is contained in:
Kat R. 2022-10-29 10:05:24 -05:00
parent 863a63472f
commit 494ed66266
2 changed files with 25 additions and 0 deletions

15
arch/i386/ps2_kbd.c Normal file
View File

@ -0,0 +1,15 @@
#include "ps2_kbd.h"
#include <sys/io.h>
unsigned char get_ps2_inbyte() {
return inb(0x60);
}
unsigned char* identify_device() {
unsigned char ret_val[2]; int j = 0;
outb(0xF2, 0x64);
for(unsigned char i; i != 0xFA; i = inb(0x60)) {
ret_val[j++] = i;
}
return ret_val;
}

10
arch/i386/ps2_kbd.h Normal file
View File

@ -0,0 +1,10 @@
#ifndef _ARCH_I386_PS2_KBD_H
#define _ARCH_I386_PS2_KBD_H
int scan_set;
unsigned char get_ps2_inbyte();
unsigned char* identify_device();
#endif