diff options
author | Marvin Borner | 2021-07-07 14:14:37 +0200 |
---|---|---|
committer | Marvin Borner | 2021-07-07 14:14:37 +0200 |
commit | 6355c3e08c9f4d3db122252abce5837c364d5b81 (patch) | |
tree | 8fffa4b79f6b5a2936766becb43282afbf0d675b /src/loader/impl/mb1.c | |
parent | 736d2b820d968915516d1662b84f9995d53895a3 (diff) |
ELF execution of mb1 implementation
Diffstat (limited to 'src/loader/impl/mb1.c')
-rw-r--r-- | src/loader/impl/mb1.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/loader/impl/mb1.c b/src/loader/impl/mb1.c index cb75976..765433e 100644 --- a/src/loader/impl/mb1.c +++ b/src/loader/impl/mb1.c @@ -1,6 +1,7 @@ // MIT License, Copyright (c) 2021 Marvin Borner // Everything according to spec +#include <elf.h> #include <impl/mb1.h> #include <pnc.h> @@ -58,3 +59,14 @@ u8 mb1_detect(struct dev *dev, const char *path) return 1; } + +// Execute mb1 type kernel +void mb1_exec(struct dev *dev, const char *path) +{ + u32 entry = elf_load(dev, path); + void (*kernel)(void *); + *(void **)(&kernel) = (void *)entry; + + // TODO: Push mb1 stuff + kernel(dev); +} |