[Xenomai] porting Linux POSIX app to Xenomai

Giulio Moro g.moro at qmul.ac.uk
Tue May 8 12:28:06 CEST 2018


> 1) is it true the same POSIX-code will generate Xenomai rt-task with options below

Yes. Make sure you set the scheduler policy to SCHED_FIFO (or SCHED_RR) (e.g.: with pthread_attr_setschedpolicy())

> Does it mean: all of this (man -s2) POSIX-functions safely use from real-time points of view ?

Xenomai's libcobalt implements the POSIX functions documented here:
http://www.xenomai.org/documentation/xenomai-3/html/xeno3prm/group__cobalt__api.html
Check the documentation to see which can be safely used from a real-time context.

> 3) Xenomai task that not doing system call (calculation task , for example), not be interrupted by Linux ?

Correct, as long as it stays in primary mode (i.e.: does not do system calls to Linux), your task will run at a higher priority than Linux and therefore (assuming SCHED_FIFO), the scheduler will only interrupt it if there is another (Xenomai!) thread at higher priority that is ready to run.

> 4)  strcpy(), strcmp(), sprintf(), atoi(), sqrt(), sin() etc) can be safely use from real-time points of view ?

Yes, as long as a function does not require a system call to Linux, it is safe to use it in your real-time thread.

________________________________________
From: Xenomai <xenomai-bounces at xenomai.org> on behalf of Шевченко Тарас Григорьевич <shevchenko.taras at triolcorp.com.ua>
Sent: 08 May 2018 11:03
To: xenomai
Cc: Olej
Subject: [Xenomai] porting Linux POSIX app to Xenomai

Good day!
I ve read https://xenomai.org//2014/08/porting-a-linux-application-to-xenomai-dual-kernel/
but some details are still on
Please tell me some nuances

1) is it true the same POSIX-code will generate Xenomai rt-task with options below
CFLAGS := $(shell $(XENO_CONFIG) —skin=posix —cflags)
LDFLAGS := $(shell $(XENO_CONFIG) —skin=posix —ldflags)
and default Linux -task without options ?


3) Xenomai task that not doing system call (calculation task , for example), not be interrupted by Linux ?

4) No imlementing system call POSIX library functions (man s3 section strcpy(), strcmp(), sprintf(), atoi(), sqrt(), sin() etc) can be safely use from real-time points of view ?



_______________________________________________
Xenomai mailing list
Xenomai at xenomai.org
https://xenomai.org/mailman/listinfo/xenomai



More information about the Xenomai mailing list