实验三:gdb跟踪调试内核从start_kernel到init进程启动
2016-03-13 13:13
387 查看
原创作品转载请注明出处《Linux内核分析》MOOC课程http://mooc.study.163.com/course/USTC-1000029000
如果我写的不好或者有误的地方请留言
题目自拟,内容围绕Linux内核的启动过程,即从start_kernel到init进程启动;
博客中需要使用实验截图
博客内容中需要仔细分析start_kernel函数的执行过程
总结部分需要阐明自己对“Linux系统启动过程”的理解,尤其是idle进程、1号进程是怎么来的。
实验报告:
在实验楼里跑了一下gdb 没有多大印象 印象就是卡 这是卡吗 下面分析换自己的虚拟机
rest_init
咱们需要知道的东西如下:
在start_kernel中:
init_task:手工创建的PCB 0号进程即最终的idle进程
trap_init:初始化中断管理模块
mm_init:初始化内存管理模块
sched_init:初始化调度模块
在rest_init中:
run_init_process:linux系统中的1号进程 第一个用户态进程
注意:
1.我们需要首先初始化获得pid=1的进程 如果初始化最终创建了ktheads
我们在创建kthreadd之前调度它 Linux系统将会OOPS
2.启动空闲线程必须至少执行一次schedule()
如果我写的不好或者有误的地方请留言
题目自拟,内容围绕Linux内核的启动过程,即从start_kernel到init进程启动;
博客中需要使用实验截图
博客内容中需要仔细分析start_kernel函数的执行过程
总结部分需要阐明自己对“Linux系统启动过程”的理解,尤其是idle进程、1号进程是怎么来的。
实验报告:
在实验楼里跑了一下gdb 没有多大印象 印象就是卡 这是卡吗 下面分析换自己的虚拟机
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); 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); }
rest_init
咱们需要知道的东西如下:
在start_kernel中:
init_task:手工创建的PCB 0号进程即最终的idle进程
trap_init:初始化中断管理模块
mm_init:初始化内存管理模块
sched_init:初始化调度模块
在rest_init中:
run_init_process:linux系统中的1号进程 第一个用户态进程
注意:
1.我们需要首先初始化获得pid=1的进程 如果初始化最终创建了ktheads
我们在创建kthreadd之前调度它 Linux系统将会OOPS
2.启动空闲线程必须至少执行一次schedule()
相关文章推荐
- hdoj--2073--无限的路(数学规律)
- 模块化-MVC与MVVM
- BZOJ_P1475 方格取数(网络流)
- Problem D: C语言习题 矩阵元素变换
- JavaScript事件
- 观察者模式
- java线程传统VS现代【1】
- 四则运算1规范代码
- 如何修改android工程的包名
- nrf51822开发指导之文档资料说明
- 动态库DLL详解
- tp中使用验证码验证
- 第三节 构造一个简单的Linux系统MenuOS
- FILE的缓冲模式
- TLPI--->Linux趣事之一
- Sherklock Actionbar 和 FragmentActivity的问题
- win8.1 java环境变量配置
- 关于caffe做分类的classification.cpp
- python 文件操作 os模块使用
- MOM架构