[coyotos-dev] Looking for ideas - image loading
Jeroen C. Visser
jeroen.c.visser at gmail.com
Tue Jan 29 11:12:00 EST 2008
On Jan 29, 2008 10:07 AM, Jonathan S. Shapiro <shap at eros-os.com> wrote:
> On PC's we can use multiboot for image loading, and we can therefore
> store the mkimage output in a different file than the kernel.
>
> On mature embedded systems, we can flash the kernel and the mkimage
> output to different locations.
>
> But on immature embedded systems we often don't have any way to load
> more than one file. This is also an issue with some netboot
> implementations.
>
> I am therefore wondering whether there is some simple way to merge the
> kernel and the mkimage file.
>
> So far, the best that I have come up with is to proceed as follows:
>
> 1. Instead of performing a static link on the kernel, link it
> with -r to form a relocatable that can be processed again by
> the linker.
>
> [ We would do the static link here anyway as a guard against
> missing symbols. ]
>
> 2. Add the mkimage file to the kernel binary image as a loadable
> segment in a final link step.
>
> 3. Implement a script "coymerge" that is really a link step in
> disguise.
>
> Does anyone know of a cleaner/better way to do this that is ready to
> hand?
For ARM I faced the same problem. I ended up concatenating the kernel
and the ipl.img. Working out the kernel ELF image size allows me to
look for the "coyimage" header following it. Not very elegant, but it
beats trying to work with bootloaders.
(Then I discovered that U-Boot can load blobs in memory at arbitrary
addresses and now I mostly use that approach for the ipl.img.)
-JCV
More information about the coyotos-dev
mailing list