grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fwd: Re: [LinuxBIOS] grub2 as payload


From: Hollis Blanchard
Subject: Re: [Fwd: Re: [LinuxBIOS] grub2 as payload
Date: Thu, 16 Nov 2006 16:50:20 -0600

On Thu, 2006-11-16 at 22:57 +0100, Stefan Reinauer wrote:
> * Marco Gerards <address@hidden> [061025 19:41]:
> > 
> > >> - add support for compiling grub2 as an elf image.
> > 
> > This is possible already.  If the ELF image has specific demands, it
> > will not be hard to make such changes.
> 
> How do I do this. Running configure and make on a checked out 
> grub2 tree leaves me with many many modules. Can you hit my head 
> to some documentation on how to do this?
> 
> * Is grub-mkimage the way to go? It produces a multiboot image, no ELF.
>   I understand the final image has to be composed from the modules.

I don't believe this is currently possible on x86. On PowerPC, the build
process creates kernel.elf and *.mod.
util/powerpc/ieee1275/grub-mkimage.c then adds the modules to the kernel
by creating a new PT_LOAD segment at a well-known address (I'd like that
address to be dynamic but don't want to try to rewrite a global in
the .data section, and linking twice sucks).

On x86, grub-mkimage creates an x86-bootable image, which of course is
not an ELF file.

> * which module contains the int13 disk code ? So I dont accidentially
>   use it.

disk/i386/pc/biosdisk.c . However, that's always built in to the core
kernel (kernel.img).

> * what modules are required to display a grub menu over a serial
>   console and boot a kernel (bzimage) and initrd from ext2? (assuming
>   there is no reiserfs driver yet)
>
>   What others do I need? Which ones dont I need?
>   - boot.mod
>   - ext2.mod
>   - elf.mod
>   - gzio.mod?
>   - (_)linux.mod
>   - normal.mod(?)
>   - pc.mod
>   - terminal.mod
>   - terminfo.mod

serial.mod

Helper modules like gzio.mod and fshelp.mod will be pulled in
automatically if needed (see moddep.lst, which is used by grub-mkimage).

You don't *need* normal.mod.

Of course you will need to provide your own disk module to replace
biosdisk.mod.

> *  What's the difference between _chain and chain?
>    multiboot and _multiboot?

This is really lame and I don't like it at all. _foo is where the real
work is done, and it's supposed to be built in to "rescue mode", i.e.
grub.img. foo is just a wrapper so you can access the same functionality
from "normal mode".

"Rescue mode" is the small image that can be loaded without needing any
modules. It includes the modules needed to load *.mod from a filesystem
on a disk, which gets you into "normal mode" with all the fancy menu and
tab-completion.

-Hollis





reply via email to

[Prev in Thread] Current Thread [Next in Thread]