]>
Commit | Line | Data |
---|---|---|
9b8c947b JW |
1 | #include "console.h" |
2 | ||
c4a16564 JW |
3 | extern char _binary_realmode_bin_start[]; |
4 | extern int _binary_realmode_bin_size; | |
5 | ||
9b8c947b | 6 | struct mb_info |
56553b73 | 7 | { |
9b8c947b JW |
8 | unsigned long flags; |
9 | unsigned long mem_lower, mem_upper; | |
10 | unsigned long boot_dev; | |
11 | char *cmdline; | |
12 | unsigned long mod_cnt; | |
13 | struct mod_info *mods; | |
14 | }; | |
15 | ||
16 | struct mod_info | |
17 | { | |
18 | void *mod_start; | |
19 | void *mod_end; | |
20 | char *mod_string; | |
21 | void *reserved; | |
22 | }; | |
23 | ||
24 | void c_start(unsigned int magic, struct mb_info *wee) | |
25 | { | |
26 | unsigned short *grubptr = 0x7CFE; | |
27 | int i; | |
28 | ||
c4a16564 JW |
29 | void (*realmode)() = 0x4000; |
30 | ||
9b8c947b JW |
31 | puts("Magic is: "); |
32 | puthex(magic); | |
33 | puts("\nMultiboot header is: "); | |
34 | puthex(wee); | |
35 | puts("\n"); | |
36 | show_cursor(); | |
37 | ||
38 | puts("Grubptr is: "); | |
39 | puthex(*grubptr); | |
40 | puts("\n"); | |
41 | ||
42 | for (i = 0; i < wee->mod_cnt; i++) | |
43 | { | |
44 | puts("Module:\n"); | |
45 | puts(" Start: "); puthex(wee->mods[i].mod_start); puts("\n"); | |
46 | puts(" Size: "); puthex(wee->mods[i].mod_end - wee->mods[i].mod_start); puts("\n"); | |
47 | puts(" Name: "); puts(wee->mods[i].mod_string); puts("\n"); | |
48 | } | |
c4a16564 JW |
49 | |
50 | puts("Now returning to real mode.\n"); | |
51 | memcpy(0x4000, _binary_realmode_bin_start, (int)&_binary_realmode_bin_size); | |
52 | realmode(); | |
56553b73 | 53 | } |