全面解析Linux 内核 3.10.x - 启动1号进程
2016-01-14 21:09
671 查看
From: 全面解析Linux 内核 3.10.x - 本文章完全基于MIPS架构
上述代码属于start_kernel的末时了。
rset_init 主要做了以下几件事。
刷新调度系统 -
启动1号进程(祖先进程) -
启动2号进程 -
进程抢占disable -
内核进程等待状态。
配置
这里我们只将1号进程,后面我还需要在去透析下cpu_idle.
By: Keven - 点滴积累
坚持也许就是胜利 - Keven
当内核找到文件系统以后(这里已经挂载proc文件系统了),内核的主要启动使命就越来越少了。因为江山基本已经打下了,剩下的就是要坐江山了。来看下面的这段代码。static noinline void __init_refok rest_init(void) { 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); /* * The boot idle thread must execute schedule() * at least once to get things moving: */ init_idle_bootup_task(current); schedule_preempt_disabled(); /* Call into cpu_idle with preempt disabled */ cpu_startup_entry(CPUHP_ONLINE); }
上述代码属于start_kernel的末时了。
rset_init 主要做了以下几件事。
刷新调度系统 -
rcu_scheduler_starting
启动1号进程(祖先进程) -
kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND);
启动2号进程 -
pid = kernel_thread(kthreadd, NULL, CLONE_FS | CLONE_FILES);
进程抢占disable -
schedule_preempt_disabled();
内核进程等待状态。
配置
cpu_idle..
这里我们只将1号进程,后面我还需要在去透析下cpu_idle.
By: Keven - 点滴积累
相关文章推荐
- 全面解析Linux 内核 3.10.x - initramfs 启动流程
- 制作openstack用的centos6.5镜像
- Linux-中断和中断处理
- Linux创建用户、用户组 及 删除
- CentOS服务器 6.6 安装MySQL5.5.46
- Linux进程间通信——使用共享内存
- Java开发常用的Linux命令
- Linux下媒体文件播放问题
- Linux驱动mmap内存映射
- Linux下截图
- Linux下玩转Dota2
- 如何在Linux上使用命令行查看硬件信息
- Linux下挂载/卸载光盘
- 检测Linux内存使用情况的free命令的10个
- 在Linux虚拟机和物理机之间共享文件夹
- 10大好用的Linux实用工具推荐
- Linux 命令 Knowhow
- CENTOS6.5添加JAVA环境变量
- linux VLAN配置(vconfig)
- CentOS-Linux安装 XS-Tools (XenServer)