From 48f27e87fcbdae34ca056b9c14223a6b5e68f0aa Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 2 Jul 2010 00:40:37 +0200 Subject: [PATCH] * loader/multiboot.c (grub_multiboot_boot) [GRUB_USE_MULTIBOOT2]: Properly align mbi. Reported by: Seth Goldberg. --- ChangeLog | 6 ++++++ loader/multiboot.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index a03294df6..ba99ab2e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-07-02 Vladimir Serbinenko + + * loader/multiboot.c (grub_multiboot_boot) [GRUB_USE_MULTIBOOT2]: + Properly align mbi. + Reported by: Seth Goldberg. + 2010-07-01 Vladimir Serbinenko * util/grub-mkrescue.in: Avoid module duplication. diff --git a/loader/multiboot.c b/loader/multiboot.c index 592289c45..77a732838 100644 --- a/loader/multiboot.c +++ b/loader/multiboot.c @@ -136,8 +136,14 @@ grub_multiboot_boot (void) grub_multiboot_alloc_mbi = mbi_size; } +#ifdef GRUB_USE_MULTIBOOT2 + state.MULTIBOOT_MBI_REGISTER = ALIGN_UP (grub_multiboot_payload_dest + + grub_multiboot_pure_size, + MULTIBOOT_TAG_ALIGN); +#else state.MULTIBOOT_MBI_REGISTER = grub_multiboot_payload_dest + grub_multiboot_pure_size; +#endif err = grub_multiboot_make_mbi (grub_multiboot_payload_orig, grub_multiboot_payload_dest, grub_multiboot_pure_size, mbi_size);