From 5481848e27fdd4fc859def9841a0283665531a46 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 13 Sep 2020 17:12:29 -0400 Subject: fixed some paging bugs, added fault handlers and new programs --- src/kernel/elf.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/kernel/elf.c') 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 -- cgit v1.2.3