Eric W. Biederman wrote:
>
>>BTW, does mkelfImage works for any (statically linked) ELF file,
>>not only Linux kernel ??
>>
>
> The name is bad. Essentially the linux kernel is buggy, so I needed
> mkelfImage. For a normal ELF file mkelfImage shouldn't be needed.
>
>
>>Is it correct that in order to be loaded
>>by ELF boot, one has to
>>
>> 1. Use the ube_start.S instead of the usual crt0.S used by gcc.
>> 2. Use gcc's crt0.S and convert with mkelfImage.
>>
>
> Nope: It is even simpler all you need to do is have a valid ELF file.
> Know how to find the linuxBIOS table.
> Know how to read the parameters you need out of the linuxbios table.
>
> gcc's default crt0.S cannot be used because it makes operating system
> calls. And otherwise assumes you are running under an operating system.
>
What is the defination of "valid ELF file" ?? My elfImage should be
"valid" ELF file but can not be loaded because of the "range conflict".
If gcc's default crt0.S does not work, which one can ?? Is it
ubs_start.S ?? Say, I have a hello.c like this
#include <printk.h>
main()
{
printk_debug("hello world\n");
}
How can I build a ELF image that can be loaded by ELF boot ??
Should I do as:
gcc -c ube_start.S
gcc -c hello.c
gcc -nostdlib -nostartfiles -static -T ldscript.ld -o hello\
ube_start.o hello.o
BTW, Can you provide a sample crt0.S and code to read LinuxBIOS table.
Something like libgcc ??
Ollie