From bce944d1498eaa3b6940ee234c863b3548a66b37 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 24 Jan 2021 12:00:11 -0500 Subject: graphics! --- src/kernel/elf.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/kernel/elf.c') 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 +} -- cgit v1.2.3