[srv.init] Load initial programs in srv.init

Add a simple ELF loader to srv.init to load and start any module_program
parameters passed from the bootloader. Also creates stacks for newly
created threads.

Also update thread creation in testapp to create stacks.
This commit is contained in:
Justin C. Miller
2021-12-26 15:42:12 -08:00
parent 300bf9c2c5
commit 25522a8450
6 changed files with 183 additions and 22 deletions

View File

@@ -54,11 +54,18 @@ struct file_header
enum class segment_type : uint32_t { null, load, dynamic, interpreter, note };
enum class segment_flags : uint32_t
{
none = 0x00,
exec = 0x01,
write = 0x02,
read = 0x04,
};
struct program_header
{
segment_type type;
uint32_t flags;
segment_flags flags;
uint64_t offset;
uint64_t vaddr;