Convert page_block to use kutil::linked_list

- Created a new linked_list-based slab allocator
- Simplified memory bootstrap code by using the slab allocator and
  linked_lists
This commit is contained in:
Justin C. Miller
2018-09-11 20:46:48 -07:00
parent d5c44645eb
commit 593cda3ee8
9 changed files with 427 additions and 405 deletions

View File

@@ -48,13 +48,19 @@ init_console()
log::enable(logs::task, log::level::debug);
}
void do_error_3() { volatile int x = 1; volatile int y = 0; volatile int z = x / y; }
void do_error_2() { do_error_3(); }
void do_error_1() { do_error_2(); }
void
kernel_main(popcorn_data *header)
{
#ifdef DEBUG
// Run `waf configure --debug` to enable compiling with DEBUG turned on.
// Then attach to QEMU's gdb server and `set waiting = false` to start
// the kernel. This compensates for GDB's poor handling of QEMU going
// through the x86 PC startup and switching to 64 bit mode when you
// attach to qemu with the -S option.
bool waiting = true;
while (waiting);
#endif
kutil::assert_set_callback(__kernel_assert);
gdt_init();
@@ -135,11 +141,6 @@ kernel_main(popcorn_data *header)
}
*/
// do_error_1();
// __asm__ __volatile__("int $15");
// pager->dump_pml4();
syscall_enable();
scheduler *sched = new (&scheduler::get()) scheduler(devices->get_lapic());