diff options
author | Marvin Borner | 2020-04-27 23:13:36 +0200 |
---|---|---|
committer | Marvin Borner | 2020-04-27 23:13:36 +0200 |
commit | 46007d2598b7aef13895b21669cfb6f24272e5fe (patch) | |
tree | 59f68b3a9449d3777b84292efe55e2dc3f32cdaa /src/kernel | |
parent | f30c9803f05e90087e367953aa142275f8688f61 (diff) |
Minor but important fixes in processing
Diffstat (limited to 'src/kernel')
-rw-r--r-- | src/kernel/fs/elf.c | 4 | ||||
-rw-r--r-- | src/kernel/kernel.c | 3 | ||||
-rw-r--r-- | src/kernel/tasks/process.h | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/kernel/fs/elf.c b/src/kernel/fs/elf.c index aea191b..ec22d77 100644 --- a/src/kernel/fs/elf.c +++ b/src/kernel/fs/elf.c @@ -33,7 +33,8 @@ struct process *elf_load(char *path) struct elf_program_header *program_header = (void *)header + header->phoff; if (!is_elf(header)) { - panic("File not valid"); + warn("File not valid: %s", path); + return NULL; } else { debug("File is valid: %s", path); } @@ -53,7 +54,6 @@ struct process *elf_load(char *path) case 0: break; case 1: - i += 0; debug("Allocating space for ELF binary section..."); uint32_t loc = (uint32_t)kmalloc_a(PAGE_S); paging_map_user(proc->cr3, loc, program_header->vaddr); diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c index 83e0b35..662bb57 100644 --- a/src/kernel/kernel.c +++ b/src/kernel/kernel.c @@ -65,6 +65,9 @@ void kernel_main(uint32_t magic, uint32_t multiboot_address) syscalls_install(); struct process *proc = elf_load("/bin/user"); + proc->stdin = NULL; + proc->stdout = NULL; + proc->stderr = NULL; process_init(proc); halt_loop(); diff --git a/src/kernel/tasks/process.h b/src/kernel/tasks/process.h index df0f51f..fc277f4 100644 --- a/src/kernel/tasks/process.h +++ b/src/kernel/tasks/process.h @@ -23,7 +23,7 @@ struct process { int state; int thread; - uint32_t stdint; + uint32_t stdin; uint32_t stdout; uint32_t stderr; |