aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/fs/elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/fs/elf.c')
-rw-r--r--src/kernel/fs/elf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/kernel/fs/elf.c b/src/kernel/fs/elf.c
index bee53c9..9a9b105 100644
--- a/src/kernel/fs/elf.c
+++ b/src/kernel/fs/elf.c
@@ -40,7 +40,7 @@ struct process *elf_load(char *path)
}
struct process *proc = process_make_new();
- proc->name = path;
+ strcpy(proc->name, path);
proc->registers.eip = header->entry;
paging_switch_directory(proc->cr3);
@@ -54,8 +54,7 @@ struct process *elf_load(char *path)
switch (program_header->type) {
case 0:
break;
- case 1:
- debug("Allocating space for ELF binary section...");
+ case 1: {
u32 loc = (u32)kmalloc_a(PAGE_S);
paging_map_user(proc->cr3, loc, program_header->vaddr);
memcpy((void *)program_header->vaddr,
@@ -64,6 +63,7 @@ struct process *elf_load(char *path)
if (program_header->filesz > PAGE_S)
panic("ELF binary section too large");
break;
+ }
default:
warn("Unknown header type");
}
@@ -71,4 +71,4 @@ struct process *elf_load(char *path)
paging_switch_directory(paging_root_directory);
return proc;
-} \ No newline at end of file
+}