Miosix processes: Difference between revisions
Created page with "TODO: this part needs better documenting. A complete example for running processes can be found in [https://github.com/fedetft/miosix-kernel/tree/master/templates/processes templates/processes]. To compile it, you have to change the default linker script for your board so that the size of the process pool, the memory allocator for processes is greater than zero. This needs to be done in the ''config/board'' directory for your board. For example, for an..." |
mNo edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 7: | Line 7: | ||
The linker script is usually simply called processes, and needs to be uncommented while also commenting the default linker script: | The linker script is usually simply called processes, and needs to be uncommented while also commenting the default linker script: | ||
< | <source lang=bash> | ||
## Select linker script | ## Select linker script | ||
#LINKER_SCRIPT := unikernel.ld | #LINKER_SCRIPT := unikernel.ld | ||
LINKER_SCRIPT := processes.ld | LINKER_SCRIPT := processes.ld | ||
</ | </source> | ||
TODO: explain how the Makefile for the kernel and the one for processes works, and the use of the ''-qkernelspace'' GCC option that has been added by the GCC patches as part of the [[Miosix | TODO: explain how the Makefile for the kernel and the one for processes works, and the use of the ''-qkernelspace'' GCC option that has been added by the GCC patches as part of the [[Miosix Toolchain]] to change the code generation and linking stage to either build a position independent code program where the libc links with the libsyscalls (processes), or a non-position-independent code program where kercalls remain undefined references to be resolved at the link stage when linking with the kernel's libmiosix.a. Also explain the need for the postlinking stage (''mx-postlinker'' tool) to specify the size of the RAM memory region of programs, as well as the stack size. | ||
Latest revision as of 07:33, 17 May 2026
TODO: this part needs better documenting.
A complete example for running processes can be found in templates/processes.
To compile it, you have to change the default linker script for your board so that the size of the process pool, the memory allocator for processes is greater than zero. This needs to be done in the config/board directory for your board. For example, for an RP2040 the file is config/board/rp2040_raspberry_pi_pico/Makefile.inc.
The linker script is usually simply called processes, and needs to be uncommented while also commenting the default linker script:
## Select linker script
#LINKER_SCRIPT := unikernel.ld
LINKER_SCRIPT := processes.ld
TODO: explain how the Makefile for the kernel and the one for processes works, and the use of the -qkernelspace GCC option that has been added by the GCC patches as part of the Miosix Toolchain to change the code generation and linking stage to either build a position independent code program where the libc links with the libsyscalls (processes), or a non-position-independent code program where kercalls remain undefined references to be resolved at the link stage when linking with the kernel's libmiosix.a. Also explain the need for the postlinking stage (mx-postlinker tool) to specify the size of the RAM memory region of programs, as well as the stack size.