2 * Creation Date: <2010/04/02 13:00:00 mcayland>
3 * Time-stamp: <2010/04/02 13:00:00 mcayland>
7 * C implementation of (init-program) word
9 * Copyright (C) 2010 Mark Cave-Ayland (mark.cave-ayland@siriusit.co.uk)
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
18 #include "kernel/kernel.h"
19 #include "libopenbios/bindings.h"
20 #include "libopenbios/initprogram.h"
22 /* Because the a.out loader requires platform-specific headers */
23 #ifdef CONFIG_LOADER_AOUT
24 #include "libopenbios/aout_load.h"
27 #include "libopenbios/bootinfo_load.h"
28 #include "libopenbios/elf_load.h"
29 #include "libopenbios/fcode_load.h"
30 #include "libopenbios/forth_load.h"
31 #include "libopenbios/xcoff_load.h"
34 void init_program(void)
36 /* Get the value of load-base and use it to determine the correct loader
43 #ifdef CONFIG_LOADER_AOUT
44 if (is_aout((struct exec *)cell2pointer(addr))) {
50 #ifdef CONFIG_LOADER_BOOTINFO
51 if (is_bootinfo((char *)cell2pointer(addr))) {
52 bootinfo_init_program();
57 #ifdef CONFIG_LOADER_ELF
58 if (is_elf((Elf_ehdr *)cell2pointer(addr))) {
64 #ifdef CONFIG_LOADER_FCODE
65 if (is_fcode((unsigned char *)cell2pointer(addr))) {
71 #ifdef CONFIG_LOADER_FORTH
72 if (is_forth((char *)cell2pointer(addr))) {
78 #ifdef CONFIG_LOADER_XCOFF
79 if (is_xcoff((COFF_filehdr_t *)cell2pointer(addr))) {