Re: [PATCH] Adding Bi-Endian 32-bit and 64-bit Support to the Grub ELF P
From:
Tomohiro B Berry
Subject:
Re: [PATCH] Adding Bi-Endian 32-bit and 64-bit Support to the Grub ELF Parser
Date:
Wed, 15 Jan 2014 13:49:19 -0600
PowerPC is the only architecture that I
know of currently asking for this biendianness, so is it sufficient to
include config.h in elf.c and an #ifdef __powerpc__ to the grub_elfXX_byteswap_header
function (as shown below)? That way, it will only perform the byteswap
on the powerpc architecture, and continue to fail to load an opposite endian
kernel on other architectures when it checks the e_version. Or is
there a better way to do it?
Tomo
diff --git a/grub-core/kern/elf.c b/grub-core/kern/elf.c
index 5f99c43..2328b8e 100644
--- a/grub-core/kern/elf.c
+++ b/grub-core/kern/elf.c
@@ -17,6 +17,7 @@
* along with GRUB. If
not, see <http://www.gnu.org/licenses/>.
*/
/* The ELF file header. This
appears at the start of every ELF file. */
From:
Andrey Borzenkov <address@hidden>
To:
The development of
GNU GRUB <address@hidden>,
Cc:
Tomohiro B Berry/Austin/address@hidden
Date:
01/13/2014 11:36 PM
Subject:
Re: [PATCH]
Adding Bi-Endian 32-bit and 64-bit Support to the Grub ELF Parser
On Tue, Jan 14, 2014 at 1:29 AM, Tomohiro B Berry
<address@hidden> wrote:
> Hi Colin,
>
> After some testing, it seems that Grub is able to boot the kernel
just fine
> with an initrd with only these changes. The initrd is loaded
into memory
> while still in BE mode and it looks like the jump is handled in the
> firmware, so the address and size still have to be in big endian mode
(and
> in fact byte swapping them on the grub side breaks the boot process).
So it
> looks like the initrd will not be a problem in this case.
>
it would still be good to explicitly restrict it to platforms known to
support it.