[Fwd: Re: feedback requested on proposed new directive]
Joel Sherrill
joel.sherrill at OARcorp.com
Wed Aug 30 14:10:23 UTC 2000
Rosimildo da Silva wrote:
>
> Joel Sherrill wrote:
> >
> >
> > 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.
That was my intent. I really don't know the best way to work out
the details. On one hand, you have the default configuration
information
(dummy) and ideally the Init->main task would work the same way.
But I don't see how it can.
> > Given the above scheme it would if USE_INIT_FINI were defined in bsp.h.
> >
>
> Yes.
OK. This makes me lean toward instantiating this function
as part of confdefs.h.
Eric N... how could we integrate a dummy+main and possibly
a loopback network configuration into RTEMS packages? I know
based on our off-line email that having a network configuration
breaks the select tests. But you need it to link some of the
tests (in particular MySQL).
> > 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.
It should not be used by default -- it would be useful in test harnesses
though. This was my solution to Charles G's problem.
> 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