heading to laptop
This commit is contained in:
@@ -57,9 +57,10 @@ vfs_node_t* load_initrd() {
|
||||
}
|
||||
|
||||
void load_root_program(const char* path) {
|
||||
disable_interrupts();
|
||||
lock_scheduler();
|
||||
uint32_t kernel_cr3 = fetch_cr3();
|
||||
void* cr3 = create_task_pd();
|
||||
|
||||
load_pd(cr3);
|
||||
flush_tlb();
|
||||
|
||||
@@ -132,7 +133,8 @@ void load_root_program(const char* path) {
|
||||
process_t* process = kalloc(sizeof(process_t));
|
||||
init_task(process, e_hdr->e_entry, (uint32_t)cr3, 1, (uint32_t)u_esp);
|
||||
add_task(process);
|
||||
enable_interrupts();
|
||||
|
||||
unlock_scheduler();
|
||||
|
||||
load_pd((void*)kernel_cr3);
|
||||
flush_tlb();
|
||||
@@ -177,4 +179,6 @@ void kmain(uint32_t magic, multiboot_info* mbi) {
|
||||
|
||||
kprintf("loading test program\n");
|
||||
load_root_program("/test.elf");
|
||||
|
||||
kprintf("kernel going to sleep...\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user