diff --git a/interrupt/handlers.cc b/interrupt/handlers.cc index 6e00494..72bf885 100644 --- a/interrupt/handlers.cc +++ b/interrupt/handlers.cc @@ -9,6 +9,8 @@ #include "../device/ps2controller.h" +#include "../sync/ticketlock.h" + void printContext(const InterruptContext *context) { DBG << "ip: " << hex << context->cs << ':' << context->ip << " sp: " << context->ss << ':' << context->sp << " flags" << bin @@ -68,12 +70,16 @@ enum PAGE_FAULT_ERROR { } extern TextStream kout; +extern Ticketlock ticketlock; void handle_keyboard() { - //dout[0] << "test"<(LAPIC::getID()) << endl << flush; - //Application{}.action(); + Application{}.action(); while (true){ DBG << "pos: " << testx << ", " << testy << endl << flush; Core::pause(); diff --git a/user/app1/appl.cc b/user/app1/appl.cc index 3fcdba8..5f37b32 100644 --- a/user/app1/appl.cc +++ b/user/app1/appl.cc @@ -25,7 +25,8 @@ void activeWaitDelay(uint64_t cycles) { uint64_t counter = 0; // Use volatile to prevent optimization for (uint64_t i = 0; i < cycles; ++i) { counter++; // Simple operation to consume cycles - asm("nop"); + //asm("nop"); + Core::pause(); } } @@ -39,7 +40,7 @@ void Application::action() { // NOLINT } kout << endl << flush; - activeWaitDelay(1000000000); + activeWaitDelay(10000000); if(cnt >= sizeof(text)-1) cnt=0;