[Fwd: Re: feedback requested on proposed new directive]
Rosimildo da Silva
rdasilva at connecttel.com
Tue Aug 29 23:55:55 UTC 2000
Joel Sherrill wrote:
>
>
> Tradition.... Tradition... How did this tradition get started?
> I'll tell you... I don't know.
>
> <apologies to Fiddler on the Roof :)>
>
> OK.. I'll bite. :)
>
> Every task is capable of using any API. But I understand your meaning...
>
> We probably should borrow an idea I worked out for GNAT/RTEMS. There is
> an RTEMS init task (API flavor is irrelevant). It does whatever it
> takes to initialize things before calling "Ada main". What about
> something like this?
>
> rtems_task Init()
> {
> int status;
>
> #if defined(GET_ARGS)
> gets(cmdline);
> parse cmdline into argc, argv
> #endif
> #if defined(MOUNT_REAL_DISKS)
> initialize disk based filesystems
> #endif
> #if defined(HAS_NETWORKING)
> initialize networking
> #endif
>
> status = main( argc, argv, environp );
> exit( status );
> }
>
> As time goes on, I can see other initialization that would have to be
> inserted
> before main() -- network initialization is already there. Mounting
> a real disk filesystem would be another.
>
> [I can easily see a way to instantiate this code via something like
> confdefs.h.]
This sounds good. As long as the "init_task()" it is located alone
in a module and let people be able to use its own, if needed.
>
> Given the above scheme it would if USE_INIT_FINI were defined in bsp.h.
>
Yes.
> One of the network demos (ttcp?) has code to convert a string into an
> argc/argv
> type arrangement. Then the "ttcp_main" is invoked with them. The
> example above
> I hacked would call that code.
>
It is ok. But, getting the string from "stdin" would be a mistake if it
is used
by default. Just my opinion here.
Rosimildo.
More information about the users
mailing list