Files
openbios/arch/x86/boot.c
Mark Cave-Ayland f84dd73af4 Fix the sys_info.h header file so it doesn't reference functions both inside and outside of libopenbios, and move the firmware
configuration header file to include/arch/common. Following through the code showed that elfnote.c and linuxbios.c were being 
used by sys_info and so these are also renamed to elf_info.c and linuxbios_info.c for clarity.

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


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@693 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 16:09:44 +00:00

49 lines
1021 B
C

/* tag: openbios boot command for x86
*
* Copyright (C) 2003-2004 Stefan Reinauer
*
* See the file "COPYING" for further information about
* the copyright and warranty status of this work.
*/
#undef BOOTSTRAP
#include "openbios/config.h"
#include "libopenbios/bindings.h"
#include "libopenbios/elfload.h"
#include "openbios/nvram.h"
#include "libc/diskio.h"
#include "libopenbios/sys_info.h"
#include "boot.h"
struct sys_info sys_info;
void boot(void)
{
char *path=pop_fstr_copy(), *param;
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)
goto loaded;
if (linux_load(&sys_info, path, param) != LOADER_NOT_SUPPORT)
goto loaded;
if (forth_load(&sys_info, path, param) != LOADER_NOT_SUPPORT)
goto loaded;
printk("Unsupported image format\n");
loaded:
free(path);
}