2005-10-03 15:35:29

by Dave B. Sharp

[permalink] [raw]
Subject: ppc boot entry point

Hey there,
Can anyone tell me how to find te entry point (i.e.
address) into the kernel, when control is passed from
the boot loader?
Where are the arguements such as the boot parameters.
I am compiling for a generic ppc kernel at this point.
Cheers
Dave Sharp






__________________________________________________________
Find your next car at http://autos.yahoo.ca


2005-10-03 16:46:33

by linux-os (Dick Johnson)

[permalink] [raw]
Subject: Re: ppc boot entry point


On Mon, 3 Oct 2005, Dave B. Sharp wrote:

> Hey there,
> Can anyone tell me how to find te entry point (i.e.
> address) into the kernel, when control is passed from
> the boot loader?

Look at System.map. phys_startup_32 and startup_32. The
former is the physical (bus) address where it must be
loaded, the latter is the virtual address after it
starts.

> Where are the arguements such as the boot parameters.
> I am compiling for a generic ppc kernel at this point.
> Cheers
> Dave Sharp
>

Look at address, boot_params, also shown in System.map. That's
where they end up being relocated.


Cheers,
Dick Johnson
Penguin : Linux version 2.6.13 on an i686 machine (5589.55 BogoMips).
Warning : 98.36% of all statistics are fiction.

****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.

2005-10-03 17:22:43

by Tom Rini

[permalink] [raw]
Subject: Re: ppc boot entry point

On Mon, Oct 03, 2005 at 11:35:27AM -0400, Dave B. Sharp wrote:

> Hey there,
> Can anyone tell me how to find te entry point (i.e.
> address) into the kernel, when control is passed from
> the boot loader?
> Where are the arguements such as the boot parameters.
> I am compiling for a generic ppc kernel at this point.

This is PowerPC specific stuff. Setting aside pmac's, and boards which
use U-Boot, and other boards with a firmware that sets up the
environment directly for the vmlinux file (which is the kernel proper)
to run, the code under arch/ppc/boot/simple/ is typically run. This
code is linked to run at 8mb and will relocate itself there, regardless
of where the firmware actually loaded it into memory. This linked
address may be changed by enabling the ADVANCED_OPTIONS option and
choosing an alternate address. This really only makes sense on machines
where loading at 8mb won't work as you have 8mb or less of memory.

--
Tom Rini
http://gate.crashing.org/~trini/

2005-10-03 19:40:23

by Jon Masters

[permalink] [raw]
Subject: Re: ppc boot entry point

On 10/3/05, Tom Rini <[email protected]> wrote:
> On Mon, Oct 03, 2005 at 11:35:27AM -0400, Dave B. Sharp wrote:
>
> > Hey there,
> > Can anyone tell me how to find te entry point (i.e.
> > address) into the kernel, when control is passed from
> > the boot loader?
> > Where are the arguements such as the boot parameters.
> > I am compiling for a generic ppc kernel at this point.

> This is PowerPC specific stuff.

Yes, it is. In addition to your comments, Tom, it's worth looking in
the corresponding head.S, head_4xx.S or whatever files to see that the
kernel is called much like a regular function with arguments in
registers r3 upwards. You'll find most of what you want to know by
going through from early_init onwards.

Jon.