diff options
Diffstat (limited to 'src/kernel/fs/elf.c')
-rw-r--r-- | src/kernel/fs/elf.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/kernel/fs/elf.c b/src/kernel/fs/elf.c index a67ab6a..ba9251a 100644 --- a/src/kernel/fs/elf.c +++ b/src/kernel/fs/elf.c @@ -25,6 +25,12 @@ int is_elf(struct elf_header *header) struct process *elf_load(char *path) { + u32 *prev_dir; + if (current_proc) + prev_dir = current_proc->cr3; + else + prev_dir = current_page_directory; + u8 *file = read_file(path); if (!file) { warn("File or directory not found: %s", path); @@ -71,6 +77,6 @@ struct process *elf_load(char *path) } } - paging_switch_directory(paging_kernel_directory); + paging_switch_directory(prev_dir); return proc; -}
\ No newline at end of file +} |