利用WSL2搭建Qemu仿真Vexpress-a9开发环境

这篇具有很好参考价值的文章主要介绍了利用WSL2搭建Qemu仿真Vexpress-a9开发环境。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

开发环境搭建

利用WSL2搭建Qemu仿真Vexpress-a9开发环境
最近想熟悉下Linux开发方面的知识,由于不想安装个虚拟机,便想着利用windows自身带的linux子系统,跑qemu模拟ARM vexpress-a9开发板,过程是逐渐摸索的,参考了网上不少文章,算是做下总结吧!
本身电脑是多年前的win10 64位,性能更不上,不想安装太多软件,WSL2可以在Mircosoft Store上直接搜索ubuntu,安装即可。另外可以同时下载个Windows Terminal作为命令行终端使用。

更新软件源

国内的源更新软件更快,更新/etc/apt/sources.list文件中软件源,可以参考修改Ubuntu的源列表。

更新之后执行apt update,系统会联网查找/etc/apt/sources.list中对应的packages/source/release列表文件,下载或更新,并保存到/var/lib/apt/lists目录。

apt install下载到本地并安装,/var/lib/dpkg/available包含软件源中所有软件信息,/var/cache/apy/archivesapt install安装包的临时存放路径

uboot-tools安装

利用 dpkg -l u-boot-tools命令或 dpkg -L u-boot-tools命令查看uboot-tools是否安装,没安装的话,执行下面命令:

sudo apt install u-boot-tools

交叉编译环境安装

ABI(Application Binary Interface)for ARM Architecture 二进制应用程序接口,EABI:嵌入式ABI

apt install gcc-arm-linux-gnueabi
apt install g++-arm-linux-gnueabi # 嵌入式c++开发时需要

arm-linux-gnueabi-gcc -v # 查看版本号

arm-linux-gnueabi-gcc -o hello main.c # 编译
readelf -h hello  # 查看ELF文件格式

利用WSL2搭建Qemu仿真Vexpress-a9开发环境
利用WSL2搭建Qemu仿真Vexpress-a9开发环境

qemu安装

有两种方法可以在Linux环境下安装Qemu工具,直接安装或下载源码安装,源码安装的好处是qemu比较新,支持的开发板更多,Vexpress-a9是很老的板子了,所以选择直接安装。

sudo apt install qemu-system-arm # 只安装了arm版本的

qemu-system-arm --version # 查看版本号
qemu-img -V # 同上查看qemu版本
qemu-system-arm -M help   # 可以查看QEMU支持的ARM平台的开发板的型号

# qemu的发展导致qemu需要分几个包来安装,按需安装。
# 以mips虚拟机为例
# 1.如果需要系统级别的虚拟机,就是sudo apt-get install qemu-system-mips
# 2.如果需要进程级别的虚拟机,就是sudo apt-get install qemu-user
# 3.如果需要qemu的一些工具比如qemu-img,就是sudo apt-get install qemu-utils


# qemu退出的两种方法
# 在另一个终端中输入 killall qemu-system-arm
# 在 qemu 中 输入ctrl+a 抬起后,再输入’x’。
ps -a # 用ps指令找到qemu-system-arm的进程号,然后通过kill -9来停止虚拟机。
kill xxx

# cat kill_qemu.sh
#! /bin/sh
ps -a | grep qemu-system-arm | awk '{print $1}' | xargs sudo kill -9

# 查看缺失的库,ldd qemu-system-cskyv2

# 停止虚拟机 在Ubuntu另一个终端窗口中,通过killall指令来停止。
killall qemu-system-arm

利用WSL2搭建Qemu仿真Vexpress-a9开发环境
另外,Qemu源码编译安装可参考Qemu搭建ARM vexpress开发环境,具体主要下面几步:

  1. 安装依赖包,zlib1g-dev,libglib2.0 libglib2.0-dev,libsdl1.2-dev,libpixman-1-dev libfdt-dev
  2. 下载源码,git-qemu-project.org 或 https://download.qemu.org/
  3. 编译配置,./configure --target-list=arm-softmmu --audio-drv-list=
  4. 编译安装,make; make install

编译linux镜像和DBT文件

下载linux内核:https://www.kernel.org/,并解压,下载的版本为linux-5.10.148,解压命令如下。

// tar 解包
// tar [选项] 压缩包
tar -zxvf tmp.tar.gz -C /tmp // #解压缩与解打包".tar.gz"格式到/tmp/目录下,其他格式不要-z
-x 对tar包做解打包操作。
-f 指定要解压的 tar 包的包名。
-C 目录	指定解打包位置。
-v 显示解打包的具体过程。
-t 只查看tar包中有哪些文件或目录,不对tar包做解打包操作。

下面就是编译了,/kernel/linux-5.10.148# vim Makefile打开Makefile,添加ARCH=ARM CROSS_COMPILE=arm-linux-gnueabi-
之后编译配置内核、模块、dbt文件:

make vexpress_defconfig
make ZImage
make modules
make dtbs

# 得到编译文件:
# arch/arm/boot/zImage
# arch/arm/boot/dts/vexpress-v2p-ca9.dtb

利用WSL2搭建Qemu仿真Vexpress-a9开发环境
当然也可以不修改Makefile,类似下面的命令,编译时指定ARCH CROSS_COMPILE:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- zImage -j4

编译时可能会出现gcc找不到问题,apt install gcc安装ubuntu环境的gcc即可。
利用WSL2搭建Qemu仿真Vexpress-a9开发环境
也可能出现找不到bison/flex的情况,按照指示安装对应软件即可。
利用WSL2搭建Qemu仿真Vexpress-a9开发环境
利用WSL2搭建Qemu仿真Vexpress-a9开发环境

启动qemu仿真kernel

qemu-system-arm -M vexpress-a9 -m 128M -kernel arch/arm/boot/ZImage -dtb arch/arm/boot/dts/vexpress-v2p-ca9.dtb -nographic -append "console=ttyAMA0"

# 这里注意文件的路径,是在linux-5.10.148源码目录执行的。
# -M vexpress-a9 模拟vexpress-a9单板,你能够使用-M ?參数来获取该qemu版本号支持的全部单板
# -m 128M 单板执行物理内存128M
# -kernel arch/arm/boot/zImage 告诉qemu单板执行内核镜像路径
# -dtb arch/arm/boot/dts/vexpress-v2p-ca9.dtb  告诉qemu单板的设备树(必须加入)
# -nographic 不使用图形化界面,仅仅使用串口
# -append "console=ttyAMA0" 内核启动參数。这里告诉内核vexpress单板执行。串口设备是哪个tty。

为了使用方便,可以将qemu命令放到shell脚本中执行。

内核成功启动,运行到最后出错是因为没有挂载根文件系统。
利用WSL2搭建Qemu仿真Vexpress-a9开发环境

busybox制作根文件系统

Busybox下载,https://busybox.net/downloads/,并解压,下载的busybox版本为busybox-1.35.0。
之后配置编译项,修改Makefile,添加ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-

配置:make defconfig ; make menuconfig
编译:make
安装:make install

当然,也可以在编译时制定编译选项的方式编译:

# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig # 配置
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- # 编译
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- install # 安装

# 直接使用CONFIG_PREFIX指定安装目录:
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- CONFIG_PREFIX=/.../rootfs/ install

制作rootfs

  • 新建rootfs文件夹

    /home/# mkdir rootfs
    
    # 将busybox编译生成的_install目录下的文件全部拷贝到根文件系统目标rootfs/目录
    /home/rootfs# cp -r /mnt/e/linux/kernel/busybox-1.35.0/_install/* .
    # 也可以在指定busybox的安装目录直接安装
    # make CONFIG_PREFIX=/home/rootfs/ install
    
    # 添加glibc库
    # cp /.../busybox-1.29.3/_install/* rootfs/ -rfd
    /home/rootfs# mkdir lib
    /home/rootfs# cp -p /usr/arm-linux-gnueabi/lib/* lib
    
  • 静态创建设备文件

    # 制作节点:
    /home/rootfs/dev# mknod -m 666 tty1 c 4 1
    /home/rootfs/dev# mknod -m 666 tty2 c 4 2
    /home/rootfs/dev# mknod -m 666 tty3 c 4 3
    /home/rootfs/dev# mknod -m 666 tty4 c 4 4
    /home/rootfs/dev# mknod -m 666 console c 5 1
    /home/rootfs/dev# mknod -m 666 null c 1 3
    /home/rootfs/dev# ls
    console  null  tty1  tty2  tty3  tty4
    
    /home/rootfs# cp /mnt/e/linux/kernel/etc . -arf
    /home/rootfs# ls
    bin  dev  etc  lib  linuxrc  sbin  usr
    
    
  • 制作SD卡文件系统镜像并将rootfs烧写到SD卡

    # 生成镜像:
    /home# dd if=/dev/zero of=rootfs.ext3 bs=1M count=64
    # 格式化为ext3:共64M,注意必须大于rootfs文件夹的大小。建议用ext4,u-boot基本命令不支持ext3
    /home# mkfs.ext3 rootfs.ext3
    # 将各种文件拷贝到文件系统镜像中:命令用mount -t ext3 rootfs.ext3 /mnt/ -o loop也可以。
    /home# ls
    rootfs  rootfs.ext3  tftpboot  tmpfs
    /home# mount -t ext3 rootfs.ext3 tmpfs/ -o loop
    /home# ls tmpfs/
    lost+found
    /home# cp -r rootfs/* tmpfs/
    # 执行umount后
    /home# umount tmpfs
    
    ## 如制作的SD镜像只有32M会出出现空间不足的错误,因为rootfs文件夹有52M。
    /home# dd if=/dev/zero of=rootfs.ext3 bs=1M count=32
    32+0 records in
    32+0 records out
    33554432 bytes (34 MB, 32 MiB) copied, 0.0333199 s, 1.0 GB/s
    /home# mkfs.ext3 rootfs.ext3
    /home# ls
    rootfs  rootfs.ext3  tmpfs
    /home# mount -t ext3 rootfs.ext3 tmpfs/ -o loop
    /home# ls tmpfs/
    lost+found
    /home# cp -r rootfs/* tmpfs/
    cp: error writing 'tmpfs/lib/libc.a': No space left on device
    cp: error writing 'tmpfs/lib/libc.so': No space left on device
    cp: error writing 'tmpfs/lib/libc.so.6': No space left on device
    cp: error writing 'tmpfs/lib/libc_nonshared.a': No space left on device
    
  • 启动
    输入如下命令,启动后可以看到内核运行起来了,

    /mnt/e/linux/kernel/linux-5.10.148# qemu-system-arm -M vexpress-a9 -m 512M -kernel arch/arm/boot/ZImage -dtb arch/arm/boot/dts/vexpress-v2p-ca9.dtb -nographic -append "root=/dev/mmcblk0 rw console=ttyAMA0" -sd /home/rootfs.ext3
    
    

利用WSL2搭建Qemu仿真Vexpress-a9开发环境
其中上面进入打印的welcome to A9 vexpress board,是在制作rootfs时,加入了/etc/init.d/rcS文件,记着修改该文件的可执行权限# chmod (a+x) /etc/init.d/rcS,文件内容可以自己写,如:echo "welcome to A9 vexpress board" 。系统启动后会执行etc下的启动配置文件。

使用u-boot启动kernel

下载编译u-boot

  • 下载地址:https://ftp.denx.de/pub/u-boot/

  • 修改编译Makefile,config.mk

    /mnt/e/linux/kernel/u-boot-2022.10-rc5# vim Makefile
    # 修改CROSS_COMPILE配置如下
    CROSS_COMPILE=arm-linux-gnueabi-
    /mnt/e/linux/kernel/u-boot-2022.10-rc5# vim config.mk
    # 修改ARCH配置如下
    ARCH=arm
    
    # 当然你也可以不修改这些,make时直接指定参数,如下面这样的方式编译
    # make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- vexpress_ca9x4_defconfig
    # make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4
    
  • 配置:make vexpress

    /mnt/e/linux/kernel/u-boot-2022.10-rc5/configs# ls vexpress* -l
    -rwxrwxrwx 1 root root 1165 Sep 20 00:17 vexpress_aemv8a_juno_defconfig
    -rwxrwxrwx 1 root root  965 Sep 20 00:17 vexpress_aemv8a_semi_defconfig
    -rwxrwxrwx 1 root root  554 Sep 20 00:17 vexpress_aemv8r_defconfig
    -rwxrwxrwx 1 root root 1520 Sep 20 00:17 vexpress_ca9x4_defconfig
    /mnt/e/linux/kernel/u-boot-2022.10-rc5/configs# cd ../
    /mnt/e/linux/kernel/u-boot-2022.10-rc5# make vexpress_ca9x4_defconfig
    
  • 编译

    /mnt/e/linux/kernel/u-boot-2022.10-rc5# make -j4
    
    # 编译成功之后目录中会生成u-boot、 u-boot.bin 等文件
    
  • 测试u-boot

    /mnt/e/linux/kernel/u-boot-2022.10-rc5# qemu-system-arm -M vexpress-a9 -m 512M -kernel u-boot -nographic
    
    ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
    ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
    ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
    ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
    ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
    ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
    ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
    ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
    alsa: Could not initialize DAC
    alsa: Failed to open `default':
    alsa: Reason: No such file or directory
    ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
    ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
    ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
    ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
    ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
    ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
    ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
    ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
    alsa: Could not initialize DAC
    alsa: Failed to open `default':
    alsa: Reason: No such file or directory
    audio: Failed to create voice `lm4549.out'
    
    U-Boot 2022.10-rc5 (Dec 03 2022 - 21:15:27 +0800)
    
    DRAM:  512 MiB
    WARNING: Caches not enabled
    Core:  18 devices, 10 uclasses, devicetree: embed
    Flash: 64 MiB
    MMC:   mmci@5000: 0
    Loading Environment from Flash... *** Warning - bad CRC, using default environment
    
    In:    serial
    Out:   serial
    Err:   serial
    Net:   eth0: ethernet@3,02000000
    Hit any key to stop autoboot:  0
    MMC Device 1 not found
    no mmc device at slot 1
    Card did not respond to voltage select! : -110
    smc911x: detected LAN9118 controller
    smc911x: phy initialized
    smc911x: MAC 52:54:00:12:34:56
    BOOTP broadcast 1
    DHCP client bound to address 10.0.2.15 (5 ms)
    *** Warning: no boot file name; using '0A00020F.img'
    Using ethernet@3,02000000 device
    TFTP from server 10.0.2.2; our IP address is 10.0.2.15
    Filename '0A00020F.img'.
    smc911x: MAC 52:54:00:12:34:56
    
    TFTP error: trying to overwrite reserved memory...
    missing environment variable: pxefile_addr_r
    smc911x: detected LAN9118 controller
    smc911x: phy initialized
    smc911x: MAC 52:54:00:12:34:56
    BOOTP broadcast 1
    DHCP client bound to address 10.0.2.15 (1 ms)
    Using ethernet@3,02000000 device
    TFTP from server 10.0.2.2; our IP address is 10.0.2.15
    Filename 'boot.scr.uimg'.
    smc911x: MAC 52:54:00:12:34:56
    
    TFTP error: trying to overwrite reserved memory...
    smc911x: detected LAN9118 controller
    smc911x: phy initialized
    smc911x: MAC 52:54:00:12:34:56
    BOOTP broadcast 1
    DHCP client bound to address 10.0.2.15 (1 ms)
    Using ethernet@3,02000000 device
    TFTP from server 10.0.2.2; our IP address is 10.0.2.15
    Filename 'boot.scr.uimg'.
    Load address: 0x60100000
    Loading: *
    TFTP error: 'Access violation' (2)
    Not retrying...
    smc911x: MAC 52:54:00:12:34:56
    cp - memory copy
    
    Usage:
    cp [.b, .w, .l, .q] source target count
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    =>
    =>
    =>
    

    可以看到只是启动了u-boot, u-boot命令如?或help可以使用。

u-boot利用tftp网络引导方式启动Linux内核

常见的启动方式:NOR/NAND FLASH启动,SD卡启动,BootLoader启动。这里使用tftp方式

# 使用u-boot引导内核镜像
# 需要将内核编译为uImage格式,制定uImage的加载地址
# 编译时制定 
# make LOADADDR=0x60003000 uImage -j4

# 编译后内核目录arch/arm/boot/ 中有uImage文件

WSL2主机网络功能设置

先是按照网络上的方式操作了一遍,没法实现WSL2和Qemu网络连通,之后修改网络连接方式,可以实现qemu运行u-boot时能ping通WSL2,过程大致如下:

  1. 桥接方式
    参见文章 配置Qemu与主机的网络连接 部分,配置方式如下:

    # QEMU网络功能设置
    # 配置QEMU与主机的网络连接,采用桥接bridge的网络连接与host通信,需要主机内部tun/tap模块支持
    
    # 主机安装工具包,
    # apt install uml-utilities bridge-utils
    
    # 创建tun设备文件:/dev/net/tun
    
    # 修改/etc/network/interfaces ,如下几行,文件重启生效
    # interfaces(5) file used by ifup(8) and ifdown(8)
                auto lo
                iface lo inet loopback
                auto nes33
                auto br0
                iface br0 inet dhcp
                  bridge_ports ens33 #
    # 其中,ens33是你网口
    # 配置/etc/qemu-ifup、/etc/qemu-ifdown脚本,高版本不配置也行
    

    WSL无法使用root智能关闭,wsl -t Ubuntu关闭,依然无法实现桥接功能。这里按照网上常用的方式进行桥接,输入ifconfig,没有出现想要的 br0 ,猜测可能WSL2本来就是桥接的原因。

  2. 主机安装TFTP工具

    # 主机Host安装TFTP工具:
    1. 安装TFTP工具: apt install tftp-hpa tftpd-hpa xinetd
    2. 修改配置文件:/etc/default/tftpd-hpa
        TFTP_USENAME="tftp"
        TFTP_DIRECTORY="/home/tftpboot"
        TFTP_ADDRESS="0.0.0.0:69"
        TFTP_OPTIONS="-l -c -s"
    
    3. 创建tftp目录:mkdir /home/tftpboot; chmod 777 tftpboot
    4. 重启tftp服务器:/etc/init.d/tftpd-hpa restart
    /home# /etc/init.d/tftpd-hpa
    Usage: /etc/init.d/tftpd-hpa {start|stop|restart|force-reload|status}
    /home# /etc/init.d/tftpd-hpa restart
     * Restarting HPA's tftpd in.tftpd
    
    5. 之后将uImage, vexpress-v2p-ca9.dtb 复制到 tftpboot中。
    /home/tftpboot# cp /mnt/e/linux/kernel/linux-5.10.148/arch/arm/boot/uImage  .
    /home/tftpboot# cp /mnt/e/linux/kernel/linux-5.10.148/arch/arm/boot/dts/vexpress-v2p-ca9.dtb .
    /home/tftpboot# cp /mnt/e/linux/kernel/u-boot-2022.10-rc5/u-boot .
    
    6. 运行,如下命令,建立在br0桥接成功的基础上,无法运行加载内核,故只是安装tftp完成。
    qemu-system-arm -M vexpress-a9 -kernel u-boot -nographic -m 512M -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 -sd /home/rootfs.ext3
    
  3. 修改网络连接
    网上找到其他参考,如QEMU模拟开发板系列5——虚拟机和开发板之间的通信, 访问qemu虚拟机的五种姿势, 【qemu】qemu网络配置。
    主机网络配置及显示效果如下:

    /home# tunctl -u root -t tap0
    Set 'tap0' persistent and owned by uid 0
    /home# ifconfig tap0 172.16.16.10 promisc up
    /home# ls
    rootfs  rootfs.ext3  tftpboot  tmpfs
    /home# ifconfig
    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 172.24.100.81  netmask 255.255.240.0  broadcast 172.24.111.255
            inet6 fe80::215:5dff:fe8f:f6d2  prefixlen 64  scopeid 0x20<link>
            ether 00:15:5d:8f:f6:d2  txqueuelen 1000  (Ethernet)
            RX packets 24  bytes 4324 (4.3 KB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 12  bytes 936 (936.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
            inet 127.0.0.1  netmask 255.0.0.0
            inet6 ::1  prefixlen 128  scopeid 0x10<host>
            loop  txqueuelen 1000  (Local Loopback)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    tap0: flags=4355<UP,BROADCAST,PROMISC,MULTICAST>  mtu 1500
            inet 172.16.16.10  netmask 255.255.0.0  broadcast 172.16.255.255
            ether 96:71:8d:e9:a2:39  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    

    可以看到ifconfig后有tap0出现。

QEMU与主机的网络连接

启动u-boot,输入如下命令:

/home/tftpboot# qemu-system-arm -M vexpress-a9 -kernel u-boot -nographic -m 512M -net  tap,ifname=tap0,script=no,downscript=no -net nic,macaddr=00:16:3e:00:00:01 -sd /home/rootfs.ext4
WARNING: Image format was not specified for '/home/rootfs.ext4' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
audio: Failed to create voice `lm4549.out'


U-Boot 2022.10-rc5 (Nov 27 2022 - 21:35:46 +0800)

DRAM:  512 MiB
WARNING: Caches not enabled
Core:  18 devices, 10 uclasses, devicetree: embed
Flash: 64 MiB
MMC:   mmci@5000: 0
Loading Environment from Flash... *** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   eth0: ethernet@3,02000000
Hit any key to stop autoboot:  0
MMC Device 1 not found
no mmc device at slot 1
switch to partitions #0, OK
mmc0 is current device
** No partition table - mmc 0 **
Couldn't find partition mmc 0:1
smc911x: detected LAN9118 controller
smc911x: phy initialized
smc911x: MAC 00:16:3e:00:00:01
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
smc911x: MAC 00:16:3e:00:00:01

Abort
missing environment variable: pxefile_addr_r
cp - memory copy

Usage:
cp [.b, .w, .l, .q] source target count
Wrong Image Format for bootm command
ERROR: can't get kernel image!
=>
=> setenv ipaddr 172.16.16.20
=> setenv serverip 172.16.16.10
=> setenv netmask 255.255.240.0
=> setenv bootargs 'root=/dev/mmcblk0 console=ttyAMA0'
=> saveenv
Saving Environment to Flash... Error: start and/or end address not on sector boundary
Error: start and/or end address not on sector boundary
Failed (1)

之后再u-boot程序运行中配置ip,加载内核,如下:

=> setenv ipaddr 172.16.16.20
=> setenv serverip 172.16.16.10
=> setenv netmask 255.255.240.0
=> setenv bootargs 'root=/dev/mmcblk0 console=ttyAMA0'
=> saveenv

# 配置完上面之后,需要启动主机的tftp服务,WSL2主机上输入如下
/mnt/e/linux/kernel# service tftpd-hpa start

# 之后u-boot中加载内核镜像与设备树文件,并启动即可正常运行。
=> tftp 60003000 uImage
=> tftp 60500000 vexpress-v2p-ca9.dtb
=> bootm 60003000 - 60500000

WSL2 启动tftp服务后LOG(补全)如下,成功加载了linux内核。

=> ping 172.16.16.10
smc911x: detected LAN9118 controller
smc911x: phy initialized
smc911x: MAC 52:54:00:12:34:56
Using ethernet@3,02000000 device
smc911x: MAC 52:54:00:12:34:56
host 172.16.16.10 is alive
=> tftp 60003000 uImage
smc911x: detected LAN9118 controller
smc911x: phy initialized
smc911x: MAC 00:16:3e:00:00:01
Using ethernet@3,02000000 device
TFTP from server 172.16.16.10; our IP address is 172.16.16.20
Filename 'uImage'.
Load address: 0x60003000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #######
         4.3 MiB/s
done
Bytes transferred = 4868888 (4a4b18 hex)
smc911x: MAC 00:16:3e:00:00:01
=> tftp 60500000 vexpress-v2p-ca9.dtb
smc911x: detected LAN9118 controller
smc911x: phy initialized
smc911x: MAC 00:16:3e:00:00:01
Using ethernet@3,02000000 device
TFTP from server 172.16.16.10; our IP address is 172.16.16.20
Filename 'vexpress-v2p-ca9.dtb'.
Load address: 0x60500000
Loading: #
         1 MiB/s
done
Bytes transferred = 14171 (375b hex)
smc911x: MAC 00:16:3e:00:00:01
=> bootm 60003000 - 60500000
## Booting kernel from Legacy Image at 60003000 ...
   Image Name:   Linux-5.10.148
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4868824 Bytes = 4.6 MiB
   Load Address: 60003000
   Entry Point:  60003000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 60500000
   Booting using the fdt blob at 0x60500000
   Loading Kernel Image
   Loading Device Tree to 7fb1c000, end 7fb2275a ... OK

Starting kernel ...

ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
audio: Failed to create voice `lm4549.out'
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
audio: Failed to create voice `lm4549.out'
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
audio: Failed to create voice `lm4549.out'
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
audio: Failed to create voice `lm4549.out'
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
audio: Failed to create voice `lm4549.out'
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
audio: Failed to create voice `lm4549.out'
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
audio: Failed to create voice `lm4549.out'
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
audio: Failed to create voice `lm4549.out'
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
audio: Failed to create voice `lm4549.out'
Booting Linux on physical CPU 0x0
Linux version 5.10.148 (root@FreyLiu) (arm-linux-gnueabi-gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1 SMP Sun Nov 20 23:25:58 CST 2022
CPU: ARMv7 Processor [410fc090] revision 0 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
OF: fdt: Machine model: V2P-CA9
OF: fdt: Ignoring memory block 0x80000000 - 0x80000004
Memory policy: Data cache writeback
Reserved memory: created DMA memory pool at 0x4c000000, size 8 MiB
OF: reserved mem: initialized node vram@4c000000, compatible id shared-dma-pool
cma: Reserved 16 MiB at 0x7e800000
Zone ranges:
  Normal   [mem 0x0000000060000000-0x000000007fffffff]
Movable zone start for each node
Early memory node ranges
  node   0: [mem 0x0000000060000000-0x000000007fffffff]
Initmem setup node 0 [mem 0x0000000060000000-0x000000007fffffff]
CPU: All CPU(s) started in SVC mode.
percpu: Embedded 19 pages/cpu s46284 r8192 d23348 u77824
Built 1 zonelists, mobility grouping on.  Total pages: 130048
Kernel command line: root=/dev/mmcblk0 console=ttyAMA0
printk: log_buf_len individual max cpu contribution: 4096 bytes
printk: log_buf_len total cpu_extra contributions: 12288 bytes
printk: log_buf_len min size: 16384 bytes
printk: log_buf_len: 32768 bytes
printk: early log buf free: 14744(89%)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
mem auto-init: stack:off, heap alloc:off, heap free:off
Memory: 490836K/524288K available (8192K kernel code, 580K rwdata, 1760K rodata, 1024K init, 183K bss, 17068K reserved, 16384K cma-reserved)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
rcu: Hierarchical RCU implementation.
rcu:    RCU event tracing is enabled.
rcu:    RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
GIC CPU mask not found - kernel will fail to boot.
GIC CPU mask not found - kernel will fail to boot.
L2C: platform modifies aux control register: 0x02020000 -> 0x02420000
L2C: DT/platform modifies aux control register: 0x02020000 -> 0x02420000
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 dynamic clock gating disabled, standby mode disabled
L2C-310 cache controller enabled, 8 ways, 128 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x46420001
sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
clocksource: arm,sp804: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275 ns
smp_twd: clock not found -2
Console: colour dummy device 80x30
Calibrating local timer... 92.62MHz.
Calibrating delay loop... 663.55 BogoMIPS (lpj=3317760)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
CPU: Testing write buffer coherency: ok
CPU0: Spectre v2: using BPIALL workaround
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x60100000 - 0x60100060
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
smp: Brought up 1 node, 1 CPU
SMP: Total of 1 processors activated (663.55 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 0
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
hw-breakpoint: debug architecture 0x4 unsupported.
Serial: AMBA PL011 UART driver
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource arm,sp804
NET: Registered protocol family 2
IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
TCP: Hash tables configured (established 4096 bind 4096)
UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 5 counters available
workingset: timestamp_bits=30 max_order=17 bucket_order=0
squashfs: version 4.0 (2009/01/31) Phillip Lougher
jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
9p: Installing v9fs 9p2000 file system support
io scheduler mq-deadline registered
io scheduler kyber registered
sii902x 0-0039: supply iovcc not found, using dummy regulator
sii902x 0-0039: supply cvcc12 not found, using dummy regulator
i2c i2c-0: Added multiplexed i2c bus 2
sii902x 0-0060: supply iovcc not found, using dummy regulator
sii902x 0-0060: supply cvcc12 not found, using dummy regulator
physmap-flash 40000000.flash: physmap platform flash device: [mem 0x40000000-0x43ffffff]
40000000.flash: Found 2 x16 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000000 Chip ID 0x000000
Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
physmap-flash 40000000.flash: physmap platform flash device: [mem 0x44000000-0x47ffffff]
40000000.flash: Found 2 x16 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000000 Chip ID 0x000000
Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
Concatenating MTD devices:
(0): "40000000.flash"
(1): "40000000.flash"
into device "40000000.flash"
physmap-flash 48000000.psram: physmap platform flash device: [mem 0x48000000-0x49ffffff]
smsc911x 4e000000.ethernet eth0: MAC Address: 00:16:3e:00:00:01
isp1760 4f000000.usb: bus width: 32, oc: digital
isp1760 4f000000.usb: NXP ISP1760 USB Host Controller
isp1760 4f000000.usb: new USB bus registered, assigned bus number 1
isp1760 4f000000.usb: Scratch test failed.
isp1760 4f000000.usb: can't setup: -19
isp1760 4f000000.usb: USB bus 1 deregistered
usbcore: registered new interface driver usb-storage
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered protocol family 17
9pnet: Installing 9P2000 support
oprofile: using arm/armv7-ca9
Registering SWP/SWPB emulation handler
aaci-pl041 10004000.aaci: ARM AC'97 Interface PL041 rev0 at 0x10004000, irq 28
aaci-pl041 10004000.aaci: FIFO 512 entries
mmci-pl18x 10005000.mmci: Got CD GPIO
mmci-pl18x 10005000.mmci: Got WP GPIO
mmci-pl18x 10005000.mmci: mmc0: PL181 manf 41 rev0 at 0x10005000 irq 29,30 (pio)
10009000.uart: ttyAMA0 at MMIO 0x10009000 (irq = 33, base_baud = 0) is a PL011 rev1
mmc0: new SD card at address 4567
mmcblk0: mmc0:4567 QEMU! 64.0 MiB
input: AT Raw Set 2 keyboard as /devices/platform/bus@40000000/bus@40000000:motherboard/bus@40000000:motherboard:iofpga@7,00000000/10006000.kmi/serio0/input/input0
printk: console [ttyAMA0] enabled
1000a000.uart: ttyAMA1 at MMIO 0x1000a000 (irq = 34, base_baud = 0) is a PL011 rev1
1000b000.uart: ttyAMA2 at MMIO 0x1000b000 (irq = 35, base_baud = 0) is a PL011 rev1
1000c000.uart: ttyAMA3 at MMIO 0x1000c000 (irq = 36, base_baud = 0) is a PL011 rev1
rtc-pl031 10017000.rtc: registered as rtc0
rtc-pl031 10017000.rtc: setting system clock to 2022-12-18T10:56:07 UTC (1671360967)
drm-clcd-pl111 1001f000.clcd: assigned reserved memory node vram@4c000000
drm-clcd-pl111 1001f000.clcd: using device-specific reserved memory
drm-clcd-pl111 1001f000.clcd: core tile graphics present
drm-clcd-pl111 1001f000.clcd: this device will be deactivated
drm-clcd-pl111 1001f000.clcd: Versatile Express init failed - -19
drm-clcd-pl111 10020000.clcd: DVI muxed to daughterboard 1 (core tile) CLCD
drm-clcd-pl111 10020000.clcd: initializing Versatile Express PL111
drm-clcd-pl111 10020000.clcd: found bridge on endpoint 0
drm-clcd-pl111 10020000.clcd: Using non-panel bridge
[drm] Initialized pl111 1.0.0 20170317 for 10020000.clcd on minor 0
Console: switching to colour frame buffer device 128x48
drm-clcd-pl111 10020000.clcd: [drm] fb0: pl111drmfb frame buffer device
ALSA device list:
  #0: ARM AC'97 Interface PL041 rev0 at 0x10004000, irq 28
input: ImExPS/2 Generic Explorer Mouse as /devices/platform/bus@40000000/bus@40000000:motherboard/bus@40000000:motherboard:iofpga@7,00000000/10007000.kmi/serio1/input/input2
EXT4-fs (mmcblk0): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) readonly on device 179:0.
Freeing unused kernel memory: 1024K
Run /sbin/init as init process
random: crng init done
can't run '/etc/init.d/rcS': No such file or directory

Please press Enter to activate this console.
/ # ls
bin         lib         lost+found  usr
dev         linuxrc     sbin
/ #

还有很多问题,如还没能自动化引导的方式运行,预计只是处理下u-boot添加自动运行命令即可,先到这边吧!

参考:
使用QEMU搭建U-boot+Linux;

Qemu搭建ARM vexpress开发环境(二)----u-boot启动kernel;

使用Qemu模拟vexpress-a9搭建模拟开发板;

qemu-system-arm仿真vexpress-a9踩坑记;文章来源地址https://www.toymoban.com/news/detail-463556.html

到了这里,关于利用WSL2搭建Qemu仿真Vexpress-a9开发环境的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 基于 Docker Desktop、WSL2 搭建双系统 Docker 环境

    Docker Desktop :可以理解为是 Docker 的桌面版,或者是 Windows 系统上运行的 Docker 服务。 WSL2 :可以理解为是 Windows 上的一个工具,通过 WSL2 可以在 Windows 上运行 Linux 子系统。 通过 Docker Desktop、WSL2 方式搭建的双系统 Docker 环境,可以实现在 Windows 服务器上同时运行 Windows 和 L

    2024年02月13日
    浏览(55)
  • 【WSL】Win10 使用 WSL2 进行 Linux GPU 开发

    先安装 驱动 参考 https://docs.nvidia.com/cuda/wsl-user-guide/index.html 使用 https://www.nvidia.com/Download/index.aspx 提供的兼容 GeForce 或 NVIDIA RTX/Quadro 显卡在系统上安装 NVIDIA GeForce Game Ready 或 NVIDIA RTX Quadro Windows 11 显示驱动程序。 cmd 检测 管理员终端打开 PowerShell 参考 https://learn.microsoft.com/

    2024年01月22日
    浏览(57)
  • 基于 WSL2、 Docker Desktop搭建Windows和Linux系统 Docker 环境

    目录 介绍 环境 安装教程 开启 WSL2 服务 安装 CentOS 系统 安装 docker Desktop 其他  安装镜像 WSL 命令使用 Docker-Desktop 储存路径更改 WSL2 :可以理解为是 Windows 上的一个工具,通过 WSL2 可以在 Windows 上运行 Linux 子系统。  Docker Desktop :可以理解为是 Docker 的桌面版,或者是 W

    2024年01月20日
    浏览(56)
  • 在WSL2中安装IntelliJ IDEA开发工具

    windows安装xming 添加白名单 查看服务器ip  编辑配置文件(结合自己的安装目录)     启动Xlaunh          wsl 配置并验证 X11 是 Linux 窗口管理系统,这是随它一起提供的各种应用和工具的集合,例如 xclock、xcalc 计算器、用于剪切和粘贴的 xclipboard、用于事件测试的 xev 等。   将

    2024年02月11日
    浏览(56)
  • 【WSL/WSL2-Ubuntu】突破界限:不使用服务器在一台Windows搭建Nginx+FastDFS

    随着软件开发领域的快速发展,跨平台的开发环境变得日益重要。Windows Subsystem for Linux(WSL)和WSL 2为开发者提供了在Windows操作系统上体验Linux环境的便捷途径。本文将引导读者深入探索WSL/WSL 2,并教授如何在其中搭建Nginx和FastDFS,为开发和测试提供更加灵活、高效的工作环

    2024年02月20日
    浏览(52)
  • QEMU学习(六):SPI设备仿真及驱动开发

            SPI和I2C一样也是很常用的串行通信协议,并且框架都很类似,都分主机控制器驱动和设备驱动,主机控制器也就是SOC的SPI控制器接口,一般linux内核都自带主机控制器,我们要做的就是SPI设备驱动。 下面是QEMU自带的SPI模拟程序,位于qemuhwssiimx_spi.c,可以看到当我

    2024年01月24日
    浏览(126)
  • QEMU学习(二):LED设备仿真及驱动开发

    在仿真led之前,先来了解一下QEMU源码结构及GPIO仿真原理。 QEMU源码目录 我们只罗列出涉及的少许文件,由此可以看出,我们要仿真的设备文件都放在hw目录下,一般来说一个.c 文件会有一个.h 文件,它们的目录类似。 比如 hw/gpio/imx_gpio.c 对应的头文件为 include/hw/gpio/imx_gpio.

    2024年02月09日
    浏览(55)
  • 基于Ubuntu20.04搭建OpenHarmony v3.0.6的qemu仿真环境

    出于个人兴趣,也出于对国产操作系统的好奇,想尝试一下以LiteOS为内核的Openharmony。但过程相当不顺利,主要原因是官方文档内容组织的不敢恭维。挺好的东西,不把说明书写好,让用户怎么用?我研究的核心问题就一个:如何在基于Qemu仿真的Openharmony中输出一个hello worl

    2024年02月09日
    浏览(41)
  • 史上最全从0开始教你玩转wsl2+docker,构建自己的开发环境

    1、安装wsl 需要windows版本大于 搜索启用或关闭windows功能 把图片中红点标注的功能勾选,注意勾选hyper-v就不能使用虚拟机类软件,如vm,安卓模拟器一类,点击确定,重启电脑。 打开任务管理器 确保虚拟化已经启用,部分设备可能需要去bios设置,自行查阅下相关资料 下载

    2024年02月08日
    浏览(45)
  • QEMU学习(五):I2C设备仿真及驱动开发

            I2C 是很常用的一个串行通信接口,用于连接各种外设、传感器等器件, 本章我们来学习一下如何在QEMU里仿真I2C设备及 Linux 下开发 I2C 接口器件驱动。 下面是标准的设备添加结构,我们使用的是常见的at_24c系列设备来做I2C的通信,详细代码请看qemuhwnvrameeprom_

    2024年02月08日
    浏览(123)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包