先运行start_bochs.bat,敲一下回车,显示waiting for gdb connection on localhost:1234
运行bin目录下的insight.exe
File->Open 打开linux-0.11\tools目录下的system.exe
File->Target Settings Target下拉列表中选择Remote/TCP,hostname:localhost,prot:1234
View->Console,打开控制台
Run->Run ,运行,停在startup_32
控制台中输入以下命令
(gdb) break start
Breakpoint 2 at 0x6624: file init/main.c, line 105.
(gdb) handle SIGSEGV noprint nostop ignore
Signal Stop Print Pass toprogram Description
SIGSEGV No No No Segmentation fault
(gdb) cont
Continuing.
Breakpoint 2, start () at init/main.c:105
1. 打开linux-0.11,运行start_bochs.bat
a) 回车,看到:waiting for gdb connection onlocalhost:1234
2. 打开mingw-insight/bin,运行insight.exe
a) File->Open打开linux-0.11\tools目录下的system.exe
b) File->TargetSettings Target下拉列表中选择Remote/TCP
i.Target:Remote/TCP
ii. Hostname:localhost
iii. Port:1234
c) View->Console
d) Run->Run
注意:insight-mingw2中的insight可以显示正确的寄存器信息,而insight-mingw中的不可以!!!
本文档详细介绍了如何使用Bochs模拟器和Insight调试器进行Linux内核调试的过程。首先通过启动Bochs模拟器并连接到指定端口等待远程调试会话,接着在Insight中设置目标为本地主机上的Bochs模拟器,并通过一系列步骤进入调试模式,最终实现对Linux内核启动过程的逐步跟踪。

202

被折叠的 条评论
为什么被折叠?



