HOST: vmware Ubuntu 9.04
Target: ARM versatile PB board
CROSS_COMPILE: arm-2007q1
Linux kernel: 2.6.24 with arm2 patch from ARM
Prepare HOST ttyS0
- Configure VMWare to have serial port connect to PHY COM1
- Open minicom to set 115200, no flow control
Get kgdb from
http://kgdb.cvs.sourceforge.net/viewvc/kgdb/kgdb-2/?pathrev=linux2_6_24_uprev
checkout the code:
>cvs -d:pserver:anonymous@kgdb.cvs.sourceforge.net:/cvsroot/kgdb login
>cvs -z3 -d:pserver:anonymous@kgdb.cvs.sourceforge.net:/cvsroot/kgdb co -P kgdb-2
>cd kgdb-2
>cvs up -r linux2_6_24_uprev
Put on the patch
$ tar jxf linux-<base_kernel_version>.tar.bz2
$ cd linux-<base_kernel_version>
$ for p in $(grep patch ../kgdb-2/series);do patch -p1 -si ../kgdb-2/$p;done
Note: mismatch exists, manually apply the patches
Make menuconfig
Kernel hacking --->
[*] Compile the kernel with debug info
[*] KGDB: kernel debugging with remote gdb
[*] KGDB: Console messages through gdb
Method for KGDB communication (KGDB: On ARM AMBA PL011 serial) --->
[0x101f1000] AMBA PL011 serial Port Base Address
(24000000) AMBA PL011 serial UART clock Frequency (NEW)
(12) AMBA PL011 serial port IRQ
Set bootarg
add kgdbwait to the bootargs
Boot target
target> tftp MEM uImage
target> bootm MEM
System waits at ‘booting kernel’
GDB setting at HOST
HOST> arm-none-linux-gnueabi-gdb ./vmlinux (this is from arm-2007q1 cross compiler)
…
gdb> remote target /dev/ttyS0