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 7:03 PM, Greg Ungerer wrote:
> Its not the pointer I am worried about :-)
> It is what it points to. Where is the actual string of
> the command line in memory. Will it be overwritten?

u-boot chooses high memory.
It appears that this is moderately reasonable. What do you think?

Here's the code from u-boot:

-=-=-

         /*
          * Booting a (Linux) kernel image
          *
          * Allocate space for command line and board info - the
          * address should be as high as possible within the reach of
          * the kernel (see CFG_BOOTMAPSZ settings), but in unused
          * memory, which means far enough below the current stack
          * pointer.
          */
         asm("movel %%a7, %%d0\n"
             "movel %%d0, %0\n": "=d"(sp): :"%d0");

         debug("## Current stack ends at 0x%08lX ", sp);

         sp -= 2048;             /* just to be sure */
         if (sp > CFG_BOOTMAPSZ)
                 sp = CFG_BOOTMAPSZ;
         sp &= ~0xF;

         debug("=> set upper limit to 0x%08lX\n", sp);

         cmdline = (char *)((sp - CFG_BARGSIZE) & ~0xF);
         kbd = (bd_t *) (((ulong) cmdline - sizeof(bd_t)) & ~0xF);

         if ((s = getenv("bootargs")) == NULL)
                 s = "";

         strcpy(cmdline, s);
-=-=-

---
[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.