使用LOADADDR构建内核uImage [英] Building kernel uImage using LOADADDR

查看:875
本文介绍了使用LOADADDR构建内核uImage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在构建内核时,我将LOADADDR设置为"0x80008000":

While building the kernel I am giving LOADADDR as "0x80008000":

make uImage LOADADDR=0x80008000

您能帮忙了解一下此功能的用途吗?我可以更改LOADADDR,对LOADADDR的长度有任何限制吗?

Can you please help to understand what is the use of this? Can I change the LOADADDR, is there any restriction on the length of the LOADADDR?

推荐答案

(我假设您正在使用基于U-Boot和LOADADDR值的ARM.)

(I'm assuming that you're using ARM based on the mention of U-Boot and the value of LOADADDR.)

您能帮忙了解一下它的用途吗?

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

LOADADDR指定链接器将内核映像放置的地址.(对于某些体系结构(例如Blackfin)是正确的,但对于ARM则不是.

LOADADDR specifies the address where the kernel image will be located by the linker. (This is true for a few architectures (e.g. Blackfin), but not for ARM.

LOADADDR指定U-Boot定位内核映像的地址,并由 mkimage 实用程序存储在U-Boot标头中.通常,加载地址(用于放置在内存中)也是起始地址(用于执行).请注意,uImage文件通常只是带有U-Boot包装程序的(自解压,压缩)zImage文件.

LOADADDR specifies the address where the kernel image will be located by U-Boot and is stored in the U-Boot header by the mkimage utility. Typically the load address (for placement in memory) is also the start address (for execution). Note that the uImage file is typically just the (self-extracting, compressed) zImage file with the U-Boot wrapper.

我可以更改LOADADDR

Can I change the LOADADDR,

是的,但是根据(Vincent Sanders')的说法引导ARM Linux 会违反ARM约定:

Yes, but according to (Vincent Sanders') Booting ARM Linux that would be contrary to ARM convention:

  • 尽管可以将zImage放置在内存中的任何位置, 按照惯例,它是在物理RAM的基础上加 0x8000 (32K)的偏移量.这为参数块留出空间 通常放置在偏移量0x100,零页异常向量和页上 桌子.这个约定很常见.
  • Despite the ability to place zImage anywhere within memory, convention has it that it is loaded at the base of physical RAM plus an offset of 0x8000 (32K). This leaves space for the parameter block usually placed at offset 0x100, zero page exception vectors and page tables. This convention is very common.

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

(The uImage mentioned in your question is probably just a zImage with the U-Boot wrapper, so the quotation does apply.)

LOADADDR的长度是否有限制?

is there any restriction on the length of the LOADADDR?

"长度"?如果您使用的是32位处理器,则该地址的长度将为32位.

The "length"? If you're using a 32-bit processor, then the length of this address would be 32 bits.

附录

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

arch/arm/boot/Makefile only uses LOADADDR for building the uImage from the zImage.

从(罗素·金(Russel King's))引导ARM Linux 对该LOADADDR的约束是:

From (Russel King's) Booting ARM Linux the constraints on this LOADADDR are:

内核应放置在RAM的第一个128MiB中.推荐 它已加载到32MiB以上,以避免需要重新定位 在解压之前,这将使引导过程略有减少 更快.

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.

引导原始(非zImage)内核时,约束更加严格. 在这种情况下,必须以一定的偏移量将内核装入系统等于 到TEXT_OFFSET-PAGE_OFFSET.

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施加更多约束.

The expected locations for the Device Tree or ATAGs or an initramfs can add more constraints on this LOADADDR.

这篇关于使用LOADADDR构建内核uImage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆