Professional Documents
Culture Documents
1. Verify these flags are enabled or not for kgdb by going in /boot/config-$(uname –r)
CONFIG_KGDB=y
CONFIG_KGDB_SERIAL_CONSOLE=y
CONFIG_DEBUG_INFO = y
CONFIG_FRAME_POINTER=y
2. Now download a new kernel for making the CuW drivers part of the kernel.
a. $ wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.10.1.tar.xz
b. $ tar -xvJf linux-3.10.1.tar.xz
c. $ cd linux-3.10.1
d. Now copy the folder of bnxt_en-0.1.12.tar.gz from
Z:\projects\ccx\EC\DEV\vmware\Cumulus_Latest_Drivers_Firmwares\Linux to the home
directory
e. $ tar -xzvf bnxt_en-0.1.12.tar.gz /linux-3.10.1/drivers/net/ethernet/broadcom/
f. cd /linux-3.10.1/drivers/net/ethernet/broadcom/
g. Now modify the Makefile to compile the bnxt_en drivers along with the kernel
h. $ vim Makefile add obj-y += bnxt_en-0.1.12/
i. $ vim bnxt_en-0.1.12/Makefile modify obj-m += bnxt_en.o to obj-y += bnxt_en.o
j. $ cp /boot/config-$(uname –r) ./.config
k. $ make menuconfig
l. $ make –j 20
m. $ make modules
n. $ make modules_install
o. $ make install
p. Now $ vim System.map and search for bnx to determine whether the bnxt_en are included in
kernel symbol mapping or not.
q. Copy vmlinux file and System.map file to the target system
3. Now add this lines to enable kgdb at specified serial port with specified Baudrate and to
enable kgdb wait at the boot time to the configuration file of the grub
a. vim /etc/default/grub
b. Add “kgdbwait kgdboc=ttyS1,57600” to the end of GRUB_CMDLINE_LINUX. This file
should be look like this:
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="nomodeset rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap vconsole.keymap=us crashkernel=auto
vconsole.font=latarcyrheb-sun16 rhgb quiet kgdbwait kgdboc=ttyS1,57600"
GRUB_DISABLE_RECOVERY="true"
c. Now you need to update the grub using : grub2-mkconfig -o /boot/grub2/grub.cfg
4. Now reboot the system and boot from the new compile will put the kernel in kgdwait
mode and will wait until the HOST through the serial initiate the communication and
continue it from the waiting state
1. Vmlinux and System.map file should be copied from target system to the working
directory
2. Go to the working directory
3. gdb vmlinux : This will open a gdb prompt on the terminal
This is free software: you are free to change and redistribute it.
<http://www.gnu.org/software/gdb/bugs/>...
(gdb)
4. Write these commands for setting up and debugging up the target system
breakpoint () at kernel/kgdb.c:1212
(gdb) C
Continuing.