diff options
author | Marvin Borner | 2020-05-07 22:16:09 +0200 |
---|---|---|
committer | Marvin Borner | 2020-05-07 22:16:09 +0200 |
commit | 43184e40b14a5e41383ffb053e7c69c93ff81036 (patch) | |
tree | 54dd707cd997f1a5483d03ef6f7e6320b07227ac /src/kernel/fs/elf.c | |
parent | 4286b14839c0c4ec016d816e426660f6685ae349 (diff) |
Some debugging and fixing
Still didn't fix the bugs
Diffstat (limited to 'src/kernel/fs/elf.c')
-rw-r--r-- | src/kernel/fs/elf.c | 8 |
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 +} |