linguini1 commented on PR #18408:
URL: https://github.com/apache/nuttx/pull/18408#issuecomment-3930559843

   > * Thank you @linguini1 this is another mountain that you move with your 
one-man-army :-)
   > 
   >     * As discussed on the [Simplify NuttX initialization 
#11321](https://github.com/apache/nuttx/issues/11321) and mailing list there is 
agreement on the change already so we can move forward :-)
   > 
   >     * Maybe its worth marking this PR as draft until ready?
   
   This PR is now ready! I just finished removing the remaining references to 
board_app_initialize everywhere, so aside from unintended bugs, everything is 
in place. What needs to happen now is some pretty extensive testing (right now 
I have only done a few QEMU/sim boards) to make sure there were no human 
errors/unintended consequences :)
   
   >     * Would it be possible to create documentation and diagram of the boot 
process? So we know what was before and after? To be honest I am a bit lost in 
this probably more users too :-P Please let me know how can I help here?? :-)
   
   I think that would be good! I must admit though, I am not the most familiar 
with the boot process. This PR only modifies a very small subset of it.
   
   TLDR:
   Many defconfigs enabled NSH_ARCHINIT to allow NSH to take care of board 
initialization. This was performed through the call `boardctl(BOARDIOC_INIT, 
0)`, which under the hood calls the implementation of `board_app_initialize`. 
However, it was also possible to have NuttX call `board_late_initialize` by 
enabling `BOARD_LATE_INITIALIZE`. The benefit was not having anything done from 
user space. Since the two methods achieve the same task, have the exact same 
logic on many platforms, and was confusing to users, this PR makes 
`board_late_initialize` the default and removes the userspace init that was 
done through NSH. So really, it moves that one boot step from userspace to 
kernel space.
   
   _Note: users can still control init from userspace in extreme cases by 
making their own implementation of BOARDIOC_FINALINIT_.
   
   >     * I am wondering if you already change some internals maybe naming 
could be updated too to be simpler? Do you think this would help or is not 
necessary? :-)
   
   What kind of naming are you thinking of? I don't really want to play around 
with too many changes since that will delay this PR and could introduce more 
margin of error. Right now all I've done is strictly replace all `app_init` 
stuff with `late_init` stuff.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to