diff --git a/kernel/arch/x86_64/interrupt.cpp b/kernel/arch/x86_64/interrupt.cpp index d912a9d..db4eda0 100644 --- a/kernel/arch/x86_64/interrupt.cpp +++ b/kernel/arch/x86_64/interrupt.cpp @@ -26,14 +26,17 @@ extern "C" cpu_state *handleINT(cpu_state *state) { *out << "Interrupt "; out->puti(state->intr); *out << " occurred!\n"; + cpu_state *new_cpu=state; if (state->intr < 32) { out->setColor(Color::RED); print_regdump(state); *out << "KERNEL PANIC: Unhandled CPU exception\n"; for (;;) ; + } else if(state->intr < 48) { + new_cpu=(cpu_state*)irqs->handleIRQ(new_cpu); } - return state; + return new_cpu; } extern "C" void panic2(cpu_state *state) { state->rsp = (uintptr_t)state; diff --git a/kernel/src/pmm.cpp b/kernel/src/pmm.cpp index 5885e73..474428c 100644 --- a/kernel/src/pmm.cpp +++ b/kernel/src/pmm.cpp @@ -11,7 +11,7 @@ auto PMM::isFree(phys_t addr) -> bool { return false; return true; } -PMM::PMM(phys_t page_size): page_size(page_size), head(nullptr) {} +PMM::PMM(phys_t page_size): page_size(page_size), head(nullptr), lowest_page(~0), highest_page(0) {} void PMM::fill() { for(phys_t i=lowest_page; i