Load and Entry Adress of Kernel and Uboot

Viewed 77

how the second stage bootloader knows which address it should load the uBoot and how uBoot knows where to load Kernel.

1- Do we give these address information through config files or device tree?

2- How do we find these addresses? Thank you

1 Answers

So, when the hardware loads U-Boot, the address is SoC specific, and documented by that SoC in their manuals. U-Boot will be configured at build time to know this location and be linked there. Typically this is a two stage process with "U-Boot SPL" being loaded first and "U-Boot" proper being loaded by SPL. Similar logic is used here to know a valid starting location to run at. For the kernel and related portions, this is documented at https://u-boot.readthedocs.io/en/latest/usage/environment.html#image-locations for the common case and needs to take in to account both SoC specific things such as where DDR is mappped in address space as well as the typical constraints of the OS image in terms of size and alignment.

Related