Hi radhika.somaiya@volansystech.com,
Thanks for the quick response.
When u-boot starts kernel code by bootm for example, it will pass the start address and end address of the command line string, and kernel takes it from there.
As per Kernel requirements, U-Boot uses 4 registers X0(FDT), X1(res), X2(res), and X3(res) to pass arguments. It would be of great help if you can brief about how the start and end addresses are passed to the kernel.
Yes. U-Boot has it's predefined addresses from where the kernel gets the information about boot arguments. You can check the address in u-Boot source code - <uboot_src>/git/include/configs/<your_board.h>
The MACRO will be named as "CONFIG_ENV_OFFSET"
I thought so and to verify it, I opened the boot prompt and entered the following commands.
u-boot=>setenv bootargs root=/dev/mmcblk0p1
u-boot=>run bootargs
Used the following to read from MMC
u-boot=> mmc read <ram address> <Sector of CONFIG_ENV_OFFSET> <CONFIG_ENV_SIZE/512>
u-boot=>md.b <ram address> <CONFIG_ENV_SIZE>
I expected the bootargs to be saved in the memory I read, but it was not the case unless I do
u-boot=> saveenv
Usually, the kernel can be booted without calling saveenv and I wild guess bootargs are copied into RAM and passed.
Thanks.
Regards,
Bharat Kumar Bacha.