Hi,

Thanks a lot.

from : HelenOS/boot/arch/arm32/src/asm.S and map files.

SYMBOL(start)
    ldr sp, =boot_stack
    b bootstrap

If we keep an inline assembly in

void bootstrap(void)
{
  int *store_r2_for_atags = 0;
  asm volatile ("mov %%r2, %0" : "=r" (store_r2_for_atags)); //TODO: Sourav
Punoriyar
  ........

Uboot store the params info in r2 and passes..
As r2 is not used before branching to bootstrap( ). Will the above line of
code will give me the value stored in r2. Are there possibilities of r2
getting modified before reaching to this line ?


Regards,
Sourav Punoriyar


On Thu, Feb 23, 2017 at 3:33 AM, Jakub Jermář <ja...@jermar.eu> wrote:

> On 02/22/2017 09:40 PM, Jakub Jermář wrote:
> >> Confusions i am having:
> >> 1> The bootargs info are given in r2 register. How do i preserve it when
> >> stage-2 boot-loader comes into action , because till the kernel comes
> >> into picture i will loose the info passed from uboot.
> >> -------> i feel i need to preserve the info passed from Uboot so that i
> >> can pass it down to the kernel and initialize boot_args via NetBSD
> >> stage-2 loader .
> >
> > Yes, the best way to communicate information between the loader and the
> > kernel is via the bootinfo structure. Just feel free to add a member
> > which will hold the address from r2. Note that this structure needs to
> > be modified in two places: in the loader and also in the kernel. We
> > should probably fix this dichotomy by moving it under abi/.
>
> One more thing - the arguments can theoretically overlap with memory
> used by the kernel, so it may be a good idea to actually pass them as a
> copy rather than by reference to the kernel.
>
> Jakub
>
> _______________________________________________
> HelenOS-devel mailing list
> HelenOS-devel@lists.modry.cz
> http://lists.modry.cz/listinfo/helenos-devel
>
_______________________________________________
HelenOS-devel mailing list
HelenOS-devel@lists.modry.cz
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to