android/linux中的第一个init程序的启动
生活随笔
收集整理的這篇文章主要介紹了
android/linux中的第一个init程序的启动
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
快速鏈接:
.
👉👉👉 個人博客筆記導(dǎo)讀目錄(全部) 👈👈👈
目錄
- 1、編譯android的ini程序
- 2、kernel中執(zhí)行/init程序的流程
- 3、run_init_process()程序介紹
★★★ 友情鏈接 : 個人博客導(dǎo)讀首頁—點(diǎn)擊此處 ★★★
1、編譯android的ini程序
2、kernel中執(zhí)行/init程序的流程
在start_kernel的末尾處, 調(diào)用了reset_init()
asmlinkage __visible void __init start_kernel(void) {......rest_init(); }reset_init()啟了一個kernel線程kernel_init
kernel_thread(kernel_init, NULL, CLONE_FS);
在kernel_init()中執(zhí)行"/init"程序, 也就是第一個user程序
ret = run_init_process(execute_command), 其中execute_command是“/init”
在setup_up階段, 從cmdline中讀取init=xxxx,將xxx字符串寫入到了變量execute_command中
static int __init init_setup(char *str) {unsigned int i;execute_command = str;/** In case LILO is going to boot us with default command line,* it prepends "auto" before the whole cmdline which makes* the shell think it should execute a script with such name.* So we ignore all arguments entered _before_ init=... [MJ]*/for (i = 1; i < MAX_INIT_ARGS; i++)argv_init[i] = NULL;return 1; } __setup("init=", init_setup);3、run_init_process()程序介紹
run_init_process()
總結(jié)
以上是生活随笔為你收集整理的android/linux中的第一个init程序的启动的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [crypto]-05-转载:PKCS
- 下一篇: Device is not certif