From 6355c3e08c9f4d3db122252abce5837c364d5b81 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 7 Jul 2021 14:14:37 +0200 Subject: ELF execution of mb1 implementation --- src/loader/impl/mb1.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/loader/impl/mb1.c') 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 #include #include @@ -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); +} -- cgit v1.2.3