[coyotos-dev] Looking for ideas - image loading

Jonathan S. Shapiro shap at eros-os.com
Tue Jan 29 11:14:24 EST 2008


On Tue, 2008-01-29 at 11:03 -0500, Godfrey Vassallo wrote:
> How about "CAT"ing the individual files and then setting the entry
> address in the multiboot header to the module that understands how the
> file was put together and what to do with it? In this way the loader
> has no knowledge of the construction process and believes its dealing
> with one file. Additional formatting information (e.g., elf ) could be
> used by the embedded module.

This would work if the loaded file was in some "raw" format.
Unfortunately, the multiboot and lilo loaders all assume that they are
loading a binary image. They don't simply copy the file blindly. They
instead crack open the file and interpret the proper load addresses
using the ELF program (a.k.a. segment) headers.

So in order for this to work with multiboot loaders, we need to get the
mkimage shoved into a loadable segment.

I've just added a new utility "coymerge" to the tree. This successfully
merges the mkimage file and the kernel binary image into a single
executable.

The kernel isn't yet able to actually use the merged file, because I
haven't added the necessary support to the bootstrap logic yet, but it
does look like the resulting binary image smells right.

Wasn't as hard as I expected, actually. Arcane yes. Difficult, no. :-)

shap



More information about the coyotos-dev mailing list