Can Grub 0.97 load an x86_64 OS image?

View: New views
4 Messages — Rating Filter:   Alert me  

Can Grub 0.97 load an x86_64 OS image?

by Dr. Dov Bulka :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


_______________________________________________
Bug-grub mailing list
Bug-grub@...
http://lists.gnu.org/mailman/listinfo/bug-grub

Re: Can Grub 0.97 load an x86_64 OS image?

by Vladimir 'phcoder' Serbinenko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dr. Dov Bulka wrote:
> 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
>
Grub Legacy is abandonded project. We switched to grub2 now and code in
grub2 is more readable than in legacy

> "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?
>
GRUB Legacy unlike GRUB2 supports only 32-bit *BSD
On i386 linux isn't loaded as ELF but as own image format (compressed
ELF with some startup code and own headers).

> 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
>
> <http://www.DoveRealEstate.biz>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Bug-grub mailing list
> Bug-grub@...
> http://lists.gnu.org/mailman/listinfo/bug-grub
>  


--
Regards
Vladimir 'phcoder' Serbinenko
Personal git repository: http://repo.or.cz/w/grub2/phcoder.git 



_______________________________________________
Bug-grub mailing list
Bug-grub@...
http://lists.gnu.org/mailman/listinfo/bug-grub

Re: Can Grub 0.97 load an x86_64 OS image?

by Felix Zielcke-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Am Donnerstag, den 08.10.2009, 10:51 -0700 schrieb Dr. Dov Bulka:
> 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?

You totally missed that GRUB 2 is out.
GRUB 2's multiboot command supports ELF64 AFAICS

--
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer



_______________________________________________
Bug-grub mailing list
Bug-grub@...
http://lists.gnu.org/mailman/listinfo/bug-grub

Parent Message unknown Re: Can Grub 0.97 load an x86_64 OS image?

by Felix Zielcke-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Am Donnerstag, den 08.10.2009, 12:38 -0700 schrieb Dr. Dov Bulka:
> is GRUB2 officially out or is it still in development? I prefer not to
> use it until it is ready for public consumption.

It's officially out.
Note that GRUB Legacy hadn't either any stable release.
It's still distributed only via alpha.gnu.org and not ftp.gnu.org.

> If it is already out, what ftp site can I get it from?

>From the same place where you can get GRUB Legacy:
ftp://alpha.gnu.org/gnu/grub/
But don't use that old 1.96 release, use 1.97~beta4.

Is there a reason why you added Vladimir to CC and not bug-grub?

--
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer



_______________________________________________
Bug-grub mailing list
Bug-grub@...
http://lists.gnu.org/mailman/listinfo/bug-grub