1
votes

I'm actually trying to emulate the linux kernel using Qemu and busybox. So far I made this kernel image: http://depositfiles.com/files/l9x9veg09 And launched Qemu using these arguments: qemu-system-x86_64 -m 256 -s -hda rootfs.img -kernel linux-2.6.34.12/arch/x86/boot/bzImage -append "root=/dev/sda \ init=/bin/sh" But once the kernel is launched I get a message saying: Kernel Panic. No init found. Try passing init= option to kernel... I though adding "init=/bin/sh" to the arguments would solve the problem but it didn't. I'm a begginer in this domain. Can someone help me with this? Thank you

2

2 Answers

2
votes

When using Busybox, you want to pass -initrd initramfs instead of init=/bin/sh to qemu. Try this

qemu-system-x86_64 -m 256 -s -hda rootfs.img -kernel linux-2.6.34.12/arch/x86/boot/bzImage -initrd initramfs -append "root=/dev/sda"
0
votes

I finally made it work by using a pre-build version of busybox which was statically linked (found on the website). The old one was dynamically linked and compiling it as a static executable was a real pain (it seems that glibc does not support static linking anymore).