2. Running Qemu to test a new kernel

This is the command to launch Qemu with the previous kernel on a x86_64 plateform with a vnc output:

qemu-system-x86_64                                      \
  -snapshot                                             \
  -curses                                               \
  -no-kqemu                                             \
  -hda /dev/sda                                         \
  -kernel /usr/src/linux-2.6.26.5/arch/x86/boot/bzImage \
  -append "root=/dev/hda1"                              \
  -vnc www.gnuwakes.org:0

Explanation:

-snapshot
           Write to temporary files instead of disk image files. In this case,
           the raw disk image you use is not written back.

-hda file
-hdb file
-hdc file
-hdd file
           Use file as hard disk 0, 1, 2 or 3 image.

-vnc d
           Normally, QEMU uses SDL to display the VGA output.  With this
           option, you can have QEMU listen on VNC display d and redirect the
           VGA display over the VNC session.

-kernel bzImage
           Use bzImage as kernel image.

-append cmdline
           Use cmdline as kernel command line
           "root=/dev/hda1" ==> /dev/sda1 (if physical disk is SATA)

-initrd file
           Use file as initial ram disk.
          

To launch Qemu on an x86 compatible architecture without kqemu, on a physical disk image with the newly compiled kernel:

qemu                                                    \
  -no-kqemu                                             \
  -hda /dev/sda                                         \
  -kernel /usr/src/linux-2.6.26.5/arch/x86/boot/bzImage \
  -append "root=/dev/hda1"
          

Pay attention to the file /etc/fstab when trying to boot on a physical partition. The root device with Qemu is always an hda device (ie /dev/hda1), but on your machine it can be something else, like /dev/sda1. Example of /etc/fstab when booting your physical machine:

# cat /etc/fstab
/dev/sda1     /        ext3    errors=remount-ro    0    1
proc          /proc    proc    defaults             0    0
sysfs         /sys     sysfs   defaults             0    0
          

When booting with Qemu, it must seem like this:

# cat /etc/fstab
/dev/hda1     /        ext3    errors=remount-ro    0    1
proc          /proc    proc    defaults             0    0
sysfs         /sys     sysfs   defaults             0    0