]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Fix mistakes in example kernel
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 16 Jan 2010 16:24:15 +0000 (17:24 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 16 Jan 2010 16:24:15 +0000 (17:24 +0100)
doc/kernel.c

index 1993dfee4e7dcccdecd5654e4af73a7bc744919c..2480574019cad09c4587430bbaaf6165f76328fc 100644 (file)
@@ -50,7 +50,7 @@ void
 cmain (unsigned long magic, unsigned long addr)
 {  
   struct multiboot_tag *tag;
-  uint32_t size;
+  unsigned size;
 
   /* Clear the screen.  */
   cls ();
@@ -62,7 +62,7 @@ cmain (unsigned long magic, unsigned long addr)
       return;
     }
 
-  size = *(uint32_t *) addr;
+  size = *(unsigned *) addr;
   printf ("Announced mbi size 0x%x\n", size);
   for (tag = (struct multiboot_tag *) (addr + 4);
        tag->type != MULTIBOOT_TAG_TYPE_END;
@@ -204,7 +204,8 @@ cmain (unsigned long magic, unsigned long addr)
          }
        }
     }
-  printf ("Total mbi size 0x%x\n", (uint32_t) tag - addr);
+  tag = (struct multiboot_tag *) ((multiboot_uint8_t *) tag + tag->size);
+  printf ("Total mbi size 0x%x\n", (unsigned) tag - addr);
 }    
 
 /* Clear the screen and initialize VIDEO, XPOS and YPOS.  */