summaryrefslogtreecommitdiff
path: root/src/kernel/elf.c
diff options
context:
space:
mode:
authorBenji Dial <benji6283@gmail.com>2021-01-24 12:00:11 -0500
committerBenji Dial <benji6283@gmail.com>2021-01-24 12:00:11 -0500
commitbce944d1498eaa3b6940ee234c863b3548a66b37 (patch)
treeea40c087ab4f0f236aee8d158cf68550f5209f72 /src/kernel/elf.c
parentca731aa747214919df7b3dfe3478dbe787ce5b68 (diff)
downloadportland-os-bce944d1498eaa3b6940ee234c863b3548a66b37.tar.gz
graphics!
Diffstat (limited to 'src/kernel/elf.c')
-rw-r--r--src/kernel/elf.c10
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
+}