如何使用QEMU来搭建ARM(ARMv7)环境

虚拟机操作系统:Ubuntu18.04

先看效果图

 一,下载Buildroot

1.下载地址:https://buildroot.org/icon-default.png?t=M85Bhttps://buildroot.org/

 2.把下载的压缩包放入虚拟机中,之后解压压缩包

tar xzf buildroot-2022.02.6.tar.gz

3.进入目录

cd buildroot-2022.02.6/

4.配置qemu_arm_vexpress_defconfig,编译

ls configs/qemu_arm_ve*
make qemu_arm_vexpress_defconfig
make

5.大概等待一个小时左右,因为要下载很多其他的东西

6.结束进入output/images,就会看到如下

 二,下载qemu

下载地址:Index of / (qemu.org)icon-default.png?t=M85Bhttps://download.qemu.org/

 根据需要自行下载

2.解压缩

tar xjf qemu-6.2.0.tar.bz2

3.进入qemu文件,创建build文件并进入

cd qemu-6.2.0/
mkdir build
cd build/

4.下载依赖包(大概就这么多)

sudo apt-get install ninja-build
sudo apt-get install autoconf
sudo apt-get install libpixman-1-dev
sudo apt-get install libpixman-1-0
sudo apt-get install libsdl1.2-dev
sudo apt-get install libtool
sudo apt-get install libglib2.0-dev

5.配置

../configure --target-list=arm-softmmu --audio-drv-list=

6.编译

make -j8

7.安装

make install

三,运行qemu

qemu-system-arm -M vexpress-a9 -m 512M -kernel /home/xxxx/buildroot-2022.02.6/output/images/zImage -dtb /home/xxxx/buildroot-2022.02.6/output/images/vexpress-v2p-ca9.dtb -nographic -append "root=/dev/mmcblk0 console=ttyAMA0" -sd /home/zhao/buildroot-2022.02.6/output/images/rootfs.ext2

注:xxxx是自己虚拟机的路径

猜你喜欢

转载自blog.csdn.net/m0_58235748/article/details/127513960