qemu怎么把针对powerpc板的u-boot跑起来

qemu怎么把针对powerpc板的u-boot跑起来,第1张

 使用Qemu模拟Cortex-A9运行U-boot和Linux 作者来源于网络

我的开发环境: Ubuntu-1204 所有软件包为最新

1 安装GNU工具链

sudo apt-get insatll gcc-arm-linux-gnueabi

sudo apt-get insatll g++-arm-linux-gnueabi

安装完成后会在 /usr/arm-linux-gnueabi/ 目录下生成库文件、头文件等。 我安装的GCC版本为:

arm-linux-gnueabi-gcc (Ubuntu/Linaro 463-1ubuntu5) 463

Copyright (C) 2011 Free Software Foundation, Inc

2 安装Qemu模拟器

sudo apt-get install qemu qemu-system qemu-utils

这时应该已经可以运行qemu-system-arm命令了, 其版本为:

qemu-system-arm --version

QEMU emulator version 1050 (Debian 1050-201203-0ubuntu2), Copyright (c) 2003-2008 Fabrice Bellard

3 编译和运行U-boot:

到 ftp://ftpdenxde/pub/u-boot/ 下载最新版本的U-Boot源代码, 我用的目前最新版本 u-boot-201204tarbz2

解压后进入源代码目录,在Makefile里面增加两行:

ARCH = arm

CROSS_COMPILE = arm-linux-gnueabi-

其实就是告诉它使用ARM编译器来编译。

make ca9x4_ct_vxp_config

make

这里配置目标板为 Cortex-A9x4 vexpress 之所以选这个配置可以从 boardscfg文件里看到, vexpress是ARM公司使用Cortext-A9的一个开发板,相关的代码在 board/armltd/vexpress/ 目录,配置文件为include/configs/ca9x4_ct_vxph。 而且关键的是Qemu里面已经支持这个板卡。

编译完成后会生成u-boot文件

运行:

qemu-system-arm -M vexpress-a9 -m 256M -nographic -kernel u-boot

或者

qemu-system-arm -M vexpress-a9 -m 256M -serial stdio -kernel u-boot

发现,如果没有指定-nographics, 则必须要加-serial stdio才会有打印。

参数-m 256M为指定内存大小。-M 指定板卡的名称, 支持的板卡可以用-M 查看, 如下:

#qemu-system-arm -M

Supported machines are:

beagle Beagle board (OMAP3530)

beaglexm Beagle board XM (OMAP3630)

versatilepb ARM Versatile/PB (ARM926EJ-S)

versatileab ARM Versatile/AB (ARM926EJ-S)

vexpress-a9 ARM Versatile Express for Cortex-A9

vexpress-a15 ARM Versatile Express for Cortex-A15

正常运行的结果:

qemu-system-arm -M vexpress-a9 -m 256M -nographic -kernel u-boot

U-Boot 201204 (Jul 08 2012 - 00:14:08)

DRAM: 256 MiB

WARNING: Caches not enabled

Flash: ## Unknown flash on Bank 1 - Size = 0x00000000 = 0 MB

## Unknown flash on Bank 2 - Size = 0x00000000 = 0 MB

failed

MMC: MMC: 0

Warning - bad CRC, using default environment

In: serial

Out: serial

Err: serial

Net: smc911x-0

Hit any key to stop autoboot: 0

VExpress#

VExpress# printenv

baudrate=38400

bootcmd=run bootflash;

bootdelay=2

bootflash=run flashargs; cp ${ramdisk_addr} ${ramdisk_addr_r} ${maxramdisk}; bootm ${kernel_addr} ${ramdisk_addr_r}

console=ttyAMA0,38400n8

。。。。。

注意:如果在检测Flash failed后停止运行,是因为在 arch/arm/lib/boardc里面 board_init_r()函数里检测Flash失败后调用了hang(), 暂时先把hang()去掉就可以运行下去了。

4 编译和运行Linux内核:

到>

New chat

header-icon

fontproperties=fp运行报错怎么解决

header-icon

请提供更多上下文信息,以便我们更好地理解您的问题并为您提供更准确的解决方案。

header-icon

dockerrun挂载本地目录修改文件不生效

header-icon

可能是由于您使用的是容器内的用户没有足够的权限来修改挂载的本地目录中的文件。您可以尝试使用 -u 参数指定容器内的用户,并确保该用户拥有足够的权限来修改文件。

例如:

plaintext

Copy code

docker run -u $(id -u):$(id -g) -v /path/to/local/dir:/mnt/mydir myimage

这将使用当前用户的 UID 和 GID 来运行容器,并将本地目录 /path/to/local/dir 挂载到容器内的 /mnt/mydir。

另外,请确保您在容器内使用正确的路径来访问挂载的目录。在容器内部,挂载的目录位于容器文件系统的根目录下。例如,如果您将本地目录 /path/to/local/dir 挂载到容器内的 /mnt/mydir,则在容器内部访问该目录应该使用 /mnt/mydir 而不是 /path/to/local/dir。

header-icon

armwin11怎么在x64电脑运行

header-icon

ARM Windows 11 是为 ARM 架构设计的 *** 作系统,不能在 x64 电脑上直接运行。但是,您可以使用模拟器来模拟 ARM 架构并运行 ARM Windows 11。

目前比较流行的 ARM 模拟器是 QEMU。您可以安装 QEMU 并使用它来运行 ARM Windows 11。以下是在 Windows 10 上使用 QEMU 运行 ARM Windows 11 的大致步骤:

下载 QEMU for Windows,并安装。

下载 ARM Windows 11 镜像,并解压缩。

打开命令行工具,切换到 ARM Windows 11 镜像所在目录。

运行以下命令以启动 QEMU:

plaintext

Copy code

qemu-system-arm -machine virt -cpu cortex-a57 -machine type=virt -nographic -m 2048 -drive if=none,file=arm64img,id=hd0 -device virtio-blk-device,drive=hd0 -device virtio-net-device,netdev=net0 -netdev user,id=net0,hostfwd=tcp::5555-:22 -no-reboot

该命令启动一个虚拟机,并将 ARM Windows 11 镜像文件挂载到虚拟机的硬盘上。

在启动虚拟机后,您可以使用 SSH 连接到虚拟机,并使用命令行界面来 *** 作 ARM Windows 11。

注意事项:

运行 QEMU 需要一定的系统资源,建议您在具有足够系统内存和处理器的计算机上运行。

QEMU 模拟的 ARM 系统与真实的 ARM 设备可能存在一定的差异,因此在模拟环境中运行 ARM Windows 11 可能会遇到一些问题。

在模拟环境中运行 ARM Windows 11 可能会存在性能问题,建议您仅用于测试和学习目的。

以上就是关于qemu怎么把针对powerpc板的u-boot跑起来全部的内容,包括:qemu怎么把针对powerpc板的u-boot跑起来、Qemu虚拟mini2440碰到的问题,求助、armwin11怎么在x64电脑运行等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zz/10141117.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-05
下一篇 2023-05-05

发表评论

登录后才能评论

评论列表(0条)

保存