From 8231af9d8d759ae89c8214ca2410b0feab9dfb8c Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Fri, 22 Nov 2024 07:58:15 +0100 Subject: Add basic parsing for underlying ELF executables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The given initrd is a CPIO archive of multiple ELF executables. We are already able to parse the CPIO archive to detect where each file is located, this commit adds the mapping for each ELF executable to the corresponding task_struct. Note that this is still heavily under construction, since we cannot simply jump into the entry point of an executable as we have not yet setup the proper layout from performing context switches. Signed-off-by: Miquel Sabaté Solà --- kernel/head.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'kernel/head.S') diff --git a/kernel/head.S b/kernel/head.S index de7852b..9018a8e 100644 --- a/kernel/head.S +++ b/kernel/head.S @@ -43,8 +43,8 @@ _start: csrw sscratch, 0 // Point tp and sp to the init task. - la tp, init_task - la sp, init_task + THREAD_SIZE + la tp, tasks + la sp, tasks + THREAD_SIZE // The `start_kernel` function requires an argument to be passed, which is // the pointer to the `fdt` blob. The bootloader puts this on the `a1` -- cgit v1.2.3