]> git.proxmox.com Git - grub2.git/commitdiff
* grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_make_mbi):
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 10 Jan 2011 23:44:56 +0000 (00:44 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 10 Jan 2011 23:44:56 +0000 (00:44 +0100)
Take into account space used by ELF sections and multiboot palette.
Reported by: GrĂ©goire Sutre.

ChangeLog
grub-core/loader/i386/multiboot_mbi.c

index 894f886b44253cdb28c575d66be6298e7826d816..73571a549939887ee2f5c538896449221a7e522a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-01-11  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_make_mbi):
+       Take into account space used by ELF sections and multiboot palette.
+       Reported by: GrĂ©goire Sutre.
+
 2011-01-11  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * BUGS: New file.
index eade78e93125d1416fa210c4cf8447899b71525f..b98bda223b3185d45fbf622dc17d4d661de71f78 100644 (file)
@@ -539,6 +539,9 @@ grub_multiboot_make_mbi (grub_uint32_t *target)
       mbi->u.elf_sec.shndx = elf_sec_shstrndx;
 
       mbi->flags |= MULTIBOOT_INFO_ELF_SHDR;
+
+      ptrorig += elf_sec_entsize * elf_sec_num;
+      ptrdest += elf_sec_entsize * elf_sec_num;
     }
 
   err = retrieve_video_parameters (mbi, ptrorig, ptrdest);
@@ -547,6 +550,16 @@ grub_multiboot_make_mbi (grub_uint32_t *target)
       grub_print_error ();
       grub_errno = GRUB_ERR_NONE;
     }
+
+  if ((mbi->flags & MULTIBOOT_INFO_FRAMEBUFFER_INFO)
+      && mbi->framebuffer_type == MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED)
+    {
+      ptrorig += mbi->framebuffer_palette_num_colors
+       * sizeof (struct multiboot_color);
+      ptrdest += mbi->framebuffer_palette_num_colors
+       * sizeof (struct multiboot_color);
+    }
+
 #if GRUB_MACHINE_HAS_VBE
   ptrorig += sizeof (struct grub_vbe_info_block);
   ptrdest += sizeof (struct grub_vbe_info_block);