kernel course no. 1

Jure Menart jure at kom.org
Mon Sep 3 07:55:27 EST 2001


Hi again,
On Thu, Aug 30, 2001 at 05:29:04PM +0200, Benjamin Herrenschmidt wrote:
> >I am checking kernel source from penguinppc.org (development tree), and try to
> >boot it... but, when I checked code in head_4xx.h I saw that code from
> >'_start' doesn't jump to 'start_here' because of 'strange coding' (sorry, but
> >it really seems strange to me ;-):
> >
> >	li	r4,MSR_KERNEL
> >	lis	r3,start_kernel at h
> >	ori	r3,r3,start_kernel at l
> >	mtspr	SRR0,r3
> >	mtspr	SRR1,r4
> >	rfi /* enable MMU and jump to start_kernel */
> >
> >In this part it stops... why don't we just use 'bl start_here'? I tried and it
> >works, but seems strange why would it be so complicated without a reason. Is
> >there a reason? :-)
>
> Yes, and a big one ! Normally, at that point, you are running with MMU off,
> you need to re-enable it before entering the kernel, that's what the "rfi"
> does for you when the proper value is set into SRR1.

OK, thanks for information (I presumed that it is 'catch' with rfi :-), but
I've got problem with booting my kernel anyway. I was wondering why would
booting stop when this 'rfi' occurs... I was thinking it might be problem with
the stack, but I'm not be sure. I don't know how to tell kernel where the
stack 'lies' in memory (I don't use boot that comes with kernel).
Could problem be somewhere else?

[snip]
> >OK, just one more thing... is there any 'roadmap' or some other kind of
> >documentation that would describe this early stage of kernel booting? (like
> >at first it is '_start', which do this and this and then jumps to
> >'start_here' which does initialization of... etc etc).
?

Thanks for any answers...

best wishes, Jure


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-dev mailing list