Dev Environment?

Christophe Hauser christophe.hauser at supelec.fr
Mon Aug 15 00:44:29 EDT 2011


On Sun, Aug 14, 2011 at 03:59:04PM +0700, Mulyadi Santosa wrote:
> Hi :)
> 
> On Sun, Aug 14, 2011 at 11:51, Daniel Hilst Selli <danielhilst at gmail.com> wrote:
> > Thanks Mulyadi, I was installing gentoo with qemu.. but takes soo long to
> > install that I give up,
> > I was thinking in a minimal distro as dsl or lfs. What you suggest ?
> 
> Next time, pls keep kernelnewbies list address intact :)
> 
> About disk image, how about using prebuilt one provided in
> http://wiki.qemu.org/Download? or ones in http://fs.devloop.org.uk/ ?
> I think busybox might be a good fit for a tiny setup :)

I personally like to debootstrap a Debian and make a qcow2 image from it. You don't need the kernel to be on the image as you can directly pass a kernel to qemu with the -kernel option.

aptitude install debootstrap

#For a wheezy image :
debootstrap wheezy ./wheezy http://ftp.fr.debian.org/debian

# For a 1GB image :
dd if=/dev/zero of=fs.img bs=1M count=1000
mkfs.ext4 fs.img
mount -o loop fs.img /mnt
cp -a wheezy/* /mnt
umount /mnt

# Convert it in qcow2:
qemu-img convert fs.img -O qcow2 fs.qcow2

# Use it in qemu or kvm
qemu -hda fs.qcow2 -kernel arch/${ARCH}/boot/bzimage  -append
"${KERNEL_OPTIONS}"

If you are using vim, you can use pyclewn to control gdb from vim and
set breakpoints and stuff.
http://pyclewn.sourceforge.net/

--
Christophe




More information about the Kernelnewbies mailing list