Re: what is the functionality of kernelrelocate() of eboot code?



Again, I ask: Why are you asking?

The bootloader is copied to RAM, but the bootloader doesn't know it. The
bits are copied raw from flash to RAM as a block. But that area of RAM is
not known to the bootloader to be RAM, it is code. The variables need to be
in an area known to the bootloader as RAM, which is the area that you set to
be RAM in the eboot.bib file. You could certainly write assembly code to do
this, but really there is no fun in doing that since it it easier to do it
in C.

--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member

"daniel" <daniel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:51D72804-9898-4A1B-B142-DD28C2A3306A@xxxxxxxxxxxxxxxx
I seems to be still misunderstanding...
Isn't the bootloader moved from rom to ram in order to be run after power
on?
Then isn't the bootloader at ram space?
why the relocation should be needed for ram based boot code and global
variables?


"Bruce Eitman [eMVP]" wrote:

..bin/.nb0 doesn't mater, either way it gets put into flash before
booting.
The bootloader isn't being run from an OS that does this automatically
for
it, so it must do it.

Why are you asking?

--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member

"daniel" <daniel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C8418215-E73A-484C-91B6-2431C71F5779@xxxxxxxxxxxxxxxx
Hi Manoj,

Thank you for your instant kind reply.
then, let me check again my understanding to your reply.
The current bootloader code is located at flash rom because its format
is
nb0.
But all global variables defined at the bootloader src code are located
at
ram.
So the bootloader can't reference that symbols. And so the relocation
should
be needed. Right?

and then I got another question again.
how about bin format boot code? At that case, the relocation should be
needed?

Please let me know more.

"Manoj" wrote:

On 22 Aug, 17:22, daniel <dan...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hi, all?

A question is arised to me what purpose of the kernelrelocate()
function is.
From the bootloadermain() the kernelrelocate() is located at the
first
position.
Somebody say it is for relocating the global symbos of nk.bin to
main
memory.
Is it right? As I known, after downloading the nk.bin is completed
the
whole
control is hand over the kernel. The bootloader is useless since
that
time.
If so, the kernelrelocate can't be used for relocating the global
symbols of
kernel to memory.
What in the world is the role of the function?
Anybody can clear this question?

Hi Daniel,

First of all,i am not a guru.. But i am ready to share
knowledge and i hope if it is wrong or partial,veterans will correct
it..

Here we go,

Because the ROM image in the .nb0 file may be executed from ROM
(flash
memory) the bootloader's global and static variables cannot in general
be
in the same memory area as the code, so Romimage.exe moves the .data
section it finds in the .exe file to a new location in the .nb0 file.
KernelRelocate copies the .data section from ROM into RAM at runtime,
putting it at the RAM address specified in bootloader BIB file
(boot.bib). Any code that needs to access global variables can
determine where they are by looking at the contents of a
structure pointed at by the global pointer pTOC.

Hope u unterstood...







.



Relevant Pages

  • Re: what is the functionality of kernelrelocate() of eboot code?
    ... Isn't the bootloader moved from rom to ram in order to be run after power on? ... From the bootloadermainthe kernelrelocate() is located at the first ...
    (microsoft.public.windowsce.platbuilder)
  • Re: XIP - Execute in Place (For Bootloader)
    ... then the bootloader will not get copied to the RAM from the Flash. ... I would like to execute the Bootloader from the Flash Memory itself ... How to make the Bootloader to Execute from the Flash Memory itself ...
    (comp.arch.embedded)
  • Re: what is the functionality of kernelrelocate() of eboot code?
    ... settings in your bib file (the RAM section). ... Isn't the bootloader moved from rom to ram in order to be run after power ... why the relocation should be needed for ram based boot code and global ... From the bootloadermainthe kernelrelocate() is located at the ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Relocate from nor to ddr CE 5.0
    ... it depends on the bootloader implementation; ... programmed into flash. ... but the image info says it belongs to ram. ... blt CODEINRAM ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Free x86 C compiler wanted
    ... bootloader would copy the code from PROM to RAM then branch to the ... it may be a problem of your bootloader? ... Why at all do you copy the program into the RAM, ... AFAIR the entry point of an COM file simply is the first byte. ...
    (comp.compilers)