在Mini2440开发板上,怎么用kgdb调试Linux 2.6.32内核?

Wenxy1 2010-11-12 10:50:37
在Mini2440开发板上,怎么用kgdb调试Linux 2.6.32内核?
我查阅了kgdb的资料,不能实现kgdb调试。
硬件:Mini2440, 128MB nand flash.
软件:linux 2.6.32.2, U-Boot 2010.03 modified by tekkamanninja (tekkamanninja@163.com),
编译内核里选上:
  • Kernel debugging
  • Compile the kernel with debug info
  • KGDB: kernel debugging with remote gdb --->
    <*> KGDB: use kgdb over the serial console

    U-boot里引导命令行:
    bootcmd=nfs 0x30008000 192.168.0.26:/home/wenxy/src/mini_2440/linux-2.6.32.2/arch/arm/boot/u-boot_zImage.img;bootm
    bootargs=noinitrd root=/dev/nfs rw nfsroot=192.168.0.26:/home/wenxy/src/mini_2440/root_qtopia ip=192.168.0.100:192.168.0.26::255.255.255.0
  • console=ttySAC0,115200 kgdboc=ttySAC1,115200 kgdbwait init=/linuxrc mem=64M

    通过NFS启动kenrel, rootfs,可是系统自动启动,不能停下来,即出现:kgdb: Waiting for connection from remote gdb...

    特向大家求助,请有kgdb调试经验的朋友来看看,多谢。

    我在友善之臂的官网论坛也发这个问题的贴子:
    http://www.arm9home.net/read.php?tid-8699-keyword-%B5%F7%CA%D4%C4%DA%BA%CB.html
...全文
853 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
diytvgy 2012-05-08
  • 打赏
  • 举报
回复
请问该问题最后解决了吗?
xdping520 2011-02-23
  • 打赏
  • 举报
回复
有个地方不知道你设置了没有,那就是在内核源码顶层的Makefile中要设置如下:
EXTRAVERSION=-kgdb
xdping520 2011-02-23
  • 打赏
  • 举报
回复
结果呢
jeff_tsuei 2011-01-09
  • 打赏
  • 举报
回复
可否也發給我驅動呢
Wenxy1 2010-11-16
  • 打赏
  • 举报
回复
很需要,多谢,发给我吧,我给你留言。
jxj141 2010-11-15
  • 打赏
  • 举报
回复
以前有做过,需要做个具有kgdb的串口驱动,如果需要我可以发给你。
Wenxy1 2010-11-12
  • 打赏
  • 举报
回复
kgdb相关文档:
http://www.ibm.com/developerworks/cn/linux/l-kdb/index.html
http://www.unixresources.net/linux/clf/linuxK/archive/00/00/70/85/708507.html
http://kernel.org/pub/linux/kernel/people/jwessel/kgdb/index.html
http://kgdb.linsyssoft.com/docu.htm (这里有几个pdf文件可以下载).


在VMware里通过虚拟的串口可以进行kgdb调试,我在2.6.32的内核上测试通过,参考这个blog:
http://blog.csdn.net/jie12310/archive/2009/09/18/4564853.aspx

Wenxy1 2010-11-12
  • 打赏
  • 举报
回复
系统启动日志如下:
U-Boot 2010.03 (Aug 19 2010 - 13:52:02)

modified by tekkamanninja (tekkamanninja@163.com)
Love Linux forever!!

I2C: ready
DRAM: 64 MB
Flash: 2 MB
NAND: 256 MiB
Video: 240x320x16 20kHz 62Hz
In: serial
Out: serial
Err: serial
USB slave is enable!
Net: dm9000
U-Boot 2010.03 (Aug 19 2010 - 13:52:02)
modified by tekkamanninja
(tekkamanninja@163.com)
Love Linux forever!!
Hit any key to stop autoboot: 0
[u-boot@MINI2440]# printenv
bootdelay=1
baudrate=115200
ethaddr=08:08:11:18:12:27
gatewayip=192.168.0.1
netmask=255.255.255.0
tekkaman=bmp d 70000
stdin=serial
stdout=serial
stderr=serial
ethact=dm9000
ipaddr=192.168.0.100
serverip=192.168.0.26
bootcmd=nfs 0x30008000 192.168.0.26:/home/wenxy/src/mini_2440/linux-2.6.32.2/arch/arm/boot/u-boot_zImage.img;bootm
bootargs=noinitrd root=/dev/nfs rw nfsroot=192.168.0.26:/home/wenxy/src/mini_2440/root_qtopia ip=192.168.0.100:192.168.0.26::255.255.255.0 console=ttySAC0,115200 kgdboc=ttySAC1,115200 kgdbwait init=/linuxrc mem=64M

Environment size: 548/131068 bytes
[u-boot@MINI2440]# boot
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:08:11:18:12:27
operating at 100M full duplex mode
Using dm9000 device
File transfer via NFS from server 192.168.0.26; our IP address is 192.168.0.100
Filename '/home/wenxy/src/mini_2440/linux-2.6.32.2/arch/arm/boot/u-boot_zImage.img'.
Load address: 0x30008000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
##############################################
done
Bytes transferred = 2563032 (271bd8 hex)
## Booting kernel from Legacy Image at 30008000 ...
Image Name: Linux_kernel_2.6.32.2
Created: 2010-10-19 6:32:18 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2562968 Bytes = 2.4 MB
Load Address: 30008000
Entry Point: 30008040
Verifying Checksum ... OK
XIP Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux....................................................................................................................................................................... done, booting the kernel.
Linux version 2.6.32.2-FriendlyARM (root@localhost.localdomain) (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #16 Tue Oct 19 14:31:13 CST 2010
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: FriendlyARM Mini2440 development board
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C24XX Clocks, (c) 2004 Simtec Electronics
S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: noinitrd root=/dev/nfs rw nfsroot=192.168.0.26:/home/wenxy/src/mini_2440/root_qtopia ip=192.168.0.100:192.168.0.26::255.255.255.0 console=ttySAC0,115200 kgdboc=ttySAC1,115200 kgdbwait init=/linuxrc mem=64M

/* 中间省略若干行日志 */

Try to bring eth0 interface up......NFS root ...Done

Please press Enter to activate this console.
[root@FriendlyARM /]#

4,437

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧