summaryrefslogtreecommitdiff
path: root/src/kernel/linker
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/linker')
-rw-r--r--src/kernel/linker/elf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/kernel/linker/elf.c b/src/kernel/linker/elf.c
index bbf4906..6ad5d34 100644
--- a/src/kernel/linker/elf.c
+++ b/src/kernel/linker/elf.c
@@ -16,6 +16,8 @@ thread_entry elf_load(uint8_t *data, struct process* process) {
int i;
if (elf_check(data)) return 0;
+ struct page_directory *r = current_pagedir;
+ cli();
pagedir_switch(process->pagedir);
phdr = (struct elf_phdr*)((uint8_t*)(data + ehdr->e_phoff));
@@ -28,6 +30,10 @@ thread_entry elf_load(uint8_t *data, struct process* process) {
}
}
}
+
+ pagedir_switch(r);
+ sti();
+
return (thread_entry)ehdr->e_entry;
}