Skip to contentSkip to conversation

porting Linux POSIX app to Xenomai

Xenomai Шевченко Тарас Григорьевич 2 participants 2 messages May 8, 2018

lore
Share & tools
lore
#0 lore raw

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 ?

2) Xenomai create wrappers (include/cobalt/wrappers.h) for some system call Linux/POSIX:
Does it mean: all of this (man -s2) POSIX-functions safely use from real-time points of view ?

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 ?

#1 lore raw
Quoted 1 line

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())

Quoted 1 line

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.

Quoted 1 line

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.

Quoted 1 line

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 <[email protected]> on behalf of Шевченко Тарас Григорьевич <[email protected]>
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
[email protected]
https://xenomai.org/mailman/listinfo/xenomai