'How to pass data from u-boot bootloader to QNX application via ram?

Using QNX 6.5.x with u-boot as a bootloader, on an ATSAMA5d3x module.

We'd like to pass some amount of data, ~1.5kb, from the bootloader into QNX via RAM, rather than trying to pass it via flash storage.

Is there a mechanism to tell QNX to reserve an area of RAM and not touch it? This would let us mmap it from the QNX application to read the data out of it, without QNX using it for heap or otherwise zeroing it out.

Is there another approach you've used to pass data like this into QNX?



Solution 1:[1]

QNX startup-* programs permit the use of the -r argument to reserve a block of phyiscal address space. You can supply arguments to startup in the .build file for the bootstrap image (the source to mkifs).

Example:

[image=0x22000000]
[virtual=armle-v7,raw +compress] .bootstrap = {
    # reserve 4k at paddr 0x20000000 and don't clear it
    startup-atsama5d3x-ek -vvv -r 0x20000000,4096,1
    # reset of boot code goes here
}
[+script] .script = {
    # and so on
}
# and so forth

Ref: http://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.utilities/topic/s/startup_options.html

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Will Miles