您的位置:首页 > 运维架构 > Linux

MOOC-Linux内核lab3 调试内核从start_kernel到init进程启动

2015-03-21 06:18 351 查看
linux3.18 内核非常庞大, 有许多模块,本周实验使用gdb从start_kernel函数入手,调试内核。首先,设置实验环境,载入menuOS。为了进行调试, 需要在编译时,在代码中加入调试信息。
make menuconfig
之后在图形菜单里选择hacking kernel,接着再重新编译,准备就绪!在start_kernel处设置断点后,continue即进入函数。3.18内核非常庞大, 有许多模块,但都是从start_kernel为入口,推荐以下几个函数进行跟踪学习。<span style="white-space:pre"> </span>trap_init(); //初始化中断向量mm_init(); //初始化内存模块/** Set up the scheduler prior starting any interrupts (such as the* timer interrupt). Full topology setup happens at smp_init()* time - but meanwhile we still have a functioning scheduler.*/sched_init(); //初始化调度模块
<span style="white-space:pre">	</span>/* Do the rest non-__init'ed, we're now alive */<span style="white-space:pre">	</span>rest_init();  //初始化idle进程(0号进程)
Linzhe+原创作品转载请注明出处 + 《Linux内核分析》MOOC课程http://mooc.study.163.com/course/USTC-1000029000 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: