由于我的机器没有串口,所以我直接装了两个虚拟的系统。
用一个虚拟的系统通过 vmware中的串口调试另外一个虚拟linux内核。
首先请阅读 "使用kgdb调试linux内核及内核模块", 我做的工作只是用vmware提供的虚拟串口设备把两给虚拟系统连接起来,具体调试环境的建立都在这篇参考文章里面介绍。
A. First setup kgdb debuging environment. For the detail please refer to "使用kgdb调试linux内核及内核模块".
B. Sencondly, you should configure vmware. This step's purpose is to make the two virtual system connected through vmware's serial port.
1. Add a serial device for each virtual linux system.
2. And select the "named pipe" in the serial devcie's configure page.
Note: The pipe's name of two virtual machine must be same. And one is client end the other is server end.
C. Now you can use the kgdb to debug the target machine's kernel service.
And there is a little difference when setting gdb debug param : both side of the virtual serial connection the serial port device should be /dev/ttyS0.