Re: [PATCH] Adding Bi-Endian 32-bit and 64-bit Support to the Grub ELF P
Tomohiro B Berry
Re: [PATCH] Adding Bi-Endian 32-bit and 64-bit Support to the Grub ELF Parser
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?
diff --git a/grub-core/kern/elf.c b/grub-core/kern/elf.c
index 5f99c43..2328b8e 100644
@@ -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. */
Andrey Borzenkov <address@hidden>
The development of
GNU GRUB <address@hidden>,
Tomohiro B Berry/Austin/address@hidden
01/13/2014 11:36 PM
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
> Hi Colin,
> After some testing, it seems that Grub is able to boot the kernel
> with an initrd with only these changes. The initrd is loaded
> 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
> in fact byte swapping them on the grub side breaks the boot process).
> 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