thx
2012-04-17, 12:34 PM
本文最終修定以 ARM Simulator on x86 with Qemu - OSSLab::開放軟體實驗室(Open Source Software Lab) (http://www.osslab.com.tw/Hardware/Open_Embedded_System/ARM_Simulator_on_x86_with_Qemu) 為主
ARM Simulator on x86 with Qemu
為了方便開發 ARM 硬體的應用程式,透過 Qemu 可以在 x86 機器上建立一個 ARM Simulator,開發者要測試軟體或做ARM 編譯,可以使用這環境。
應用環境如下:
1.一般ARM 網路設備,Embedded system 編譯或測試
2.Ubuntu for Arm device (如Android) 等測試
安裝 Qemu
系統環境:
Ubuntu 10.04
Qemu 1.0.1
cd /usr/src
wget http://wiki.qemu.org/download/qemu-1.0.1.tar.gz
tar xzf qemu-1.0.1.tar.gz
cd qemu-1.0.1
./configure
make
sudo make install
測試 Qemu
必須有視窗環境執行以下指令
wget http://wiki.qemu.org/download/arm-test-0.2.tar.gz
tar xzf arm-test-0.2.tar.gz
qemu-system-arm -kernel arm-test/zImage.integrator -initrd arm-test/arm_root.img
http://www.osslab.com.tw/@api/deki/files/2930/=qemu_arm-test.png
然後在在x86 模擬環境下測試ARM Ubuntu
建立工作目錄
mkdir arm_ubuntu-lucid
cd arm_ubuntu-lucid
安裝必要套件及下載 rootstock
sudo apt-get install debootstrap fakeroot bzr
bzr branch lp:project-rootstock
bzr 這行指令會上網下載 rootstock 相關檔案,故須保持外網暢通。
rootstock 可以自動建立一個 rootfs 的 tarball 檔,詳見此連結。
下載 Lucid 的 vmlinuz 檔
wget http://ports.ubuntu.com/ubuntu-ports/dists/lucid/main/installer-armel/current/images/versatile/netboot/vmlinuz
建立系統映像檔 qemu_ubuntu-lucid_arm.img
sudo project-rootstock/rootstock --fqdn ubuntu --login ubuntu --password ubuntu --notarball --imagesize 3G
mv qemu-armel-201203301652.img qemu_ubuntu-lucid_arm.img
系統建立映像檔時需要一些時間,請耐心等候。
產生的檔名會以日期來命名。
啟動模擬系統
qemu-system-arm -M versatilepb -cpu cortex-a8 -kernel vmlinuz -hda qemu_ubuntu-lucid_arm.img -m 256 -append "root=/dev/sda rootwait"
如果看到以下的畫面,就表示成功。
接著按下 ALT+F1,會出現登入提示,以 ubuntu : ubuntu 登入。
http://www.osslab.com.tw/@api/deki/files/2931/=qemu_arm-ubuntu_start.png
贊助商連結
ARM Simulator on x86 with Qemu
為了方便開發 ARM 硬體的應用程式,透過 Qemu 可以在 x86 機器上建立一個 ARM Simulator,開發者要測試軟體或做ARM 編譯,可以使用這環境。
應用環境如下:
1.一般ARM 網路設備,Embedded system 編譯或測試
2.Ubuntu for Arm device (如Android) 等測試
安裝 Qemu
系統環境:
Ubuntu 10.04
Qemu 1.0.1
cd /usr/src
wget http://wiki.qemu.org/download/qemu-1.0.1.tar.gz
tar xzf qemu-1.0.1.tar.gz
cd qemu-1.0.1
./configure
make
sudo make install
測試 Qemu
必須有視窗環境執行以下指令
wget http://wiki.qemu.org/download/arm-test-0.2.tar.gz
tar xzf arm-test-0.2.tar.gz
qemu-system-arm -kernel arm-test/zImage.integrator -initrd arm-test/arm_root.img
http://www.osslab.com.tw/@api/deki/files/2930/=qemu_arm-test.png
然後在在x86 模擬環境下測試ARM Ubuntu
建立工作目錄
mkdir arm_ubuntu-lucid
cd arm_ubuntu-lucid
安裝必要套件及下載 rootstock
sudo apt-get install debootstrap fakeroot bzr
bzr branch lp:project-rootstock
bzr 這行指令會上網下載 rootstock 相關檔案,故須保持外網暢通。
rootstock 可以自動建立一個 rootfs 的 tarball 檔,詳見此連結。
下載 Lucid 的 vmlinuz 檔
wget http://ports.ubuntu.com/ubuntu-ports/dists/lucid/main/installer-armel/current/images/versatile/netboot/vmlinuz
建立系統映像檔 qemu_ubuntu-lucid_arm.img
sudo project-rootstock/rootstock --fqdn ubuntu --login ubuntu --password ubuntu --notarball --imagesize 3G
mv qemu-armel-201203301652.img qemu_ubuntu-lucid_arm.img
系統建立映像檔時需要一些時間,請耐心等候。
產生的檔名會以日期來命名。
啟動模擬系統
qemu-system-arm -M versatilepb -cpu cortex-a8 -kernel vmlinuz -hda qemu_ubuntu-lucid_arm.img -m 256 -append "root=/dev/sda rootwait"
如果看到以下的畫面,就表示成功。
接著按下 ALT+F1,會出現登入提示,以 ubuntu : ubuntu 登入。
http://www.osslab.com.tw/@api/deki/files/2931/=qemu_arm-ubuntu_start.png
贊助商連結