Dear RIOTers,
today's question from Murat and my past efforts with native have one thing in common: our environments have a hard (or impossible) to change dependency on main() as the system's entry point.
For native, I was able to navigate around this, but past mails to this list show that this has (negative) implications for c++ (which are unfixed as of today). Murat says with PsoC it is impossible to navigate around this restriction.
I imagine we might see more platforms with a fixed idea of main in the future where RIOT's use of main for the first application thread function is a problem.
My proposal: Let the application Makefile export one or possibly several names to be used for the initial application thread(s). kernel_init will then take care of creating those. The function name "main" will be reserved for boards/cpus to implement. In case of native/PsoC, the cpu's or board's main function can then call kernel_init (after possibly taking care of their respective initialization).
Bonus benefits/implications:
The application gets to define the name(s) of (all) it's thread(s),
the setting of this thread's priority, stacksize, flags etc. become
more obvious, it will be possible to have applications without any
application thread (maybe auto_init is enough for a router in the
future?), and possibly more I didn't think of immediately
Please discuss!
Cheers, Ludwig