Eggert Jung 6 months ago
parent b0f129141a
commit 2421136335

@ -9,6 +9,8 @@
#include "../device/ps2controller.h" #include "../device/ps2controller.h"
#include "../sync/ticketlock.h"
void printContext(const InterruptContext *context) { void printContext(const InterruptContext *context) {
DBG << "ip: " << hex << context->cs << ':' << context->ip DBG << "ip: " << hex << context->cs << ':' << context->ip
<< " sp: " << context->ss << ':' << context->sp << " flags" << bin << " sp: " << context->ss << ':' << context->sp << " flags" << bin
@ -68,12 +70,16 @@ enum PAGE_FAULT_ERROR {
} }
extern TextStream kout; extern TextStream kout;
extern Ticketlock ticketlock;
void handle_keyboard() { void handle_keyboard() {
//dout[0] << "test"<<endl<<flush; ticketlock.lock();
Key key = Key(); Key key = Key();
if (PS2Controller::fetch(key)) { if (PS2Controller::fetch(key)) {
kout << key.ascii() << flush ; kout << key.ascii() << endl << flush ;
} }
ticketlock.unlock();
LAPIC::endOfInterrupt(); LAPIC::endOfInterrupt();
} }

@ -108,7 +108,7 @@ extern "C" int main() {
DBG << "Main CPU " << static_cast<int>(LAPIC::getID()) << endl << flush; DBG << "Main CPU " << static_cast<int>(LAPIC::getID()) << endl << flush;
//Application{}.action(); Application{}.action();
while (true){ while (true){
DBG << "pos: " << testx << ", " << testy << endl << flush; DBG << "pos: " << testx << ", " << testy << endl << flush;
Core::pause(); Core::pause();

@ -25,7 +25,8 @@ void activeWaitDelay(uint64_t cycles) {
uint64_t counter = 0; // Use volatile to prevent optimization uint64_t counter = 0; // Use volatile to prevent optimization
for (uint64_t i = 0; i < cycles; ++i) { for (uint64_t i = 0; i < cycles; ++i) {
counter++; // Simple operation to consume cycles counter++; // Simple operation to consume cycles
asm("nop"); //asm("nop");
Core::pause();
} }
} }
@ -39,7 +40,7 @@ void Application::action() { // NOLINT
} }
kout << endl << flush; kout << endl << flush;
activeWaitDelay(1000000000); activeWaitDelay(10000000);
if(cnt >= sizeof(text)-1) if(cnt >= sizeof(text)-1)
cnt=0; cnt=0;

Loading…
Cancel
Save