]> Joshua Wise's Git repositories - netwatch.git/blobdiff - grubload/multiboot_c.c
Add a little bit more functionality to grubload
[netwatch.git] / grubload / multiboot_c.c
index 7c6a4fd11063d350ef055143ab222e1d2e85ca6a..c87b6755634dfab2c8b7b10c669f83ff33f6397d 100644 (file)
@@ -1,6 +1,46 @@
-void c_start(unsigned int magic, void *wee)
+#include "console.h"
+
+struct mb_info
 {
-       *(unsigned char *)0xB8000 = 'A';
+       unsigned long flags;
+       unsigned long mem_lower, mem_upper;
+       unsigned long boot_dev;
+       char *cmdline;
+       unsigned long mod_cnt;
+       struct mod_info *mods;
+};
+
+struct mod_info
+{
+       void *mod_start;
+       void *mod_end;
+       char *mod_string;
+       void *reserved;
+};
+
+void c_start(unsigned int magic, struct mb_info *wee)
+{
+       unsigned short *grubptr = 0x7CFE;
+       int i;
+       
+       puts("Magic is: ");
+       puthex(magic);
+       puts("\nMultiboot header is: ");
+       puthex(wee);
+       puts("\n");
+       show_cursor();
+       
+       puts("Grubptr is: ");
+       puthex(*grubptr);
+       puts("\n");
+       
+       for (i = 0; i < wee->mod_cnt; i++)
+       {
+               puts("Module:\n");
+               puts("  Start: "); puthex(wee->mods[i].mod_start); puts("\n");
+               puts("  Size: "); puthex(wee->mods[i].mod_end - wee->mods[i].mod_start); puts("\n");
+               puts("  Name: "); puts(wee->mods[i].mod_string); puts("\n");
+       }
        while (1)
                ;
 }
This page took 0.019603 seconds and 4 git commands to generate.