Skip to contentSkip to conversation

Loop Variable through to user space

U-Boot André Schaller 3 participants 4 messages Feb 3, 2015 – Feb 5, 2015

lore
Share & tools
lore
#0 lore raw

Hi all,

during the execution of th MLO I create a variable, whose value I want to make accessible to user space applications in Android. How can this be achieved?

One way would be to write the contents of the variable to external memory and let it read by the user space process. However, I would need to make sure that during boot no other process is overwriting the address.

Do you know of any other ways?

Best,
Andr?

#1 lore raw

Hello Andr?,

Quoted 11 lines · Andr? Schaller

Hi all,

during the execution of th MLO I create a variable, whose value I want to make accessible to user space applications in Android. How can this be achieved?

One way would be to write the contents of the variable to external memory and let it read by the user space process. However, I would need to make sure that during boot no other process is overwriting the address.

Do you know of any other ways?

Kind of a hack, but maybe you could pass the value somehow through the kernel boot parameters? I assume that a meaningless parameter does not affect the kernel but can still be parsed from /proc/cmdline.

Quoted 2 lines

Best,
Andr?

Amicalement,

Signature · 1 line
Albert.
#2 lore raw

Hello Albert,

thanks for the information. Do you mean to pass the value using an environment variable to the boot parameter? How would I approach to set up an environment variable in the SPL? Wouldn't it increase the memory footprint such that the SPL wouldn't fit into SRAM anymore?

Best,
Andr?

Am 03.02.15 um 23:27 schrieb Albert ARIBAUD:

Quoted 25 lines

Hello Andr?,

Quoted 11 lines · Andr? Schaller

Hi all,

during the execution of th MLO I create a variable, whose value I want to make accessible to user space applications in Android. How can this be achieved?

One way would be to write the contents of the variable to external memory and let it read by the user space process. However, I would need to make sure that during boot no other process is overwriting the address.

Do you know of any other ways?

Kind of a hack, but maybe you could pass the value somehow through the kernel boot parameters? I assume that a meaningless parameter does not affect the kernel but can still be parsed from /proc/cmdline.

Quoted 2 lines

Best,
Andr?

Amicalement,

#3 lore raw
In reply to André Schaller

Hi,

Quoted 11 lines · Andr? Schaller

Hi all,

during the execution of th MLO I create a variable, whose value I want to make accessible to user space applications in Android. How can this be achieved?

One way would be to write the contents of the variable to external memory and let it read by the user space process. However, I would need to make sure that during boot no other process is overwriting the address.

Do you know of any other ways?

You could add it to the device tree in ft_board_setup() or ft_system_setup().

Regards,
Simon