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

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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?
    ... The bootloader is copied to RAM, but the bootloader doesn't know it. ... 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)
  • ld script
    ... Can anyone help me with Linker LD script memory allocation ... The bootloader should be placed i ROM at 0xa000 and above. ... The bootloader wil copy its Ram based program (runing ...
    (comp.os.linux.powerpc)
  • ld script
    ... Can anyone help me with Linker LD script memory allocation ... The bootloader should be placed i ROM at 0xa000 and above. ... The bootloader wil copy its Ram based program (runing ...
    (comp.os.linux.misc)
  • linker ld script
    ... Can anyone help me with Linker LD script memory allocation ... The bootloader should be placed i ROM at 0xa000 and above. ... The bootloader wil copy its Ram based program (runing ...
    (comp.os.linux.embedded)
  • 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)