initial keyboard demo
This commit is contained in:
0
c_os/devices/Key.h
Normal file → Executable file
0
c_os/devices/Key.h
Normal file → Executable file
16
c_os/devices/Keyboard.cc
Normal file → Executable file
16
c_os/devices/Keyboard.cc
Normal file → Executable 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
0
c_os/devices/Keyboard.h
Normal file → Executable file
0
c_os/kernel/Globals.cc
Normal file → Executable file
0
c_os/kernel/Globals.cc
Normal file → Executable file
0
c_os/kernel/Globals.h
Normal file → Executable file
0
c_os/kernel/Globals.h
Normal file → Executable file
5
c_os/user/KeyboardDemo.cc
Normal file → Executable file
5
c_os/user/KeyboardDemo.cc
Normal file → Executable 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
0
c_os/user/KeyboardDemo.h
Normal file → Executable file
Reference in New Issue
Block a user