3 extern char _binary_realmode_bin_start[];
4 extern int _binary_realmode_bin_size;
9 unsigned long mem_lower, mem_upper;
10 unsigned long boot_dev;
12 unsigned long mod_cnt;
13 struct mod_info *mods;
24 void c_start(unsigned int magic, struct mb_info *wee)
26 unsigned short *grubptr = 0x7CFE;
29 void (*realmode)() = 0x4000;
33 puts("\nMultiboot header is: ");
43 for (i = 0; i < wee->mod_cnt; i++)
46 puts(" Start: "); puthex(wee->mods[i].mod_start); puts("\n");
47 puts(" Size: "); puthex(wee->mods[i].mod_end - wee->mods[i].mod_start); puts("\n");
48 puts(" Name: "); puts(wee->mods[i].mod_string); puts("\n");
51 if ((wee->mod_cnt != 1) || (strcmp(wee->mods[0].mod_string, "aseg.elf")))
53 puts("Expected 1 module called aseg.elf.\n");
57 load_elf(wee->mods[0].mod_start, wee->mods[0].mod_end - wee->mods[0].mod_start);
59 puts("Now returning to real mode.\n");
60 memcpy(0x4000, _binary_realmode_bin_start, (int)&_binary_realmode_bin_size);
61 realmode(); // goodbye!