[Tux3] HowTo about debugging tux3 with qemu and gdb

sniper s3c24xx at gmail.com
Wed Dec 31 22:05:44 PST 2008


The following is the HowTo about debugging tux3 with qemu and gdb.
But it requires two nodes hda and hdb in /dev, I advice you to
repost the filesystem with pre-created these nodes.

cd /dev
mknode -m 644 hda b 3 0
mknode -m 644 hdb b 3 64

And it also requires commenting the following line in file /etc/inittab
#1:23:respawn:/sbin/getty 38400 tty1

HowTo about debugging tux3 with qemu and gdb:


   # Get a kernel tree:
   wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.26.5.tar.bz2
   tar -xjf linux-2.6.26.5.tar.bz2
   cd linux-2.6.26.5

   # Get the Christmas tux3 patch and patch the kernel:
   wget http://tux3.org/patches/tux3-2.6.26.5-4
   patch <tux3-2.6.26.5-4 -p1

   # Build kernel with tux3:
   make defconfig
   make CONFIG_TUX3=y CONFIG_DEBUG_INFO=y CONFIG_FRAME_POINTER=y
   sudo make

   # Get the Christmas tux3 userspace snapshot:
   wget http://tux3.org/downloads/snapshots/tux3-20081230.tar.gz
   tar -xzf tux3-20081230.tar.gz
   cd tux3/user
   make

   # make a tux3 filesystem in a file
   dd if=/dev/zero of=testdev bs=1M count=1
   tux3 mkfs testdev

1. boot for common test

  # boot qemu using loop back on the root fs and tux3 test fs
  copy tuxroot and testdev into kernel source dir, then type command:	
  cd $kernel_source_dir
  $ qemu -hda tuxroot -hdb testdev -kernel arch/i386/boot/bzImage
-append root=/dev/hda -boot c

   Log in to uml as root and:
   mount /dev/hdb /mnt
   ls -l /mnt

2. boot for debugging tux3 with qemu + gdb

  # boot qemu using the following command
  $ qemu -hda tuxroot -hdb testdev -kernel arch/i386/boot/bzImage
-append root=/dev/hda -boot c -S -s

  # create .gdbinit file in $kernel_source_dir for gdb
  echo "target remote localhost:1234" > .gdbinit
  echo "b start_kernel" >> .gdbinit
  echo "b panic" >> .gdbinit

  #open a new terminal, and run gdb under $kernel_source_dir
  gdb ./vmlinux

_______________________________________________
Tux3 mailing list
Tux3 at tux3.org
http://mailman.tux3.org/cgi-bin/mailman/listinfo/tux3



More information about the Tux3 mailing list