From: Piotr Krysiuk Date: Sun, 20 Apr 2014 13:58:45 +0000 (+0200) Subject: Allow loading old kernels by placing GDT in conventional memory. X-Git-Tag: 2.02-beta3~644 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a6db38d62235094a903882b71ef2749b4c19cbb;p=thirdparty%2Fgrub.git Allow loading old kernels by placing GDT in conventional memory. --- diff --git a/ChangeLog b/ChangeLog index 30d0cace4..1be8e5e64 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-04-20 Piotr Krysiuk + + * grub-core/lib/i386/relocator.c: Allow loading old kernels by placing + GDT in conventional memory. + 2014-04-10 Colin Watson * util/grub.d/30_os-prober.in: Tolerate devices with no filesystem diff --git a/grub-core/lib/i386/relocator.c b/grub-core/lib/i386/relocator.c index d2a1b27ae..ffaf25f08 100644 --- a/grub-core/lib/i386/relocator.c +++ b/grub-core/lib/i386/relocator.c @@ -81,10 +81,13 @@ grub_relocator32_boot (struct grub_relocator *rel, void *relst; grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_align (rel, &ch, 0, - (0xffffffff - RELOCATOR_SIZEOF (32)) - + 1, RELOCATOR_SIZEOF (32), 16, - GRUB_RELOCATOR_PREFERENCE_NONE, + /* Specific memory range due to Global Descriptor Table for use by payload + that we will store in returned chunk. The address range and preference + are based on "THE LINUX/x86 BOOT PROTOCOL" specification. */ + err = grub_relocator_alloc_chunk_align (rel, &ch, 0x1000, + 0x9a000 - RELOCATOR_SIZEOF (32), + RELOCATOR_SIZEOF (32), 16, + GRUB_RELOCATOR_PREFERENCE_LOW, avoid_efi_bootservices); if (err) return err;