gpt4 book ai didi

linux-kernel - 使用 LOADADDR 构建内核 uImage

转载 作者:行者123 更新时间:2023-12-04 06:17:08 25 4
gpt4 key购买 nike

在构建内核时,我将 LOADADDR 指定为“0x80008000”:

make uImage LOADADDR=0x80008000

你能帮助理解这个有什么用吗?我可以更改 LOADADDR,对 LOADADDR 的长度有什么限制吗?

最佳答案

(我假设您根据 U-Boot 的提及和 LOADADDR 的值使用 ARM。)

Can you please help to understand what is the use of this?



LOADADDR 指定链接器将定位内核镜像的地址。 (这适用于一些架构(例如 Blackfin),但不适用于 ARM。

LOADADDR 指定了 U-Boot 将要定位的内核镜像的地址,并由 存储在 U-Boot header 中。 mkimage 公用事业。通常加载地址(用于放置在内存中)也是起始地址(用于执行)。请注意,uImage 文件通常只是带有 U-Boot 包装器的(自解压、压缩)zImage 文件。

Can I change the LOADADDR,



是的,但根据(文森特桑德斯的) Booting ARM Linux这将违反 ARM 约定:
  • 尽管能够将 zImage 放置在内存中的任何位置,
    约定它是在物理 RAM 的基础上加载的,加上
    的偏移量0x8000 (32K)。这为参数块留下了空间
    通常放置在偏移量 0x100、零页异常向量和页
    表。这个约定很常见。

  • (您的问题中提到的 uImage 可能只是带有 U-Boot 包装器的 zImage,因此引用确实适用。)

    is there any restriction on the length of the LOADADDR?



    长度”?如果您使用的是 32 位处理器,则此地址的长度将为 32 位。

    附录

    arch/arm/boot/Makefile 仅使用 LOADADDR 从 zImage 构建 uImage。

    来自 (Russel King's) Booting ARM Linux此 LOADADDR 的约束是:

    The kernel should be placed in the first 128MiB of RAM. It is recommended that it is loaded above 32MiB in order to avoid the need to relocate prior to decompression, which will make the boot process slightly faster.

    When booting a raw (non-zImage) kernel the constraints are tighter. In this case the kernel must be loaded at an offset into system equal to TEXT_OFFSET - PAGE_OFFSET.



    设备树或 ATAG 或 initramfs 的预期位置可以在此 LOADADDR 上添加更多约束。

    关于linux-kernel - 使用 LOADADDR 构建内核 uImage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31725605/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com