Hi Fabrizio,
Our port of muslc to seL4 is very minimal and does not implement errno - when it's accessed by a thread that thread will fault. If you are in debug mode and that thread does not have a fault handler, you'll see a double fault, where seL4 will print out the
details of the fault. The kernel itself is still running, but just the idle thread.
With respect to setting up malloc, you can take a look at the sel4bench project, which bootstraps an allocator for the initial process here:
https://github.com/seL4/sel4bench/blob/5.2.x-compatible/apps/sel4bench/src/main.c#L301
and sets up allocators in other processes (the benchmark apps) here: https://github.com/seL4/sel4bench/blob/5.2.x-compatible/libsel4benchsupport/src/support.c#L373
The manifest for sel4bench can be found here: https://github.com/seL4/sel4bench-manifest/blob/master/5.2.x.xml
Note that both of these approaches are using a static malloc - where malloc is allocating memory from a fixed size array configured with CONFIG_LIB_SEL4_MUSLC_SYS_MORECORE_BYTES. It is possible to set up a dynamic pool backed by a virtual memory by setting
this to value to 0.
We don't have an implementation that supports errno. You could map a page at the address muslc expects errno to be, or set up a fault handler for your thread that maps pages in.
I hope this addresses some of your questions!
Anna.