[Barrelfish-users] How to Patch grub-0.97 to load 64 bit Barrelfish image!!

Kornilios Kourtis kornilios.kourtis at inf.ethz.ch
Wed Nov 27 12:57:14 CET 2013


Hi Jiban,

On Wed, Nov 27, 2013 at 02:11:07AM -0800, jiban sarma wrote:
> Hi  All,
> 
> I have been working on configuring barrelfish for PXE/TFTP booting.  I am
> facing the following issues during the configuration of the set up. 
> I mainly faced issues building GRUB-0.97 code from source to support network
> booting and to load 64-bit ELF image. I am using Ubuntu 10.04 system where i
> tried to compile the  GRUB-0.97 code with gcc-4.4.3 compiler. But GRUB code can
> be compiled with the gcc-3.x or some lower version of gcc-4.x . So, I tried
> installing gcc-3.3 but it was extremely difficult to install and build gcc from
> source on ubuntu-10.04, as most of the packages, dependencies required to build
> gcc 3.3 are not available. So to build grub-0.97 with gcc-4 compiler i got a
> patch (http://wiki.tudos.org/Building_patched_grub) so i patched the grub code
> and it got compile successfully with gcc-4.4.3 compiler. I put the pxegrub in
> my pxe server and it worked fine as expected. I can see the barrelfish grub
> menu and also can type commands from grub prompt. Boot process has started well
> but finally halted with this error message  " unrelocated kernel address". I
> think it happens because GRUB can't load 64 bit Image. Please correct me if I
> am wrong.
> 
> So I decided to patch the GRUB-code again to load 64 bit image (https://
> savannah.gnu.org/bugs/?17963). The patched run successfully. But when i copied
> the "pxegrub" in my server it exactly stopped with the same error message " 
> unrelocated kernel address". So I come to a conclusion that since i already
> patched the GRUB to build with gcc-4 compiler because of that the second patch
> to load 64 bit image might not work.
> 
> How can I build grub-0.97 from source on ubuntu 10.04 and patch it to support
> both for network and to load 64 bit ELF image? Is there any "pxegrub" binary
> available that I can use quickly to complete my setup?  I am using broadcom
> ethernet card which supports gt3 driver.

I'm afraid I have not tried the above, so I'm unable to give specific
instructions on how to do it.

Another approach, however, would be to use the elver pre-loader which can be
found in the tools directory. If you use elver you do not need to patch grub to
support 64-bit kernels.

The corresponding menu.lst file, in that case, should look like this:
| title   Barrelfish
| root    (nd)
| kernel  /x86_64/sbin/elver loglevel=4
| module  /x86_64/sbin/cpu loglevel=4
| module  /x86_64/sbin/init

Have a look at usr/examples/xmpl-hello/menu.lst, for a more complete example.

cheers,
Kornilios.

-- 
Kornilios Kourtis



More information about the Barrelfish-users mailing list