Salut Sébastien,

I believe that the kernel has it's own ld script, which explains how
it can create a flat binary from a *-linux*- toolchain. All of that is
stored in arch/arm/boot/*/*.S and particularly in
arch/arm/boot/compress/vmlinux.lds.in for compressed kernels.

For *-linux-* toolchains (or any non-elf toolchain) it's a bit more
complicated, because the linker automatically uses the syscall
conventions of the OS. However, if an elf toolchain is used, e.g.
arm-elf, arm-softfloat-elf, then the linker script automatically
creates a 'flat' elf binary, and the -e argument is the entry address.
In that case, int main() is not used, but void _start(void).

Of course, with some work, and a custom linker script / elf loader,
then any arm toolchain could create the flat elf binary. For now
though, I'm hoping to just get something to work soon. Actually, it
might be nice to use HaRET to boot a more fully-featured bootloader,
such as u-boot.

I'm going to essentially copy the BOOTLINUX code, and remove all of
the linux-specific parts. For now, I'll stick to the requirement for
an elf / PIC format. Maybe I'll call the new command BOOTELF.

For any other binary, particularly those in non-PIC format, the
ENTRYADDR is absolutely necessary. That command could possibly be
called BOOTBIN.

If you feel like helping out, I would love any extra input!


Cheers,

Chris

On Fri, Apr 3, 2009 at 10:24 AM, Sébastien Lorquet <[email protected]> wrote:
> Just as we can create a GRUB image from an arbitrary  x86 binary, maybe it's
> possible to create an arm kernel image that wraps any arm binary... the
> kernel build process does just that :) Then you can use the bootlinux
> command to start your binary.
>
> Note: If a load&run command is implemented one day in haret, the ability to
> control where a PIC image is loaded should be available too.
_______________________________________________
Haret mailing list
[email protected]
https://handhelds.org/mailman/listinfo/haret

Reply via email to