分析system_call中断处理过程
分析system_call中断处理过程使用gdb跟踪分析一个系统调用内核函数(以 sys_chmod为例)启动调试内核qemu -kernel linux-3.18.6/arch/x86/boot/bzImage -initrd rootfs.img -s -Sgdb 调试另开 shellgdb(gdb) file linux-3.18.6/vmlinux#在 gdb 界面中 targ
·
分析system_call中断处理过程
使用gdb跟踪分析一个系统调用内核函数(以 sys_chmod为例)
- 启动调试内核
qemu -kernel linux-3.18.6/arch/x86/boot/bzImage -initrd rootfs.img -s -S

- gdb 调试
另开 shell
gdb
(gdb) file linux-3.18.6/vmlinux #在 gdb 界面中 target remote之前加载符号表
(gdb) target remote :1234 #建立连接
(gdb) break start_kernel #设置断点


- 系统启动

- 设置断点 sys_chmod
(gbd)b sys_chmod

- 执行命令 chmod

- 触发 gdb 中断

- 单步执行
(gbd) s

- 继续执行
(gbd) c

- 系统调用完成,返回

system_call中断处理过程图解

版权声明:本文为博主原创文章,未经博主允许不得转载。
更多推荐



所有评论(0)