検索条件
全2件
(1/1ページ)
+------------------------+ | u-boot header(64oct.) | +------------------------+ | zImage decompress code | | .text | | (with compressed data )| | .got | | .got.plt | | .bss | +------------------------+このデータの読み込みは、u-bootによって行われるため、任意のアドレスに展開されます。
_text = .; .text : {} _etext = .; _got_start = .; .got : { *(.got) } _got_end = .; .got.plt : { *(.got.plt) } _edata = .; __bss_start = .; .bss : { *(.bss) } _end = .;
# Supply ZRELADDR to the decompressor via a linker symbol. ifneq ($(CONFIG_AUTO_ZRELADDR),y) LDFLAGS_vmlinux += --defsym zreladdr=$(ZRELADDR)ZRELADDRは、以下で定義されます。
ZRELADDR := $(zreladdr-y)右辺は、SoC依存部にて定義されています。
zreladdr-y := 0x40008000 params_phys-y := 0x40000100 initrd_phys-y := 0x40800000
start: ※cache有効, TLBはVA-PA一対一対応, restart: .align 2 .type LC0, #object LC0: .word LC0 @ r1 .word __bss_start @ r2 .word _end @ r3 .word _edata @ r6 .word input_data_end - 4 @ r10 (inflated size location) .word _got_start @ r11 .word _got_end @ ip(r12) .word .L_user_stack_end @ sp .size LC0, . - LC0 /* * We might be running at a different address. We need * to fix up various pointers. */ sub r0, r0, r1 @ calculate the delta offset add r6, r6, r0 @ _edata add r10, r10, r0 @ inflated kernel size locationLC0(DRAMの位置)から、"LC0"の配置した位置(ldscriptでは先頭0、コード配置後のLC0の位置)を差っ引いて、r0に保持する。
wont_overwrite: /* * If delta is zero, we are running at the address we were linked at. * r0 = delta * r2 = BSS start * r3 = BSS end * r4 = kernel execution address * r7 = architecture ID * r8 = atags pointer * r11 = GOT start * r12 = GOT end * sp = stack pointer */・GOT書き換え(オフセット分加算して、飛び先がrelocate先のアドレスになるように)
void decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p, unsigned long free_mem_ptr_end_p, int arch_id)展開が終わったら、cache clean、cache-offしてから、圧縮前のkernel先頭へ飛ぶ。