本文及后续通过interface调用来trace Zircon启动流程,而不是局限在某个具体部分讲解。
image.ld
ENTRY(IMAGE_ELF_ENTRY)
kernel/arch/arm64/start.S:323:IMAGE_ELF_ENTRY = _start
kernel/arch/x86/start.S:241:IMAGE_ELF_ENTRY = _start
.text
FUNCTION(_start)
/* Save the Boot info for the primary CPU only */
mrs cpuid, mpidr_el1
ubfx cpuid, cpuid, #0, #15 /* mask Aff0 and Aff1 fields */
cbnz cpuid, .Lno_save_bootinfo
/* save x0 in zbi_paddr */
adrp tmp, zbi_paddr
。。。
// Choose a good (ideally random) stack-guard value as early as possible.
bl choose_stack_guard
mrs tmp, tpidr_el1
str x0, [tmp, #ZX_TLS_STACK_GUARD_OFFSET]
// Don't leak the value to oth