Regarding KGDB setup over serial cable
Hi All, I am making a setup for kernel debugging over Null modem serial cable , i am trying to make it work on x86 arch machine.I have a straight serial DB9 cable(Having both female ports) which i converted into NULL MODEM CABLE bye doing below rework: *Pin of port #1....goes to....Pin of port #2 2 RxD <-------------> TxD 3 3 TxD <-------------> RxD 2 5 GND <-------------> GND 5 Please check pin connections ones and let me know if i am doing wrong. I have connected NULL MODEM serial (both female port) cable between two machines via USB to serial coverter cable.I have check the connection between two machine through MINICOM and its works fine.Till this point i didnt face any issue , now lets come to the next point. * 1) Download stable kernel 3.4.9 (kernel having inbuilt KGDB support) 2) run make menuconfig command and did the below changes to enable KGDB a) CONFIG_HAVE_ARCH_KGDB=y b) CONFIG_KGDB=y c) CONFIG_KGDB_SERIAL_CONSOLE=y* *3) compiled the kernel image successfully * *4) make modules 5) make modules_install 6) make install 7) update grub Below is the grub update detail from grub.cfg file in which i have added following rule for the kernel to wait for the GDB connection establish : *kgdbwait kgdb8250=ttyUSB0,115200,kgdboc=ttyUSB0,115200* menuentry 'Ubuntu, with Linux 3.4.9' --class ubuntu --class gnu-linux --class gnu --class os { recordfail set gfxpayload=$linux_gfx_mode insmod part_msdos insmod ext2 set root='(/dev/sda,msdos1)' search --no-floppy --fs-uuid --set=root 6ef7b91e-7416-4908-97ba-bfb212081a68 linux /boot/vmlinuz-3.4.9 root=/dev/sda1 ro quiet splash vt.handoff=7 *kgdbwait kgdb8250=ttyUSB0,115200,kgdboc=ttyUSB0,115200* } Booted my machine with the above kernel but i am getting kernel panic not the below message which we expected to get waiting for gdb connection ........ Please suggest me the right procedure for make this set up work , i am very new to Linux. Thanks in advance Thanks Vivek **
On Mon, Oct 15, 2012 at 6:10 PM, Vivek Panwar <vivekpanwar2008@gmail.com> wrote:
linux /boot/vmlinuz-3.4.9 root=/dev/sda1 ro quiet splash vt.handoff=7 kgdbwait kgdb8250=ttyUSB0,115200,kgdboc=ttyUSB0,115200 }
Do you remember exactly what panic messages you saw? maybe we can get clues from there.... -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
Hi Mulyadi, Below is the kernel panic logs i am getting, for your analysis: *[0.820851] tg3 0000:02:00.0: Problem fetching invariants of chip, aborting [1.408713] EXT3 -f3 (sda1):error:could not mount because of unsupported optional features (240) [1.449074] Kernel panic - not syncing : VFS: unable to mount root fs on unknown -block(8,1) [1.449111] pid:1,comm:swapper/0 not tainted 3.4.9#2 [1.449128] call trace: [1.449142] [<ffffffff816df216>] Panic+0xb8/0x1c3 [1.449159] [<ffffffff816df35d>] ? Printk+0x3c/0x3e [1.449177] [<ffffffff81cb804a>] mount_block_root+0x1d4/0x1eb [1.449197] [<ffffffff81cb8252>] mount_root+0xe1/0xec [1.449216] [<ffffffff81130aa17>] sys_unlink+0x11/0x20 [1.449234] [<ffffffff81cb83cd>] prepare_namespace + 0x170/0x19d [1.449253] [<ffffffff81cb7d14>] kernel_init+0x1b8/0x1ca [1.449270] [<ffffffff81cb7536>] ? log level +0x31/0x31 [1.449288] [<ffffffff816ea9547>] kernel_thread_helper+0x4/0x10 [1.449307] [<ffffffff81cb7b5c>] ? start_kernel+0x338/0x338 [1.449325] [<ffffffff816ea9507>] ? gs_change+0x3/0xb [1.449385] panic occured, switching back to console * Thanks Vivek On Tue, Oct 16, 2012 at 12:26 AM, Mulyadi Santosa <mulyadi.santosa@gmail.com
wrote:
On Mon, Oct 15, 2012 at 6:10 PM, Vivek Panwar <vivekpanwar2008@gmail.com> wrote:
linux /boot/vmlinuz-3.4.9 root=/dev/sda1 ro quiet splash vt.handoff=7 kgdbwait kgdb8250=ttyUSB0,115200,kgdboc=ttyUSB0,115200 }
Do you remember exactly what panic messages you saw? maybe we can get clues from there....
-- regards,
Mulyadi Santosa Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
Hi.... On Tue, Oct 16, 2012 at 12:34 PM, Vivek Panwar <vivekpanwar2008@gmail.com> wrote:
Hi Mulyadi,
Below is the kernel panic logs i am getting, for your analysis:
[0.820851] tg3 0000:02:00.0: Problem fetching invariants of chip, aborting
[1.408713] EXT3 -f3 (sda1):error:could not mount because of unsupported optional features (240)
[1.449074] Kernel panic - not syncing : VFS: unable to mount root fs on unknown -block(8,1)
Seems like, you forgot to compile the filesystem support of your root filesystem. Try to check that...if the root fs (sda1, from what you wrote) is ext2, then check if ext2 module is made builtin or included in initrd/initramfs...and so on -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
Hi Mulyadi, I did some googling and found one clue that i have to change file system in menuconfig file for EXT4 , which support both EXT2 and EXT3 as well, so for that i have enable below features in file systems... # CONFIG_EXT2_FS=n # CONFIG_EXT3_FS=n CONFIG_EXT4_USE_FOR_EXT2 3=Y After these modifications i crossed earlier error but hit back with 2 new errors , below is the description: 1) EXT4-fs(sda2): could not mount as ext3 due to feature incompatibilities EXT4-fs(sda2): could not mount as ext2 due to feature incompatibilities udevd[1075]:error creating queue file init: udev mian process 1075 terminated with status 1 init: udev main process ended , respawing init: udevmonitor main process 1080 terminated with status 2 2) init: plymouth main process(1038) killed by SEGV signal *(This error happens ones i skip mounting process)* Can you please elaborate the procedure to update file system or correct me if i am doing wrong ? Thanks for your support Thanks, Vivek On Tue, Oct 16, 2012 at 11:20 PM, Mulyadi Santosa <mulyadi.santosa@gmail.com
wrote:
Hi....
On Tue, Oct 16, 2012 at 12:34 PM, Vivek Panwar <vivekpanwar2008@gmail.com> wrote:
Hi Mulyadi,
Below is the kernel panic logs i am getting, for your analysis:
[0.820851] tg3 0000:02:00.0: Problem fetching invariants of chip, aborting
[1.408713] EXT3 -f3 (sda1):error:could not mount because of unsupported optional features (240)
[1.449074] Kernel panic - not syncing : VFS: unable to mount root fs on unknown -block(8,1)
Seems like, you forgot to compile the filesystem support of your root filesystem.
Try to check that...if the root fs (sda1, from what you wrote) is ext2, then check if ext2 module is made builtin or included in initrd/initramfs...and so on
-- regards,
Mulyadi Santosa Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
HI Mulyadi , Please find below my */proc/mounts* and */etc/fstab* files detail: *mounts:* rootfs / rootfs rw 0 0 none /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 none /proc proc rw,nosuid,nodev,noexec,relatime 0 0 none /dev devtmpfs rw,relatime,size=1944452k,nr_inodes=486113,mode=755 0 0 none /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0 /dev/disk/by-uuid/6ef7b91e-7416-4908-97ba-bfb212081a68 / ext4 rw,relatime,errors=remount-ro,barrier=1,data=ordered 0 0 none /sys/kernel/debug debugfs rw,relatime 0 0 none /sys/kernel/security securityfs rw,relatime 0 0 none /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0 none /var/run tmpfs rw,nosuid,relatime,mode=755 0 0 none /var/lock tmpfs rw,nosuid,nodev,noexec,relatime 0 0 binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0 gvfs-fuse-daemon /home/vivekp/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0 *fstab* # /etc/fstab: static file system information. # # Use 'blkid -o value -s UUID' to print the universally unique identifier # for a device; this may be used with UUID= as a more robust way to name # devices that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc nodev,noexec,nosuid 0 0 # / was on /dev/sda1 during installation UUID=6ef7b91e-7416-4908-97ba-bfb212081a68 / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=115ae7e6-e27b-4577-9eb1-ab18ecf83877 none swap sw 0 0 Thanks Vivek On Wed, Oct 17, 2012 at 3:56 PM, Vivek Panwar <vivekpanwar2008@gmail.com>wrote:
Hi Mulyadi,
I did some googling and found one clue that i have to change file system in menuconfig file for EXT4 , which support both EXT2 and EXT3 as well, so for that i have enable below features in file systems...
# CONFIG_EXT2_FS=n # CONFIG_EXT3_FS=n
CONFIG_EXT4_USE_FOR_EXT2 3=Y
After these modifications i crossed earlier error but hit back with 2 new errors , below is the description:
1) EXT4-fs(sda2): could not mount as ext3 due to feature incompatibilities EXT4-fs(sda2): could not mount as ext2 due to feature incompatibilities udevd[1075]:error creating queue file init: udev mian process 1075 terminated with status 1 init: udev main process ended , respawing init: udevmonitor main process 1080 terminated with status 2
2) init: plymouth main process(1038) killed by SEGV signal *(This error happens ones i skip mounting process)*
Can you please elaborate the procedure to update file system or correct me if i am doing wrong ?
Thanks for your support
Thanks, Vivek
On Tue, Oct 16, 2012 at 11:20 PM, Mulyadi Santosa < mulyadi.santosa@gmail.com> wrote:
Hi....
On Tue, Oct 16, 2012 at 12:34 PM, Vivek Panwar <vivekpanwar2008@gmail.com> wrote:
Hi Mulyadi,
Below is the kernel panic logs i am getting, for your analysis:
[0.820851] tg3 0000:02:00.0: Problem fetching invariants of chip, aborting
[1.408713] EXT3 -f3 (sda1):error:could not mount because of unsupported optional features (240)
[1.449074] Kernel panic - not syncing : VFS: unable to mount root fs on unknown -block(8,1)
Seems like, you forgot to compile the filesystem support of your root filesystem.
Try to check that...if the root fs (sda1, from what you wrote) is ext2, then check if ext2 module is made builtin or included in initrd/initramfs...and so on
-- regards,
Mulyadi Santosa Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
Hi.... On Wed, Oct 17, 2012 at 5:26 PM, Vivek Panwar <vivekpanwar2008@gmail.com> wrote:
Hi Mulyadi,
I did some googling and found one clue that i have to change file system in menuconfig file for EXT4 , which support both EXT2 and EXT3 as well, so for that i have enable below features in file systems...
# CONFIG_EXT2_FS=n # CONFIG_EXT3_FS=n
hm, since your root fs is ext4, well then I guess that is safe...
CONFIG_EXT4_USE_FOR_EXT2 3=Y
not sure what this variable does. Are you sure it is safe? anyway, are you sure that the ext4 support itself is already enabled? either as built in (=Y) or module (=m). If you choose to make it as module, don't forget to rebuild the initrd/initramfs. Usually "make install" in the kernel source tree will take care of that.
After these modifications i crossed earlier error but hit back with 2 new errors , below is the description:
1) EXT4-fs(sda2): could not mount as ext3 due to feature incompatibilities EXT4-fs(sda2): could not mount as ext2 due to feature incompatibilities
not sure what to say here...but I guess that warning is normal because ext4 is not really backward compatible to ext3/2 -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
Hi Mulyadi, I resolved the file system error and now i am able to boot my machine with 3.4.9 Kernel. But still i am facing issues while setting up KGDB,below is the issues i am facing on both development and test machine: 1) Development machine (This machine have KERNEL to be debugged): i have added below arguments in grub.cfg file for KGDB to wait for remote GDB connection establishment: *kgdbwait kgdboc=ttyUSB0,115200* Again I booted my machine, and now i am able to see below message on screen but for very few seconds , after that machine starts booting normally.Can we pass some time delay till GDB debugger get connected to the test machine ?? *waiting for remote connection.........* 2) Test Machine (where GDB is running for remote debugging): I have copy *vmlinux* file to test machine and start GDB session by giving following below commands: *gdb ./vmlinux (*after running this command i m getting below logs)* * GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /home/rohit/vmlinux...done.* set debug remote 1 target remote /dev/ttyUSB0 (* please see below logs after running command)* *(gdb) target remote /dev/ttyUSB0 Remote debugging using /dev/ttyUSB0 Sending packet: $qSupported:xmlRegisters=i386;qRelocInsn+#25...Sending packet: $qSupported:xmlRegisters=i386;qRelocInsn+#25...Sending packet: $qSupported:xmlRegisters=i386;qRelocInsn+#25...Sending packet: $qSupported:xmlRegisters=i386;qRelocInsn+#25...Timed out. Timed out. Timed out. Ignoring packet error, continuing... Packet qSupported (supported-packets) is supported warning: unrecognized item "timeout" in "qSupported" response Sending packet: $Hg0#df...Sending packet: $Hg0#df...Sending packet: $Hg0#df...Sending packet: $Hg0#df...Timed out. Timed out. Timed out. Ignoring packet error, continuing... Sending packet: $?#3f...Sending packet: $?#3f...Sending packet: $?#3f...Sending packet: $?#3f...Timed out. Timed out. Timed out. Ignoring packet error, continuing... Sending packet: $Hc-1#09...Sending packet: $Hc-1#09...Sending packet: $Hc-1#09...^CQuit* *Can you please help me out in this ? Thanks for your support Thanks Vivek* * On Wed, Oct 17, 2012 at 9:36 PM, Mulyadi Santosa <mulyadi.santosa@gmail.com>wrote:
Hi....
On Wed, Oct 17, 2012 at 5:26 PM, Vivek Panwar <vivekpanwar2008@gmail.com> wrote:
Hi Mulyadi,
I did some googling and found one clue that i have to change file system
in
menuconfig file for EXT4 , which support both EXT2 and EXT3 as well, so for that i have enable below features in file systems...
# CONFIG_EXT2_FS=n # CONFIG_EXT3_FS=n
hm, since your root fs is ext4, well then I guess that is safe...
CONFIG_EXT4_USE_FOR_EXT2 3=Y
not sure what this variable does. Are you sure it is safe?
anyway, are you sure that the ext4 support itself is already enabled? either as built in (=Y) or module (=m). If you choose to make it as module, don't forget to rebuild the initrd/initramfs. Usually "make install" in the kernel source tree will take care of that.
After these modifications i crossed earlier error but hit back with 2 new errors , below is the description:
1) EXT4-fs(sda2): could not mount as ext3 due to feature incompatibilities EXT4-fs(sda2): could not mount as ext2 due to feature incompatibilities
not sure what to say here...but I guess that warning is normal because ext4 is not really backward compatible to ext3/2
-- regards,
Mulyadi Santosa Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
participants (2)
-
Mulyadi Santosa -
Vivek Panwar