// arm32 Image 被加载到的物理地址的 计算
arm/Makefile
140 # Text offset. This list is sorted numerically by address in order to
141 # provide a means to avoid/resolve conflicts in multi-arch kernels.142 # Note: the 32kB below this value is reserved for use by the kernel
143 # during boot, and this offset is critical to the functioning of
144 # kexec-tools.
编译 arch/arm/boot/compressed/head.S 时 编译选项为 :-DTEXT_OFFSET=0x00208000//
arch/arm/boot/compressed/head.S
283 mov r0, pc // r0 : 0x4001xxxx 284 and r0, r0, #0xf8000000// r0 : 0x40000000...315/* Determine final kernel image address. */316 add r4, r0, #TEXT_OFFSET // r4 : 0x40208000
那么 qemu virt 平台 怎么才能 用 -kernel 将 Image 加载到 0x40208000,而不是 0x40010000?
用 gdb 的命令 // 可以,TODO
用 qemu 的命令行 // 不可以
改 qemu 源码
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index dc62918..566b5c2 100644--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -23,7+23,7 @@
* They have different preferred image load offsets from system RAM base.*/#defineKERNEL_ARGS_ADDR0x100-#define KERNEL_LOAD_ADDR 0x00010000+#define KERNEL_LOAD_ADDR 0x000208000#defineKERNEL64_LOAD_ADDR0x00080000typedefenum{