Skip to contentSkip to conversation

passing bootargs to Linux on NIOS

U-Boot-Users Thomas Brand 2 participants 2 messages Aug 5, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

I'm currently implementing the bootm command for the NIOS processor from Altera. I'd like to pass boot arguments to the kernel. I tried to figure
out how it works in other architectures, but I'm still clueless.

I call the function theKernel(...) with some arguments like I have seen it in other implementations. Now my question is, how do I access these arguments in the kernel?. I know the NIOS processor is passing the first 4 arguments in registers when calling a function as a subroutine. But in the linux kernel in main.c is another call in the function start_kernel() for a kernel specific setup [setup_arch()] which will move the window-pointer and so change the registerfile. Therefore I cannot access the registers directly.

Or should I just define a piece of memory to put the arguments in? It will be hard coded in the kernel then.

Any hints? Every answer will be appreciated.

Thomas

#1 lore raw
Quoted 4 lines · In message <[email protected]> you wrote:

I'm currently implementing the bootm command for the NIOS processor from Altera. I'd like to pass boot arguments to the kernel. I tried to figure
out how it works in other architectures, but I'm still clueless.

What exactly don't you understand?

Quoted 3 lines

I call the function theKernel(...) with some arguments like I have seen it in other implementations. Now my question is, how do I access these arguments in the kernel?. I know the NIOS processor is passing the first

Well, how does the NIOS version of the kernel access it's boot arguments?

Quoted 2 lines

4 arguments in registers when calling a function as a subroutine. But in the linux kernel in main.c is another call in the function

main.c is not the right place to look. You want to check the kernel's entry point, i. e. "_start" (there is probably some "head.S" file n your source tree?).

Quoted 2 lines

Or should I just define a piece of memory to put the arguments in? It will be hard coded in the kernel then.

You design it...

Best regards,

Wolfgang Denk

Signature · 5 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
The use of Microsoft crippleware systems is a sin that  carries  with
it its own punishment.
         -- Tom Christiansen in <[email protected]>