新闻| 论坛| 博客| 在线研讨会
qemu 命令一个imx6例子
电子禅石| 2020-02-18 09:43:11 阅读:9519 发布文章

#!/bin/bash workdir=$(dirname $0); if [ -z $1 ]; then $workdir/qemu/bin/qemu-system-arm -M mcimx6ul-evk -show-cursor -m 512M -kernel $workdir/imx6ull-system-image/zImage \ -dtb $workdir/imx6ull-system-image/100ask_imx6ull_qemu.dtb \ -display sdl -serial mon:stdio \ -drive file=$workdir/imx6ull-system-image/rootfs.img,format=raw,id=mysdcard -device sd-card,drive=mysdcard \ -append "console=ttymxc0,115200 rootfstype=ext4 root=/dev/mmcblk1 rw rootwait init=/sbin/init loglevel=8" \ -nic user -com 100ask else $workdir/qemu/bin/qemu-system-arm -M mcimx6ul-evk -show-cursor -m 512M -kernel $workdir/imx6ull-system-image/zImage \ -dtb $workdir/imx6ull-system-image/100ask_imx6ull_qemu.dtb \ -display sdl -serial mon:stdio \ -drive file=$workdir/imx6ull-system-image/rootfs.img,format=raw,id=mysdcard -device sd-card,drive=mysdcard \ -append "console=ttymxc0,115200 rootfstype=ext4 root=/dev/mmcblk1 rw rootwait init=/sbin/init loglevel=8" \ -nic user -com $1 fi

-append 是传的内核命令行参数。


-M mcimx6ul-evk 指定需要模拟的单板型号。 -m 512M 指定板子的内存大小。 -kernel zImage 指定使用的内核镜像文件。 -dtb 100ask_imx6ull_qemu.dtb 指定使用的设备树文件。 -display sdl 指定使用那种图形显示输出。 -serial mon:stdio 指定串口信息输出。 -drive file=rootfs.img,format=raw,id=mysdcard名为mysdcard的drive,源为rootfs.img -device sd-card,drive=mysdcard 添加一个sd-card设备,内容来自名为mysdcard的drive -append “console=ttymxc0,115200 rootfstype=ext4 root=/dev/mmcblk1 rw rootwaitinit=/sbin/init loglevel=8” 指定内核的命令行参数 -nic user 指定网卡为user mode
  • 有了内核zImage、设备树、文件系统(rootfs.img),这就是一个完整的Linux系统。

  • 注意:QEMU中没有实现bootloader,以后我们会完全模拟SD卡,在SD卡上面放置u-boot、内核、设备树、文件系统。


*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。

参与讨论
登录后参与讨论
属于自己的技术积累分享,成为嵌入式系统研发高手。
最近文章
签名类型
2024-04-29 16:28:59
cat 文件名
2024-04-29 15:05:34
推荐文章
最近访客