- 3
- 0
- 约2万字
- 约 18页
- 2017-01-05 发布于贵州
- 举报
Init进程启动Init进程启动
Init进程启动
asmlinkage void __init start_kernel(void)
{
..........................................
rest_init();
}
static noinline void __init_refok rest_init(void)
__releases(kernel_lock)
{
int pid;
rcu_scheduler_starting();
/*
* We need to spawn init first so that it obtains pid 1, however
* the init task will end up wanting to create kthreads, which, if
* we schedule it before we create kthreadd, will OOPS.
*/
kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND);
numa_default_policy();
pid = kernel_thread(kthreadd, NULL, CLONE_FS | CLONE_FILES);
rcu_read_lock();
kthreadd_task = find_task_by_pid_ns(pid, init_pid_ns);
rcu_read_unlock();
complete(kthreadd_done);
unlock_kernel();
/*
* The boot idle thread must execute schedule()
* at least once to get things moving:
*/
init_idle_bootup_task(current);
preempt_enable_no_resched();
schedule();
preempt_disable();
/* Call into cpu_idle with preempt disabled */
cpu_idle();
}
static int __init kernel_init(void * unused)
{
/*
* Wait until kthreadd is all set-up.
*/
wait_for_completion(kthreadd_done);
lock_kernel();
do_basic_setup();
..................................................
init_post();
return 0;
}
static noinline int init_post(void)
__releases(kernel_lock)
{
/* need to finish all async __init code before freeing the memory */
async_synchronize_full();
free_initmem();
unlock_kernel();
mark_rodata_ro();
system_state = SYSTEM_RUNNING;
numa_default_policy();
current-signal-flags |= SIGNAL_UNKILLABLE;
if (ramdisk_execute_command) {
run_init_process(ramdisk_execute_command);
printk(KERN_WARNING Failed to execute %s\n,
ramdisk_execute_command);
}
/*
* We try each of these until one succeeds.
*
* The Bourne shell can be used instead of init if we are
* trying to recover a really broken machine.
*/
if (execute_command) {
run_init_process(execute_command);
printk(KERN_WARNING Failed to execute %s. Attempting
defaults...\n,
您可能关注的文档
- HSE计划书参考内容.doc
- HTML 表单例子实例.doc
- HTML5 LocalStorage 本地存储.doc
- HTML5 黑白五子棋.doc
- html5开发d的个人使用总结.doc
- HTTP协议头.doc
- HTTP服务七层架构技术.doc
- HullFund7eCh04ProblemSolutions.doc
- human resource management of state-owned enterprises Methods and ways of personnel quality.doc
- HW_U3B4教师版.doc
- 河北盐山中学等校2025-2026学年上学期高三一模化学试卷(含解析).docx
- 河北正定中学2025-2026学年高一上学期期末考试物理试卷(含解析).docx
- 河北张家口市怀安县2025-2026学年第一学期期末教学综合评价八年级地理试卷(含解析).docx
- 河南安阳市殷都区2025-2026学年第一学期期末教学质量检测七年级地理试卷(含解析).docx
- 河南安阳市滑县2025一2026学年第一学期期末学业质量监测八年级地理试题(含解析).docx
- 河南安阳市林州市2025-2026学年上学期期末考试高一政治试题(含解析).docx
- 河南焦作市武陟县第一中学2025-2026学年高一上学期1月月考语文试卷(含解析).docx
- 河南济源市2025-2026学年上学期期末学业质量调研七年级历史试卷(含解析).docx
- PICC导管并发症的紧急处理与护理.pptx
- 河南鹤壁市2025-2026学年高二上学期期末考试生物试题(含解析).docx
最近下载
- 长庆一氧化碳中毒事故案例分析.ppt VIP
- 2019创新思维考试.doc VIP
- 数学人教版九年级上册用列举法求概率.2用列举法求概率.pptx VIP
- 《工厂供电》课设计指导书.doc VIP
- 《历代名画记》与《法书要录》.docx VIP
- 心电监护常见心律失常的识别及处理医学64页PPT.pptx VIP
- (网络参考版)广西2025年高考真题历史试卷(含答案).docx VIP
- 中兴VUE-NR高级认证(52-115)练习试题.doc VIP
- 基于改进YOLOv5s算法的城市道路交通场景目标检测研究.pdf VIP
- 高中英语高考复习动词时态专项练习(共70题,附参考答案和解析).docx VIP
原创力文档

文档评论(0)