--- Quote Start ---
originally posted by hippo+jul 10 2006, 01:03 am--><div class='quotetop'>quote (hippo @ jul 10 2006, 01:03 am)</div>
--- quote start ---
<!--quotebegin-xunios@Jul 5 2006, 05:32 PM
understanding kernel:
there is a piece of code in head.s like this:
nextpc r1 /* find out where we are */
chkadr:
movia r2,chkadr
beq r1,r2,finish_move /* we are running in ram done */
in my opinion, r1 equals r2 no matter the code exits in the ram or flash memory. but here it means r1==r2 will be true only if the codes executing from ram.maybe r1==r2 will be false if the codes executing from flash memory?
thanks in advance!
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=16661)
--- quote end ---
--- Quote End ---
It is different.
The kernel is linked to sdram.
The nextpc will get the real pc.
If it is from flash, real pc will be different from the (linked address of) chkadr.
It will them move the code from flash to sdram, and then jump start on sdram.
But actually, there is a altera supplied boot loader (either cfi or epcs) inserted during elf2flash conversion. So from reset, it will start from altera boot loader, and which will move the kernel to sdram.
Finally you will say the move code in head.S was not taken.
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=16743)</div>
[/b]
--- Quote End ---
Thanks hippo.This has been puzzling me for a long time!
If it is from flash, real pc will be different from the (linked address of) chkadr.
--------------Then ,if excuting from the flash,the will pc will be what ?Are there any relative documents?