Hello,
I don't understand the concepts of some semihosting paramsters, For example:
1. semihosting-cmd_line: What is this? When will this command line be execucted, and by what entity?
2. stack and heap related: semihosting-stack_base, semihosting-stack_limit, semihosting-heap_base, semihosting-heap_limit. What do the stack and the heap here refer to? Do they relate to the firmware stack and heap running on the models in any way?
It's much appreciated if you can educate me on these concepts, or point me to any resources by which I can learn them by myself.
Thanks
-Oscar
A little more info on Semihosting and FVP (or Fast Models).
Answering your specific questions:
1. This is a string that can be retrieved by a semihosting call (SYS_GET_CMDLINE) i.e. by firmware running on the model. It will never be executed. It is intended to help simulation the case where a bare metal application was started by the given command line and provides a means for run-time libraries linked into the bare metal application to supply the command line details to the application e.g. via the argc and argv arguments to the applications main(.
2. This is very similar to 1. and provides basic memory area allocation details via semihosting call SYS_HEAPINFO so that the runtime code linked to a bare metal application can setup the stack pointer and heap manager for the bare metal application. The standard semihosting docs should provide more information on how these calls should and could be used.
The introduction in the Semihosting Spec details these - and other - calls.
Some more info, in addition to Rob.1. The string given to semihosting.cmd_line will be parsed as white-space separated words, and each word will be given to the main() function as argc[0], argc[1], so on. For example, -C *.semihosting.cmd_line="foo bar baz" int main(int argc, char *argv[]) { if (argc > 3) printf("%s, %s, %s", argv[0], argv[1], argv[2]); // will display "foo, bar, baz" Some linux build can read the kernel line from semihosting.cmd_line (see an example at releases.linaro.org/.../).2. There are a couple of ways to set up stack and heap (see developer.arm.com/.../stack-pointer-initialization-and-heap-bounds). SYS_HEAPINFO, called by the default implementation of a legacy function __user_initial_stackheap given in the library module sys_stackheap.o, will get stack/heap from the values of semihosting-(stack|heap)-(base|limit). If __user_initial_stackheap is not used (recommendation) or __user_initial_stackheap is overriden without using SYS_HEAPINFO, semihosting-(stack|heap)-(base|limit) will not be used.