[kernel] Clean up main.cpp and others
The kernel/main.cpp and kernel/memory_bootstrap.cpp files had become something of a junk drawer. This change cleans them up in the following ways: - Most CPU initialization has moved to cpu.cpp, allowing several functions to be made static and removed from cpu.h - Multi-core startup code has moved to the new smp.h and smp.cpp, and ap_startup.s has been renamed smp.s to match. - run_constructors() has moved to memory_bootstrap.cpp, and all the functionality of that file has been hidden behind a new public interface mem::initialize(). - load_init_server() has moved from memory_bootstrap.cpp to main.cpp
This commit is contained in:
@@ -100,14 +100,14 @@ isr_handler(cpu_state *regs)
|
||||
|
||||
case isr::isrGPFault:
|
||||
if (regs->errorcode & 0xfff0) {
|
||||
int index = (regs->errorcode & 0xffff) >> 4;
|
||||
int index = (regs->errorcode & 0xffff) >> 3;
|
||||
int ti = (regs->errorcode & 0x07) >> 1;
|
||||
char const *table =
|
||||
(ti & 1) ? "IDT" :
|
||||
(!ti) ? "GDT" :
|
||||
"LDT";
|
||||
|
||||
snprintf(message, sizeof(message), "General Protection Fault, error:%lx%s %s[%d]",
|
||||
snprintf(message, sizeof(message), "General Protection Fault, error:0x%lx%s %s[%d]",
|
||||
regs->errorcode, regs->errorcode & 1 ? " external" : "", table, index);
|
||||
} else {
|
||||
snprintf(message, sizeof(message), "General Protection Fault, error:%lx%s",
|
||||
|
||||
Reference in New Issue
Block a user