I downloaded the sources and built a grub executable. The code has many references to ELF32 structures and, not surprisingly, I'm unable to load an OS image whose format is x86_64.
The machine is running Linux 2.6.18-8.el5. Grub version is 0.97 "uname -a" tells me that this is an x86_64 architecture.
Looking at the source code for "load_image" in stage2/boot.c I find code like:
/* ELF loading supported if multiboot, FreeBSD and NetBSD. */ if ((type == KERNEL_TYPE_MULTIBOOT || pu.elf->e_ident[EI_OSABI] == ELFOSABI_FREEBSD || grub_strcmp (pu.elf->e_ident + EI_BRAND, "FreeBSD") == 0 || suggested_type == KERNEL_TYPE_NETBSD) && len > sizeof
(Elf32_Ehdr) && BOOTABLE_I386_ELF ((*((Elf32_Ehdr *) buffer)))) {
Which tells me that this code is meant for i386 (32-bit).
What have I done wrong?
Did I download an old version of Grub not capable of handling x86_64 (64-bit)? Or... Did I "configure" it wrong? What am I missing?
Thanks, Dov
|