Read the scancode from the keyboard buffer when keyboard interrupt received
*This* is why I couldn't get more that one keyboard interrupt.
This commit is contained in:
parent
cd39d95a1c
commit
3e1993084d
1 changed files with 8 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include "Interrupts.hh"
|
#include "Interrupts.hh"
|
||||||
#include "Console.hh"
|
#include "Console.hh"
|
||||||
|
#include "IO.hh"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
void dispatchExceptionHandler(size_t vector);
|
void dispatchExceptionHandler(size_t vector);
|
||||||
|
@ -115,8 +116,14 @@ InterruptHandler::doTimerInterrupt()
|
||||||
void
|
void
|
||||||
InterruptHandler::doKeyboardInterrupt()
|
InterruptHandler::doKeyboardInterrupt()
|
||||||
{
|
{
|
||||||
|
// Quick 'n dirty read the scancode.
|
||||||
|
unsigned int c = 0;
|
||||||
|
do {
|
||||||
|
c = kernel::io::inb(0x60);
|
||||||
|
} while (c == 0);
|
||||||
|
|
||||||
auto& console = kernel::Console::systemConsole();
|
auto& console = kernel::Console::systemConsole();
|
||||||
console.printString("Key!\n");
|
console.printFormat("Key! (scancode 0x%02X)\n", c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue