顯示具有 qemu 標籤的文章。 顯示所有文章
顯示具有 qemu 標籤的文章。 顯示所有文章

2014年7月12日 星期六

How to build x86_64 image for qemu using buildroot

Download buildroot and change into buldroot folder. And then type below command.
make qemu_x86_64_defconfig
make -j8
qemu-system-x86_64 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2 -append root=/dev/sda -vga std

Enjoy it.

2014年1月4日 星期六

x86 qemu 使用方式

讓 qemu 指執行 kenel
sudo qemu-system-x86_64 -kernel /boot/vmlinuz-3.8.0-19-generic -m 256
這段指令執行到最後會發生 kernel panic 。因為找不到 root
sudo qemu-system-x86_64 -kernel /boot/vmlinuz-3.8.0-19-generic -initrd /boot/initrd.img-3.8.0-19-generic -append "root=/ram/" -m 256
上面這個指令複雜一些,kenel 會讀取 initrd (用來讀取其他檔案系統的玩意,細節) 。他會執行這個執行檔在 initrd 裡的 /init 這個執行檔,最後會失敗。進入 terminal 模式。你可以打 cat /init 看他做了什麼。


2014年1月1日 星期三

在 qemu 底下模擬 Raspberry Pi


1. 安裝 qemu-system-arm

2. 下載 http://xecdesign.com/downloads/linux-qemu/kernel-qemu

3. 執行下面程式碼

qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -hda 2013-09-25-wheezy-raspbian.img

重點就那個 kernel image 和 qemu 的參數,詳情請看參考連結。

參考連結:
http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/