目标:模拟 Qemu 特别支持的“sabrelite:飞思卡尔 i.MX6 Quad SABRE Lite Board (Cortex A9)”(执行 'qemu-system-arm -M ?' 它显示)。
Qemu 版本:2.10.1(主机:fedora-27)。
我已经成功地交叉编译并构建了一个 4.1.46 Linux 内核(使用了imx_v6_v7_defconfig配置文件)以及一个简单的“骨架”根文件系统(基于 busybox)。(仅供参考,我为 ARM Cortex-A9 Versatile Express 平台提供了类似的工作设置 - 我使用自己的名为SEALS的自制嵌入式 Linux 系统来执行此操作)。
查看类似板使用的 U-Boot 配置文件,我想使用'root=/dev/mmcblk0p0'作为内核的 root= 参数。因此,为了尝试一下,我按如下方式运行 qemu(请水平滚动查看):
qemu-system-arm -m 512 -M sabrelite -kernel zImage -drive file=rfs.img,format=raw -append "console=ttymxc0 rootfstype=ext4 root=/dev/mmcblk0p0 rw rootwait init=/sbin/init " -nographic -dtb imx6dl-sabresd.dtb
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.1.46 (kai@klaptop) (gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-29) ) #2 SMP Mon Nov 27 17:16:22 IST 2017
[ 0.000000] CPU: ARMv7 Processor [410fc090] revision 0 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[ 0.000000] Machine model: Freescale i.MX6 DualLite SABRE Smart Device Board
[ 0.000000] cma: Reserved 16 MiB at 0x2f000000
[...]
所以它开始启动就好了。但是之后:
[...]
[ 2.210965] /soc/aips-bus@02100000/usdhc@02194000: voltage-ranges unspecified
[ 2.211796] sdhci-esdhc-imx 2194000.usdhc: Got CD GPIO
[ 2.212199] sdhci-esdhc-imx 2194000.usdhc: Got WP GPIO
[ 2.214392] sdhci-esdhc-imx 2194000.usdhc: could not get ultra high speed state, work on normal mode
[ 2.218084] sdhci-esdhc-imx 2194000.usdhc: No vmmc regulator found
[ 2.218367] sdhci-esdhc-imx 2194000.usdhc: No vqmmc regulator found
[ 2.265431] mmc0: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA
[ 2.267300] mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz
[ 2.281912] /soc/aips-bus@02100000/usdhc@02198000: voltage-ranges unspecified
[ 2.282956] sdhci-esdhc-imx 2198000.usdhc: Got CD GPIO
[ 2.283703] sdhci-esdhc-imx 2198000.usdhc: Got WP GPIO
[ 2.284044] sdhci-esdhc-imx 2198000.usdhc: could not get ultra high speed state, work on normal mode
[ 2.284892] sdhci-esdhc-imx 2198000.usdhc: No vmmc regulator found
[ 2.285167] sdhci-esdhc-imx 2198000.usdhc: No vqmmc regulator found
[ 2.298029] mmc0: mmc_rescan_try_freq: trying to init card at 300000 Hz
[ 2.337904] mmc1: SDHCI controller on 2198000.usdhc [2198000.usdhc] using ADMA
[ 2.357051] /soc/aips-bus@02100000/usdhc@0219c000: voltage-ranges unspecified
[ 2.358313] sdhci-esdhc-imx 219c000.usdhc: No vmmc regulator found
[ 2.358642] sdhci-esdhc-imx 219c000.usdhc: No vqmmc regulator found
[ 2.368204] mmc0: mmc_rescan_try_freq: trying to init card at 200000 Hz
[ 2.414722] mmc2: SDHCI controller on 219c000.usdhc [219c000.usdhc] using ADMA
[ 2.440456] mmc0: mmc_rescan_try_freq: trying to init card at 100000 Hz
[...]
[ 2.986441] No soundcards found.
[ 3.007698] Waiting for root device /dev/mmcblk0p0...
在这里永远等待...
我知道,在实际的物理板上,必须“格式化”或分区 MMC(或 SD)卡,并让 u-boot 将内核和 rootfs 加载到 RAM 中。但我目前有兴趣让 IMX6 在 Qemu 上运行......所以,我的实际问题是:我怎样才能在 Qemu 上安装和运行根文件系统?任何帮助表示赞赏!TIA,