1

initial keyboard demo

This commit is contained in:
churl
2022-04-28 00:40:34 +02:00
parent 2861c07c1a
commit ac5173ff66
7 changed files with 35 additions and 14 deletions

0
c_os/devices/Key.h Normal file → Executable file
View File

16
c_os/devices/Keyboard.cc Normal file → Executable file
View File

@ -252,6 +252,22 @@ Key Keyboard::key_hit() {
/* Hier muss Code eingefuegt werden. */
bool outbyte;
do {
outbyte = ctrl_port.inb() & outb;
} while (!outbyte);
// Ignore PS2 Mouse
bool auxbyte = ctrl_port.inb() & auxb;
if (auxbyte) {
return invalid;
}
code = (unsigned char)data_port.inb();
if (key_decoded()) {
return gather;
}
return invalid;
}

0
c_os/devices/Keyboard.h Normal file → Executable file
View File

0
c_os/kernel/Globals.cc Normal file → Executable file
View File

0
c_os/kernel/Globals.h Normal file → Executable file
View File

5
c_os/user/KeyboardDemo.cc Normal file → Executable file
View File

@ -13,4 +13,9 @@
void keyboard_demo() {
/* Hier muess Code eingefuegt werden */
while (true) {
kout << kb.key_hit();
kout.flush();
}
}

0
c_os/user/KeyboardDemo.h Normal file → Executable file
View File