Command line arguments

Ed Sutter esutter at lucent.com
Fri Oct 15 13:41:12 UTC 2004


> > > > >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?

Got it!  I was referring to the first step, and you were referring to
the second step.
Thanks
Ed



More information about the users mailing list