Introduce a set of CONFIG_LOADER_* configuration options to allow each architecture to specify the loaders that are to be used.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@717 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Mark Cave-Ayland
2010-03-28 20:18:30 +00:00
committed by Mark Cave-Ayland
parent 63db85036b
commit f78fec5713
16 changed files with 169 additions and 23 deletions

View File

@@ -13,6 +13,8 @@
#include "libc/diskio.h"
#include "libopenbios/sys_info.h"
#include "libopenbios/elf_load.h"
#include "libopenbios/aout_load.h"
#include "libopenbios/fcode_load.h"
#include "libopenbios/forth_load.h"
#include "boot.h"
@@ -24,22 +26,44 @@ static int try_path(const char *path, char *param)
ucell valid, address, type, size;
int image_retval = 0;;
#ifdef CONFIG_LOADER_ELF
/* ELF Boot loader */
elf_load(&sys_info, path, param, &boot_notes);
feval("state-valid @");
valid = POP();
if (valid)
goto start_image;
#endif
/* Linux loader (not using Forth) */
linux_load(&sys_info, path, param);
#ifdef CONFIG_LOADER_AOUT
/* a.out loader */
aout_load(&sys_info, path);
feval("state-valid @");
valid = POP();
if (valid)
goto start_image;
#endif
#ifdef CONFIG_LOADER_FCODE
/* Fcode loader */
fcode_load(path);
feval("state-valid @");
valid = POP();
if (valid)
goto start_image;
#endif
#ifdef CONFIG_LOADER_FORTH
/* Forth loader */
forth_load(path);
feval("state-valid @");
valid = POP();
if (valid)
goto start_image;
#endif
return 0;
@@ -61,6 +85,20 @@ start_image:
image_retval = start_elf(address, (uint32_t)NULL);
break;
case 0x5:
/* Start a.out image */
image_retval = start_elf(address, (uint32_t)NULL);
break;
case 0x10:
/* Start Fcode image */
printk("Evaluating FCode...\n");
PUSH(address);
PUSH(1);
fword("byte-load");
image_retval = 0;
break;
case 0x11:
/* Start Forth image */
PUSH(address);