Eric, In the source of mkelfImage, linux-i386/convert_params.c, there is some code to retrieve information like memory map from Multiboot information structure. However, ELF images created by mkelfImage does not have Multiboot header, according to 'mbchk' of GRUB boot loader. In what situation is this code supposed to run (and tested)? If one added a (trivial) Multiboot header in the head.S, the resulting kernel could be loaded from GRUB, while it could also be loaded by ELF boot of LinuxBIOS and Etherboot?
SONE Takeshi ts1@cma.co.jp writes:
Eric, In the source of mkelfImage, linux-i386/convert_params.c, there is some code to retrieve information like memory map from Multiboot information structure. However, ELF images created by mkelfImage does not have Multiboot header, according to 'mbchk' of GRUB boot loader. In what situation is this code supposed to run (and tested)?
The partial multiboot support in etherboot, is where it was used.
If one added a (trivial) Multiboot header in the head.S, the resulting kernel could be loaded from GRUB, while it could also be loaded by ELF boot of LinuxBIOS and Etherboot?
It probably could. And I would not have a problem with something like that in theory. The multiboot spec is quite poorly done, so I am not a major fan. I think I would prefer to just add a dummy elf segment at the start of the file with that information in it. From mkelfImage 2.5 that would probably be the easiest thing to do.
I would almost rather fix GRUB to use something sensible and portable like ELF notes. The multiboot data structure is a disaster in terms of both future expansion, and of expansion by multiple groups.
What I will not support is GRUB hack at dynamic linking, via the multiboot spec. With respect to a.out the multiboot stuff was not bad. With respect to ELF there are much better ways to do just about everything it attempts.
My apologies for ranting. GRUB is not a bootloader I admire.
Eric
On Wed, Jun 11, 2003 at 11:20:23PM -0600, Eric W. Biederman wrote:
In the source of mkelfImage, linux-i386/convert_params.c, there is some code to retrieve information like memory map from Multiboot information structure. However, ELF images created by mkelfImage does not have Multiboot header, according to 'mbchk' of GRUB boot loader. In what situation is this code supposed to run (and tested)?
The partial multiboot support in etherboot, is where it was used.
Thanks for the information.
If one added a (trivial) Multiboot header in the head.S, the resulting kernel could be loaded from GRUB, while it could also be loaded by ELF boot of LinuxBIOS and Etherboot?
It probably could. And I would not have a problem with something like that in theory. The multiboot spec is quite poorly done, so I am not a major fan. I think I would prefer to just add a dummy elf segment at the start of the file with that information in it. From mkelfImage 2.5 that would probably be the easiest thing to do.
I couldn't find an easy way to do it. What PT_* type would that segment have?
I would almost rather fix GRUB to use something sensible and portable like ELF notes. The multiboot data structure is a disaster in terms of both future expansion, and of expansion by multiple groups.
I considered to add ELFboot support to GRUB, but adding Multiboot header to ELF kernel looked much easier.
-- Takeshi
On Fri, Jun 13, 2003 at 06:48:55PM +0900, SONE Takeshi wrote:
If one added a (trivial) Multiboot header in the head.S, the resulting kernel could be loaded from GRUB, while it could also be loaded by ELF boot of LinuxBIOS and Etherboot?
It probably could.
Turns out it can't. GRUB can't load Multiboot (or other ELF) kernel below 1MB! Since bzImage kernel starts at just 1MB, placing 'converter' and gdt elsewhere after 1MB is not a trivial task..
Interesting(?) discussion on this issue: http://mail.gnu.org/archive/html/bug-grub/2001-08/msg00083.html
SONE Takeshi ts1@cma.co.jp writes:
On Fri, Jun 13, 2003 at 06:48:55PM +0900, SONE Takeshi wrote:
If one added a (trivial) Multiboot header in the head.S, the resulting kernel could be loaded from GRUB, while it could also be loaded by ELF boot of LinuxBIOS and Etherboot?
It probably could.
Turns out it can't.
And now you see one of the many reasons GRUB has not yet been ported to run under LinuxBIOS.
GRUB can't load Multiboot (or other ELF) kernel below 1MB! Since bzImage kernel starts at just 1MB, placing 'converter' and gdt elsewhere after 1MB is not a trivial task..
A bzImage had a real mode component that must be run below 1MB.
Currently I place the ramdisk at 8MB, and the converter and the real mode code could be placed on top of that. I do something like this for the Itanium.
Still it is less than satisfactory to require that to happen. 0-640K is always known to be there so we should be able to use it.
Hopefully some time will open up and I can put out another ELF booting specification.
Eric