diff options
Diffstat (limited to 'src/kernel/elf.c')
-rw-r--r-- | src/kernel/elf.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/kernel/elf.c b/src/kernel/elf.c index 60fa3a9..146035e 100644 --- a/src/kernel/elf.c +++ b/src/kernel/elf.c @@ -73,7 +73,7 @@ struct ph_entry { uint32_t align; } __attribute__ ((packed)); -uint32_t try_elf_run(const struct drive *d, const char *path, const char *pass_old_vma) { +uint32_t try_elf_run(const struct drive *d, const char *path, const char *pass_old_vma, uint32_t io_handle) { file_id_t h = d->get_file(d, path); if (!h) return 0; @@ -127,8 +127,12 @@ uint32_t try_elf_run(const struct drive *d, const char *path, const char *pass_o struct task_state tstate; tstate.page_directory = pd; tstate.ret_addr = ehead.entry_vma; + tstate.stack_bottom = 0; + tstate.edx = (uint32_t)pass_vma; - tstate.wait_mode = NONE; + tstate.esi = active_task - tasks + 1; + tstate.edi = io_handle; + tstate.esp = 0; const char *path_end_start = path; for (const char *i = path; *i; ++i) @@ -144,4 +148,4 @@ uint32_t try_elf_run(const struct drive *d, const char *path, const char *pass_o tstate.name[i] = '\0'; return new_task(tstate); -}
\ No newline at end of file +} |