23 #include "autogen_initrd.h" 26 extern int ByteSet(
void *buf,
int c,
size_t len);
29 int (*prom)(
struct anon *);
30 uint32_t initrd_start;
40 void writeChar(
char c)
45 void writeStr(
const char *str)
52 void writeHex(
unsigned int n)
58 for (i = 28; i > 0; i -= 4)
61 if (tmp == 0 && noZeroes)
69 writeChar(tmp - 0xA +
'a');
81 writeChar(tmp - 0xA +
'a');
88 extern void *prom_screen;
89 extern "C" void _start(
unsigned long r3,
unsigned long r4,
unsigned long r5)
91 prom_init((prom_entry) r5);
94 elf.load((uint8_t *) file, 0);
101 ByteSet(&bs, 0,
sizeof(bs));
102 bs.shndx = elf.m_pHeader->shstrndx;
103 bs.num = elf.m_pHeader->shnum;
104 bs.size = elf.m_pHeader->shentsize;
105 bs.addr = (
unsigned int) elf.m_pSectionHeaders;
106 bs.initrd_start = (uint32_t) initrd;
107 bs.initrd_end = (uint32_t) initrd + initrd_size;
108 bs.prom = (int (*)(
struct anon *)) r5;
111 for (
int i = 0; i < elf.m_pHeader->shnum; i++)
113 elf.m_pSectionHeaders[i].addr =
114 elf.m_pSectionHeaders[i].offset + (uint32_t) elf.m_pBuffer;
119 writeStr(
"About to jump to kernel - entry point 0x");
120 writeHex(elf.getEntryPoint());
126 writeStr(
"Kernel exited!\n");
Bootstrap structure passed to the kernel entry point.