Skip to contentSkip to conversation

hw/arm_boot.c: move initrd load address up to accommodate large kernels

PATCH Applied Peter Maydell 2 participants 2 messages Apr 19, 2011 – Apr 20, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/arm_boot.c: move initrd load address up to accommodate large kernels

Newer kernels are large enough that they can overlap the address where qemu places the initrd. Move the initrd up so that there is enough space for the kernel again.

Unfortunately it's not possible to automatically determine the size of the kernel if it is compressed, so this is the best we can do.

---
I think a variant of this patch was posted some time last year but didn't attract any comment. Anyway, bumping up the arbitrary initrd load address is a bit ugly but does at least let large kernels boot, and corresponds to what you'd do on real hardware (ie change the load address in your u-boot script)...

If anybody has a better solution then I'm happy to implement it; otherwise I think this patch should be committed.

 hw/arm_boot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/arm_boot.c +1 -1
index 41e99d1..bfac982 100644
@@ -15,7 +15,7 @@
 
 #define KERNEL_ARGS_ADDR 0x100
 #define KERNEL_LOAD_ADDR 0x00010000
-#define INITRD_LOAD_ADDR 0x00800000
+#define INITRD_LOAD_ADDR 0x00d00000
 
 /* The worlds second smallest bootloader.  Set r0-r2, then jump to kernel.  */
 static uint32_t bootloader[] = {
Signature · 1 line
1.7.1
#1 lore raw
Quoted 16 lines · Peter Maydell

Newer kernels are large enough that they can overlap the address where qemu places the initrd. Move the initrd up so that there is enough space for the kernel again.

Unfortunately it's not possible to automatically determine the size of the kernel if it is compressed, so this is the best we can do.

---
I think a variant of this patch was posted some time last year but didn't attract any comment. Anyway, bumping up the arbitrary initrd load address is a bit ugly but does at least let large kernels boot, and corresponds to what you'd do on real hardware (ie change the load address in your u-boot script)...

Quoted 5 lines

If anybody has a better solution then I'm happy to implement it; otherwise I think this patch should be committed.

 hw/arm_boot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Thanks, applied.

Quoted 18 lines
hw/arm_boot.c +1 -1
index 41e99d1..bfac982 100644
@@ -15,7 +15,7 @@
 
 #define KERNEL_ARGS_ADDR 0x100
 #define KERNEL_LOAD_ADDR 0x00010000
-#define INITRD_LOAD_ADDR 0x00800000
+#define INITRD_LOAD_ADDR 0x00d00000
 
 /* The worlds second smallest bootloader.  Set r0-r2, then jump to kernel.  */
 static uint32_t bootloader[] = {
Signature · 1 line
1.7.1
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net