24 #define LOAD_ADDR 0x80200000 25 extern int ByteSet(
void *buf,
int c,
size_t len);
51 uint32_t drives_length;
54 uint32_t config_table;
56 uint32_t boot_loader_name;
60 uint32_t vbe_control_info;
61 uint32_t vbe_mode_info;
63 uint32_t vbe_interface_seg;
64 uint32_t vbe_interface_off;
65 uint32_t vbe_interface_len;
68 void writeChar(
char c)
70 unsigned int *p =
reinterpret_cast<unsigned int *
>(0x91100004);
71 *p =
static_cast<unsigned int>(c);
74 void writeStr(
const char *str)
81 __start(
char argc,
char **argv,
char **env,
unsigned int ramsize);
82 extern "C" int start()
84 asm volatile(
"li $sp, 0x800F0000");
86 asm volatile(
"mfc0 $t0, $12");
87 asm volatile(
"addi $t1, $zero, 0x1");
88 asm volatile(
"and $t0, $t0, $t1");
89 asm volatile(
"mtc0 $t0, $12");
90 asm volatile(
"j __start");
93 extern "C" int __start(
char argc,
char **argv,
char **env,
unsigned int ramsize)
96 elf.load((uint8_t *) file, 0);
103 ByteSet(&bs, 0,
sizeof(bs));
104 bs.shndx = elf.m_pHeader->shstrndx;
105 bs.num = elf.m_pHeader->shnum;
106 bs.size = elf.m_pHeader->shentsize;
107 bs.addr = (
unsigned int) elf.m_pSectionHeaders;
109 bs.mem_upper = ramsize;
112 for (
int i = 0; i < elf.m_pHeader->shnum; i++)
114 elf.m_pSectionHeaders[i].addr =
115 elf.m_pSectionHeaders[i].offset + (uint32_t) elf.m_pBuffer;
Bootstrap structure passed to the kernel entry point.