aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/fs
diff options
context:
space:
mode:
authorMarvin Borner2020-05-16 00:42:04 +0200
committerMarvin Borner2020-05-16 00:42:04 +0200
commitffb7cb87593a5de58f7c5183020576dac9d50fc4 (patch)
treeb4d89fdbf7d5ed39e55f8e708ee87da17b957518 /src/kernel/fs
parent916c21af52dc2230d689e1075457c4c29b4b262c (diff)
Non-dynamic working approach
Diffstat (limited to 'src/kernel/fs')
-rw-r--r--src/kernel/fs/elf.c10
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
+}