Simplify task switches

No longer using the rsp from the entry to the kernel, but instead
switching rsp at task-switching time in assembly.

This currently breaks fork()
This commit is contained in:
Justin C. Miller
2019-03-31 22:49:24 -07:00
parent 5cdbedd4d1
commit ca2362f858
21 changed files with 311 additions and 178 deletions

View File

@@ -12,6 +12,9 @@ print_regs(const cpu_state &regs)
{
console *cons = console::get();
uint64_t cr2 = 0;
__asm__ __volatile__ ("mov %%cr2, %0" : "=r"(cr2));
print_regL("rax", regs.rax);
print_regM("rbx", regs.rbx);
print_regR("rcx", regs.rcx);
@@ -36,7 +39,9 @@ print_regs(const cpu_state &regs)
print_regL("rip", regs.rip);
print_regM("cr3", page_manager::get()->get_pml4());
cons->puts("\n\n");
print_regR("cr2", cr2);
cons->puts("\n");
}
struct frame