zoukankan      html  css  js  c++  java
  • imx6 启动 init进程

    之前不知道imx6内核是怎么启动文件系统的init进程,查了下资料,记录于此,以后再来补充。

    kernel/init/main.c

    static noinline int init_post(void)
    {
    	/* need to finish all async __init code before freeing the memory */
    	async_synchronize_full();
    	free_initmem();
    	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
    ",
    				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...
    ", execute_command);
    	}
            // 启动init进程
    	run_init_process("/sbin/init");
    	run_init_process("/etc/init");
    	run_init_process("/bin/init");
    	run_init_process("/bin/sh");
    
    	panic("No init found.  Try passing init= option to kernel. "
    	      "See Linux Documentation/init.txt for guidance.");
    }
    

    Tony Liu

    2016-8-30, Shenzhen

  • 相关阅读:
    protected、public、private
    第十五章 面向对象程序设计
    第十四章 重载运算与类型转换
    聚合类
    explicit构造函数
    allocator类
    直接管理内存——new和delete
    智能指针
    Bugku-CTF之点击一百万次
    Bugku-CTF之flag在index里
  • 原文地址:https://www.cnblogs.com/helloworldtoyou/p/5821443.html
Copyright © 2011-2022 走看看