diff options
author | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
---|---|---|
committer | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/openbios/arch/amd64/boot.c | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/openbios/arch/amd64/boot.c')
-rw-r--r-- | roms/openbios/arch/amd64/boot.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/roms/openbios/arch/amd64/boot.c b/roms/openbios/arch/amd64/boot.c new file mode 100644 index 000000000..0e1fe7efd --- /dev/null +++ b/roms/openbios/arch/amd64/boot.c @@ -0,0 +1,41 @@ +/* + * + */ +#undef BOOTSTRAP +#include "config.h" +#include "libopenbios/bindings.h" +#include "libopenbios/elfload.h" +#include "arch/common/nvram.h" +#include "libc/diskio.h" +#include "libopenbios/sys_info.h" + +int elf_load(struct sys_info *, const char *filename, const char *cmdline); +int linux_load(struct sys_info *, const char *filename, const char *cmdline); + +void boot(void); + +void boot(void) +{ + char *path=pop_fstr_copy(), *param; + + // char *param="root=/dev/hda2 console=ttyS0,115200n8 console=tty0"; + + if(!path) { + printk("[x86] Booting default not supported.\n"); + return; + } + + param = strchr(path, ' '); + if(param) { + *param = '\0'; + param++; + } + + printk("[x86] Booting file '%s' with parameters '%s'\n",path, param); + + if (elf_load(&sys_info, path, param) == LOADER_NOT_SUPPORT) + if (linux_load(&sys_info, path, param) == LOADER_NOT_SUPPORT) + printk("Unsupported image format\n"); + + free(path); +} |