Re: kernel args from u-boot on M5282LITE

Allon Stern <[email protected]>
Newsgroups gmane.comp.hardware.motorola.microcontrollers.coldfire
Message-ID <[email protected]>
On Feb 11, 2008, at 2:20 AM, Greg Ungerer wrote:

> Hi Allon,
>
> Allon Stern wrote:
>> So, I figured out a way to pass kernel arguments from u-boot on  
>> the M5282LITE. U-Boot calls the kernel, passing arguments on the  
>> stack; all that is needed is to stash the pointer to the arguments  
>> (stashed in high mem) when the kernel first starts, and before the  
>> stack pointer is trounced, then use that pointer slightly later  
>> when the arguments are looked at.
>> Any comments on this hack? Should I expect it to fail, and be  
>> surprised that it works?
>
> The thing to watch is where in practice do the args end
> up being in the memory map?
>
> The linux kernel will do a fair bit of setup (clear bss, initial
> allocations, etc) before it gets around to looking at the args.
> Will they have been overwritten by this time?

Well no. That's why I stash the pointer right after the disabling of  
interrupts; I think it's the 3rd assembly instruction into the kernel...

I had a patch for the 2.6.19-uc1 kernel; Now that I'm on 2.6.24-uc0,  
I'll apply it there and send out patches. The code has been cleaned  
up a bit between releases. (okay patches - still waiting for a  
release ;) ;);) )
-
allon

---
[email protected]              Send a post to the list.
[email protected]        Join the list.
[email protected]    Join the list in digest mode.
[email protected]     Leave the list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.