fixed a bug where uninitialized memory was used
This commit is contained in:
parent
cf16b1c37c
commit
7d6c2a0dd1
2 changed files with 5 additions and 2 deletions
|
@ -26,14 +26,17 @@ extern "C" cpu_state *handleINT(cpu_state *state) {
|
||||||
*out << "Interrupt ";
|
*out << "Interrupt ";
|
||||||
out->puti(state->intr);
|
out->puti(state->intr);
|
||||||
*out << " occurred!\n";
|
*out << " occurred!\n";
|
||||||
|
cpu_state *new_cpu=state;
|
||||||
if (state->intr < 32) {
|
if (state->intr < 32) {
|
||||||
out->setColor(Color::RED);
|
out->setColor(Color::RED);
|
||||||
print_regdump(state);
|
print_regdump(state);
|
||||||
*out << "KERNEL PANIC: Unhandled CPU exception\n";
|
*out << "KERNEL PANIC: Unhandled CPU exception\n";
|
||||||
for (;;)
|
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) {
|
extern "C" void panic2(cpu_state *state) {
|
||||||
state->rsp = (uintptr_t)state;
|
state->rsp = (uintptr_t)state;
|
||||||
|
|
|
@ -11,7 +11,7 @@ auto PMM::isFree(phys_t addr) -> bool {
|
||||||
return false;
|
return false;
|
||||||
return true;
|
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() {
|
void PMM::fill() {
|
||||||
for(phys_t i=lowest_page; i<highest_page+1; i+=page_size) {
|
for(phys_t i=lowest_page; i<highest_page+1; i+=page_size) {
|
||||||
if(isFree(i))
|
if(isFree(i))
|
||||||
|
|
Loading…
Reference in a new issue