diff options
| author | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-11-21 13:09:21 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-11-21 13:09:21 +0100 |
| commit | 40ffc517e20c381ce8fdb3a881726a26a52e35db (patch) | |
| tree | b969f6e1bc4c400e8c2c8b1d5a18ed75d3f2fd95 /include | |
| parent | d394978a73fce080128dc414e1771d8d89e1e1e0 (diff) | |
| download | fbos-40ffc517e20c.tar.gz fbos-40ffc517e20c.zip | |
Initial parsing of the provided initrd file
We expect a CPIO archive with the 'newc' format for the initrd. Parse
this archive from the given initrd address and fetch the address for
each ELF executable while also pairing which task correspond to which
ELF.
This commit leaves to do the actual parsing of the ELF file for each
task, while also leaving some string utilities to be refined.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/fbos/init.h | 6 | ||||
| -rw-r--r-- | include/fbos/sched.h | 8 | ||||
| -rw-r--r-- | include/fbos/string.h | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/include/fbos/init.h b/include/fbos/init.h index eb72508..c4d0a85 100644 --- a/include/fbos/init.h +++ b/include/fbos/init.h @@ -5,7 +5,11 @@ extern struct task_struct init_task; +// Extract the executables from the initrd that is located at `base_addr` and +// has the given `size`. +void extract_initrd(const char *const base_addr, uint64_t size); + // The entry point for the kernel. -__noreturn __kernel void start_kernel(void *dtb); +void start_kernel(void *dtb); #endif /* __FBOS_INIT_H */ diff --git a/include/fbos/sched.h b/include/fbos/sched.h index 626f72f..5cfc2ba 100644 --- a/include/fbos/sched.h +++ b/include/fbos/sched.h @@ -1,6 +1,14 @@ #ifndef __FBOS_SCHED_H_ #define __FBOS_SCHED_H_ +enum task_id { + TASK_UNKNOWN = -1, + TASK_INIT = 0, + TASK_FOO = 1, + TASK_BAR = 2, + TASK_FOOBAR = 3, +}; + struct task_struct { void *stack; }; diff --git a/include/fbos/string.h b/include/fbos/string.h index af7e2ef..ade77cc 100644 --- a/include/fbos/string.h +++ b/include/fbos/string.h @@ -5,5 +5,7 @@ extern size_t strlen(const char *); extern int strcmp(const char *, const char *); +extern int memcmp(const void *, const void *, size_t); +extern void *memcpy(void *, const void *, size_t); #endif // __FBOS_STRING_H_ |
