JianyuWang0623 opened a new pull request, #17215:
URL: https://github.com/apache/nuttx/pull/17215
## Summary
This PR adds documentation for the Init component and updates the
configuration for qemu-armv8a:fastboot.
1. qemu-armv8a/fastboot: Switch init entrypoint from NSH to Init
- Updated INIT_ENTRYPOINT from nsh_main to init_main
- Configured Init to launch critical services (console and fastboot)
2. Add documentation for the Init function
- Included syntax explanations for key Init APIs
- Provided simple usage examples to illustrate practical implementation
Link https://github.com/apache/nuttx-apps/pull/3192
## Impact
- documentation
## Testing
### 1. Documentation
<img width="453" height="889" alt="image"
src="https://github.com/user-attachments/assets/a865c3ac-2d6e-4e96-86f1-f59148fa64e5"
/>
### 2. qemu-armv8a:fastboot
```
LD: nuttx
Memory region Used Size Region Size %age Used
CP: nuttx.hex
CP: nuttx.bin
[ 0.010000] parsing /etc/init.d/init.rc
[ 0.010000] line 1: 'on init'
[ 0.010000] new section (on)
[ 0.010000] add action 0x4042a270(init) to manager 0x4042a090
[ 0.010000] line 2: ' class_start core'
[ 0.010000] add command 0x4042a2d0(class_start) to action 0x4042a270
[ 0.010000] argv[0] 'class_start'
[ 0.010000] argv[1] 'core'
[ 0.010000] line 3: 'service console sh'
[ 0.010000] new section (service)
[ 0.010000] line 4: ' class core'
[ 0.010000] apply option[0] 0x40290b68 for class
[ 0.010000] argv[0] 'class'
[ 0.010000] argv[1] 'core'
[ 0.020000] line 5: ' restart_period 1000'
[ 0.020000] apply option[2] 0x40290b48 for restart_period
[ 0.020000] argv[0] 'restart_period'
[ 0.020000] argv[1] '1000'
[ 0.020000] line 6: 'service fastboot fastbootd'
[ 0.020000] new section (service)
[ 0.020000] line 7: ' class core'
[ 0.020000] apply option[0] 0x40290b68 for class
[ 0.020000] argv[0] 'class'
[ 0.020000] argv[1] 'core'
[ 0.020000] line 8: ' restart_period 7000'
[ 0.020000] apply option[2] 0x40290b48 for restart_period
[ 0.020000] argv[0] 'restart_period'
[ 0.020000] argv[1] '7000'
[ 0.020000] == Dump Actions ==
[ 0.020000] action 0x4042a270
[ 0.020000] event trigger: 'init'
[ 0.020000] argv[0] 'class_start'
[ 0.020000] argv[1] 'core'
[ 0.020000] == Dump Services ==
[ 0.020000] Service 0x4042a370 name 'console' path 'sh'
[ 0.020000] pid: 0
[ 0.020000] arguments:
[ 0.020000] [0] 'service'
[ 0.020000] [1] 'console'
[ 0.020000] [2] 'sh'
[ 0.020000] classes:
[ 0.020000] 'core'
[ 0.020000] restart_period: 1000
[ 0.020000] Service 0x4042a490 name 'fastboot' path 'fastbootd'
[ 0.020000] pid: 0
[ 0.020000] arguments:
[ 0.020000] [0] 'service'
[ 0.020000] [1] 'fastboot'
[ 0.020000] [2] 'fastbootd'
[ 0.020000] classes:
[ 0.020000] 'core'
[ 0.020000] restart_period: 7000
[ 0.020000] add event [0] 'boot'
[ 0.040000] add event [1] 'init'
[ 0.040000] add event [2] 'netinit'
[ 0.040000] remove event [0] 'boot'
[ 0.040000] add ready 0x4042a2d0 class_start
[ 0.040000] executing command 'class_start'
[ 0.040000] starting service 'console' ...
[ 0.040000] service 'console' flag 0x0 add 0x4
[ 0.040000] +flag 'running'
[ 0.040000] service 'console' flag 0x4 add 0x8
[ 0.040000] -flag 'restarting'
[ 0.040000] service 'console' flag 0x4 add 0x1
[ 0.040000] -flag 'disabled'
[ 0.040000] started service 'console' pid 4
[ 0.040000] starting service 'fastboot' ...
[ 0.040000] service 'fastboot' flag 0x0 add 0x4
[ 0.040000] +flag 'running'
[ 0.040000] service 'fastboot' flag 0x4 add 0x8
[ 0.040000] -flag 'restarting'
[ 0.040000] service 'fastboot' flag 0x4 add 0x1
[ 0.040000] -flag 'disabled'
[ 0.040000] started service 'fastboot' pid 5
[ 0.050000] remove event [1] 'init'
[ 0.050000] remove event [2] 'netinit'
nsh> ps
PID PPID GROUP PRI POLICY TYPE NPX STATE EVENT SIGMASK
STACK USED FILLED COMMAND
0 0 0 0 FIFO Kthread - Ready
0000000000000000 0008160 0000928 11.3% Idle_Task
1 0 0 192 RR Kthread - Waiting Semaphore
0000000000000000 0008096 0001040 12.8% hpwork 0x403f5540 0x403f55c0
2 0 0 100 RR Kthread - Waiting Semaphore
0000000000000000 0008096 0001040 12.8% lpwork 0x403f5490 0x403f5510
3 0 3 100 RR Task - Waiting Semaphore
0000000000000000 0008128 0002112 25.9% init_main
4 3 4 100 RR Task - Running
0000000000000000 0008128 0003344 41.1% sh
5 3 5 100 RR Task - Waiting Semaphore
0000000000000000 0008128 0002144 26.3% fastbootd
nsh>
nsh>
```
--
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]