[Fwd: Re: feedback requested on proposed new directive]

Joel Sherrill joel.sherrill at OARcorp.com
Mon Aug 28 17:56:07 UTC 2000


Rosimildo da Silva wrote:

> > We are considering adding a new directive to expose functionality
> > that has long been in the SuperCore.  It is an alternate task
> > entry style that follows "main".  Your task's argument list would
> > look like:
> >
> > rtems_task MYTASK( int argc, char ** argv )
> 
> Why not a signature to match main():
> 
>         int MYTASK( int argc, char ** argv );

This is OK by me... but what to do when MYTASK returns?  

> > The directive would look something like this (naming suggestions
> > requested :).
> >
> > rtems_status_code rtems_task_start_main_style(
> >   rtems_id         id,
> >   rtems_task_entry entry_point,  /* probably need another type? */
> >   int               argc
> >   char            **argv
> > );
> 
> I guess the idea is to start main() routine from it ?
> 
> Are you planning to remove the call to main() from boot_card.c ?

Eventually I would like to do so.  It is impossible to support
all the weird things that a global constructor can do when running
in a state where you can't block.  This means you can't do IO in
many (most?) situations?

>  rtems_status_code rc;
>  rc = rtems_task_start_main_style( id, main, argc, argv );
> 
> What happens when exit() &/or assert() are called ?

Same thing that happens now.  The whole application gets shutdown.
We can discuss the semantics of what happens and modify them
over time.  Modifying the view of what happens will probably
be necessary as dynamic loading becomes real.  
 
> I guess it is important to know what we are trying to
> archive here:
> 
>    + have a stardard way of starting up RTEMS.
> 
>    + making easier porting 3rd party applications

This is the initial and sole goal of the above.  

>    + providing a standard configuration
> 
> All programmers expects something similar a "C" program
> as an entry point for any application.
> A RTEMS newbee would like to have this fisrt application,
> link it against RTEMS libraries, and get up and running.
> At this moment, he/she should not be worried about
> configuration, init task, stack size, prority, etc.
> 
>   int main( int argc, char**argv )
>   {
>       printf( "Hello World\n" );
>       return 0;
>   }

I would eventually like to get to this but for now just want
it to be easier to port UNIX applications.  I think that 
getting better support for main()-style tasks is a big step
in that direction.  

The next logical step (to me) is to remove main from the BSP and 
make it the initial task.

> --
> Rosimildo da Silva            rdasilva at connectel.com
> ConnectTel, Inc.              Austin, TX -- USA
> Phone : 512-338-1111          Fax : 512-918-0449
> Mobile: 512-632-7579
> Company Page: http://www.connecttel.com
> Home Page: http://members.xoom.com/rosimildo/

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985



More information about the users mailing list