summaryrefslogtreecommitdiff
path: root/src/kernel/elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/elf.c')
-rw-r--r--src/kernel/elf.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/kernel/elf.c b/src/kernel/elf.c
index 423d51a..07cff91 100644
--- a/src/kernel/elf.c
+++ b/src/kernel/elf.c
@@ -126,6 +126,20 @@ bool try_elf_run(const struct drive *d, const char *path, const char *pass_old_v
tstate.page_directory = pd;
tstate.ret_addr = ehead.entry_vma;
tstate.edx = (uint32_t)pass_vma;
+
+ const char *path_end_start = path;
+ for (const char *i = path; *i; ++i)
+ if (*i == '/')
+ path_end_start = i + 1;
+
+ uint8_t i;
+ for (i = 0; i < TASK_NAME_LEN; ++i) {
+ if (!path_end_start[i])
+ break;
+ tstate.name[i] = path_end_start[i];
+ }
+ tstate.name[i] = '\0';
+
new_task(tstate);
return true;
} \ No newline at end of file