[coreboot] libpayload: Add multiboot support

Jordan Crouse jordan.crouse at amd.com
Thu Sep 25 22:14:54 CEST 2008

On 25/09/08 22:02 +0200, Robert Millan wrote:
> On Thu, Sep 25, 2008 at 12:51:47PM -0600, Jordan Crouse wrote:
> > This is a simple patch to parse and read the multiboot table
> > in libpayload.  It doesn't do much more then read the memory
> > map for now, but the important thing is that we are storing off
> > %eax and %ebx in the init code and using it when we need it.
> Nice!
> > The next step is probably an API where upon a multiboot aware
> > payload could insert new things into the table (say, the drive
> > structure, or the cmdline or other interesting information), and then
> > pass it to a child payload.
> If you want to preserve the table for future use, I recommend that you
> copy it early in the code.  Per spec the loader doesn't make any promises
> on its location (other than not overwriting your code with it, of course).

Right - I thought about this during lunch, and the more I think about it,
the more I think we're going to have to end up rewriting ithe tables for 
reentrant payloads (I totally made that term up) like bayou that will
need to exclude themselves from memory so they don't get blown away.

> > I'm not sure what else we would need to do to libpayload so that
> > grub will load the payloads, but I'm sure Robert will enlighten us.
> You also need a Multiboot header in the resulting image.  It has to be
> 32bit-aligned and in the first 8k.  For what your patch does, the
> following should suffice:
> 0x1BADB002  (magic)
> 0x00000002  (flag for memory info)
> (-0x1BADB002 -0x00000002)  (checksum)
> For details see http://www.gnu.org/software/grub/manual/multiboot/html_node/Header-layout.html#Header-layout

Okay - I'll add that if I get a chance.


Jordan Crouse
Systems Software Development Engineer 
Advanced Micro Devices, Inc.

More information about the coreboot mailing list