Command line arguments

Lars Munch lars at segv.dk
Fri Oct 15 13:30:29 UTC 2004


On Fri, Oct 15, 2004 at 08:15:48AM -0400, Ed Sutter wrote:
> > > >If there is a generic way to get the arguments to a user "main",
> > > >it might be nice to distribute it with RTEMS.
> > >
> > > I have code to do this but it is in my separate Coldfire BSP.
> > >
> > > If someone wishes to include it let me know and I will dig it out and
> > > clean it up. It creates argc/argv and uses main as the application entry
> > > point. That is:
> > >
> > >   boot_card -> rtems_premain -> main
> > >              *
> > >
> > > * rtems_premain is the Init task so rtems_premain and main is running as
> > > a task.
> > 
> > Oh, that sound nice. I would highly appreciate it if you would dig out
> > the code. If would be nice to a generic (boot loader independent) way
> > of doing this.
> 
> Chris & Lars,
> Ok, well, once again I'm confused...
> Are we talking about the same command line arguments?

yes, but in two different places of the boot process.
 
> At the time the rtems application is started up, the boot loader
> is the actively running program on the system; hence, it must
> take in the command line arguments and put them somewhere for
> the rtems application to retrieve.

yes, thats true and IMHO this should be placed in the BSP start.S and
passed on to the "int boot_card(int argc, char **argv, char **envp)"
function.

> How can this be done in a boot-loader-independent way?

The first step, getting it from the boot loader to the boot_card
function, will be highly boot loader dependant.

But the step of getting the arguments from the boot_card function (or
c_rtems_main function) to the actual task can be made generic. How is
just the question?

-- Lars Munch



More information about the users mailing list