Subject: Re: kernel symbols
To: Frank Wille <frank@phoenix.owl.de>
From: Jason Thorpe <thorpej@shagadelic.org>
List: port-powerpc
Date: 01/13/2007 16:03:58
On Jan 13, 2007, at 3:16 PM, Frank Wille wrote:

> Then the bootloader, which I have to write, loads the ELF image  
> twice? First
> at the target address, to be able to start the kernel, and a second  
> time just
> to pass it to ksyms_init()?

You don't have to write all of this code yourself, and no it does not  
load the entire ELF image twice.  There is a routine in libsa called  
loadfile() that handles this all for you.

Basically, The ELF header and image are loaded as normal, including  
the symbols that are to be passed to the kernel, and the ELF header is  
patched up to point to the in-memory location of the symbols.  Then  
the ELF header is given to the kernel and everything works fine.

-- thorpej