On Apr 14, 2005, at 9:08 AM, Vincent Pelletier wrote:

Here is a clean diff with that new grub_strword version.

Thanks Vincent! I've just checked this in (with a slight tweak: needed to add ## to the macro to allow passing no arguments).


Now what do we think of this patch? It adds output like this:

grub> set debug=loader
grub> linux (hda,0)/zImage.chrp
../loader/powerpc/ieee1275/linux.c,207 : Loading segment 0 at 0x400060, size 0xe1000
grub> boot
../loader/powerpc/ieee1275/linux.c,59 : entry point: 0x400060
../loader/powerpc/ieee1275/linux.c,60 : initrd at: 0xc0000000, size 0x0
../loader/powerpc/ieee1275/linux.c,62 : /chosen/bootargs:
../loader/powerpc/ieee1275/linux.c,63 : jumping to Linux...


Are we happy with that formatting?

-Hollis
Index: loader/powerpc/ieee1275/linux.c
===================================================================
RCS file: /cvsroot/grub/grub2/loader/powerpc/ieee1275/linux.c,v
retrieving revision 1.6
diff -u -p -w -r1.6 linux.c
--- loader/powerpc/ieee1275/linux.c     14 Feb 2005 18:41:33 -0000      1.6
+++ loader/powerpc/ieee1275/linux.c     9 May 2005 02:03:46 -0000
@@ -56,6 +56,12 @@ grub_linux_boot (void)
   grub_ieee1275_set_property (chosen, "bootargs", linux_args,
                              grub_strlen (linux_args) + 1, &actual);
   
+  grub_dprintf ("loader", "entry point: 0x%x\n", linux_addr);
+  grub_dprintf ("loader", "initrd at: 0x%x, size 0x%x\n", initrd_addr,
+               initrd_size);
+  grub_dprintf ("loader", "/chosen/bootargs: %s\n", linux_args);
+  grub_dprintf ("loader", "jumping to Linux...\n");
+
   /* Boot the kernel.  */
   linuxmain = (kernel_entry_t) linux_addr;
   linuxmain ((void *) initrd_addr, initrd_size, grub_ieee1275_entry_fn, 0, 0);
@@ -188,13 +194,18 @@ grub_rescue_cmd_linux (int argc, char *a
 
       if (phdr->p_type == PT_LOAD)
        {
+         void *segment_addr = ((char *) entry) + offset;
+
          if (grub_file_seek (file, phdr->p_offset) == -1)
            {
              grub_error (GRUB_ERR_BAD_OS, "Invalid offset in program header");
              goto fail;
            }
          
-         if (grub_file_read (file, (void *) (((char *) entry) + offset) , 
phdr->p_filesz) 
+         grub_dprintf ("loader", "Loading segment %d at %p, size 0x%x\n", i,
+                       segment_addr, phdr->p_filesz);
+
+         if (grub_file_read (file, segment_addr , phdr->p_filesz) 
              != (grub_ssize_t) phdr->p_filesz)
            goto fail;
          
@@ -275,6 +286,8 @@ grub_rescue_cmd_initrd (int argc, char *
       goto fail;
     }
   
+  grub_dprintf ("loader", "Loading initrd at 0x%x, size 0x%x\n", addr, size);
+
   if (grub_file_read (file, (void *) addr, size) != size)
     {
       grub_ieee1275_release (addr, size);
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to