bootpimage.jpg from mkl Note
kernel-init-4-728.jpg?cb=1318556304 from https://hackmd.io/s/BJroQrL-g
  • [path to kernel]/arch/arm/boot/compressed/Makefile
LDFLAGS_vmlinux := --defsym zreladdr=$(ZRELADDR)
  • [path to kernel]/arch/arm/boot/compressed/head.S
        .word    zreladdr        @ r4
  • [path to kernel]/arch/arm/boot/compressed/misc.c

Check to see if we will overwrite ourselves.
r4 = final kernel address
r9 = size of decompressed image
r10 = end of this image, including bss/stack/malloc space if non XIP
We basically want:
(1). r4 - 16k page directory >= r10
vmlinux的起始地址大于zImage运行时所需的最大地址(r4 - 16k)
(2). r4 + image length <= address of wont_overwrite
(3). Relocate ourselves past the end of the decompressed kernel.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License