ubuntus使用qemu模拟器搭建arm运行环境

最后发布时间:2021-01-25 22:41:23 浏览量:

软件安装

apt-get install qemu libncurses5-dev gcc-arm-linux-gnueabi build-essential

编译

make CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm vexpress_defconfig
make CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm

结果


## 运行 qemu

qemu-system-arm -M vexpress-a9 -smp 4 -m 1024M -kernel arch/arm/boot/zImage -append "rdinit=/linuxrc console=ttyAMA0 loglevel=8"  -dtb arch/arm/boot/dts/vexpress-v2p-ca9.dtb -nographic

qemu-system-arm -M vexpress-a9 -m 512M -kernel arch/arm/boot/zImage -nographic -append "console=ttyAMA0" -dtb arch/arm/boot/dts/vexpress-v2p-ca9.dtb  -sd a9rootfs.ext3

  • -M vexpress-a9 模拟vexpress-a9单板,你能够使用-M ?參数来获取该qemu版本号支持的全部单板
  • -m 512M 单板执行物理内存512M
  • -kernel /home/ivan/kernel_git/linux/arch/arm/boot/zImage 告诉qemu单板执行内核镜像路径
  • -nographic 不使用图形化界面,仅仅使用串口
  • -append "console=ttyAMA0" 内核启动參数。这里告诉内核vexpress单板执行。串口设备是哪个tty。

拓展

qemu-system-x86_64
-smp 2
-m 1024M
-kernel ./linux-5.8.6/build/arch/x86_64/boot/bzImage
-nographic
-append “root=/dev/ram0 rw rootfstype=ext4 console=ttyS0 init=/linuxrc”
-initrd ./initramfs/initramfs-busybox-x86_64.cpio.gz \

+ 自制启动x86_64架构下的linux
https://blog.csdn.net/qq_16097611/article/details/83278712


参考:
https://www.cnblogs.com/mfmdaoyou/p/6934098.html
https://blog.csdn.net/qq_33160790/article/details/81194866