grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] fix load of RHEL ans SUSE images by correctly calculate ELF


From: Manoel Rebelo Abraches
Subject: Re: [PATCH] fix load of RHEL ans SUSE images by correctly calculate ELF entry point
Date: Tue, 19 Oct 2010 11:46:12 -0200

This is another version to the same fix.

The first patch 01_mem.patch creates a new function to allocate memory
using the "available" property in the "memory" node.
The second patch 02_offset.patch correctly finds the linux entry point,
also assumes that more segments can exist (made accordingly with sparc
implementation)

The patch was made passing  -Bbp to diff as suggested by Vladimir.
I tested with RHEL/SUSE images and some RHEL/SUSE kernel I had and
worked correctly. Before the images failed to boot.
Thank you for reviewing this.

On Mon, 2010-09-27 at 04:29 -0300, Manoel Rebelo Abraches wrote:
> This Patch loads kernel LOAD segment at the address fixed by PhysAddr
> with alignment Align at the ELF program header. Even if this address is
> in use other address with the same alignment is found "linuxadr" (since
> linux can relocate itself). The linux main function is then find in the
> adress linuxaddr + entry + (PhysAddr- Entry), where Entry is  the Entry
> point address in the ELF header. (PhysAddr- Entry) gives the offset
> where the linux entry point is located after linuxaddr.
> 
> 
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/grub-devel

-- 
Best Regards,

Manoel R. Abranches 
IBM Linux Technology Center Brazil

Attachment: 02_offset.patch
Description: Text Data

Attachment: 01_mem.patch
Description: Text Data

--- ChangeLog   2010-10-19 11:38:51.000000000 -0200
+++ ChangeLog   2010-10-19 11:16:12.000000000 -0200
@@ -1,3 +1,19 @@
+2010-10-18  Manoel Rebelo Abranches <address@hidden>
+       
+       Find the correct linux offset in PowerPC loader.
+
+       * include/grub/elfload.h (grub_elf32_size): New parameter. All users 
updated.
+       Return maximum segments alignment.
+       (grub_elf64_size): Likewise.
+       * kern/elf.c (grub_elf32_size): New parameter. All users updated.
+       Return maximum segments alignment.
+       (grub_elf64_size): Likewise.
+       * grub-core/loader/powerpc/ieee1275/linux.c:
+       (grub_linux_claimmap_iterate): New function. Uses the 
"available"property 
+       in the "memory" node for memory allocation for kernel in the PowerPC 
loader.
+       (grub_linux_load32): Correctly find linux entry point offset.
+       (grub_linux_load64): Likewise.
+
 2010-10-18  Grégoire Sutre  <address@hidden>
 
        Make mktemp invocations portable.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]