* [Xenomai-help] using the RTAI skin
@ 2010-01-21 15:59 gohlx002
2010-01-21 16:13 ` Gilles Chanteperdrix
0 siblings, 1 reply; 5+ messages in thread
From: gohlx002 @ 2010-01-21 15:59 UTC (permalink / raw)
To: xenomai
Hello all,
I'm doing some investigation on migrating my application from RTAI to
Xenomai. From the description of a Xenomai skin, it seems like I might be
able to use the RTAI skin to run my application "as is". Along this line, I
put together a small test application in RTAI that would be very
illustrative if I can get it to run in Xenomai. The first step is of course
compiling it which I haven't been able to do because of missing references
to all the RTAI functions (e.g. rt_task_init_schmod). If someone feels like
helping out, we could work through this whole process (from an RTAI app to
running on Xenomai) and turn this into another example to add to the
examples folder for future reference. Here's the application I'm trying to
compile (the Makefile I just adapted from the native examples folder and
changed the application name):
<CODE SNIP>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <rtai_lxrt.h>
int main(int argc, char *argv[])
{
RT_TASK *rttsk;
RTIME period;
int hrt = 1;
int idx, end = 0;
rt_allow_nonroot_hrt();
if (!(rttsk = rt_task_init_schmod(nam2num("RTTSK"), 2, 0, 0,
SCHED_FIFO, 0xF))) {
printf("CANNOT INIT THE TASK\n");
exit(1);
}
/*****************************************************************/
/* start the scheduler */
rt_set_oneshot_mode();
start_rt_timer(0);
/*****************************************************************/
/***********************************************************/
/* run the task */
mlockall(MCL_CURRENT | MCL_FUTURE);
printf("\nSTARTING TASK\n\n");
if (hrt) rt_make_hard_real_time();
if (hrt) {
rt_printk("\nTASK RUNNING\n\n");
}else{
printf("\nTASK RUNNING\n\n");
}
period = nano2count(1e8);
rt_task_make_periodic(rttsk, rt_get_time(), period);
for (idx = 0; idx < 10 && !end; idx++) {
if (hrt) {
rt_printk("Finished step %d\n", idx);
printf("Finished step %d\n", idx);
} else {
printf("Finished step %d\n", idx);
}
/* pause */
rt_task_wait_period();
}
rt_sleep(nano2count(1E8));
rt_make_soft_real_time();
/***********************************************************/
stop_rt_timer();
rt_task_delete(rttsk);
printf("\nTASK STOPPED\n");
return 0;
}
</CODE SNIP>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Xenomai-help] using the RTAI skin
2010-01-21 15:59 [Xenomai-help] using the RTAI skin gohlx002
@ 2010-01-21 16:13 ` Gilles Chanteperdrix
2010-01-21 17:12 ` gohlx002
0 siblings, 1 reply; 5+ messages in thread
From: Gilles Chanteperdrix @ 2010-01-21 16:13 UTC (permalink / raw)
To: gohlx002; +Cc: xenomai
gohlx002@domain.hid wrote:
> Hello all,
>
> I'm doing some investigation on migrating my application from RTAI to
> Xenomai. From the description of a Xenomai skin, it seems like I might be
> able to use the RTAI skin to run my application "as is". Along this line, I
> put together a small test application in RTAI that would be very
> illustrative if I can get it to run in Xenomai. The first step is of course
> compiling it which I haven't been able to do because of missing references
> to all the RTAI functions (e.g. rt_task_init_schmod). If someone feels like
> helping out, we could work through this whole process (from an RTAI app to
> running on Xenomai) and turn this into another example to add to the
> examples folder for future reference. Here's the application I'm trying to
> compile (the Makefile I just adapted from the native examples folder and
> changed the application name):
The RTAI skin is mostly kernel-space. User-space only supports a few
things (like shared memory). In an case, to find what is supported,
check src/skins/rtai in xenomai sources tree.
In the makefile, what is important is:
XENO_DESTDIR=/path/to/xenomai/installation/root
XENO_CONFIG=$(XENO_DESTDIR)/usr/local/bin/xeno-config)
XENO_RTAI_CPPFLAGS=$(shell DESTDIR=$(XENO_DESTDIR) $(XENO_CONFIG) --cflags)
XENO_RTAI_LDFLAGS=$(shell DESTDIR=$(XENO_DESTDIR) $(XENO_CONFIG) --ldflags) -lrtai
then add XENO_RTAI_CPPFLAGS to your program CPPFLAGS or CFLAGS, and
add XENO_RTAI_LDFLAGS to your program LDFLAGS.
--
Gilles Chanteperdrix, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-help] using the RTAI skin
2010-01-21 16:13 ` Gilles Chanteperdrix
@ 2010-01-21 17:12 ` gohlx002
2010-01-21 17:40 ` Gilles Chanteperdrix
0 siblings, 1 reply; 5+ messages in thread
From: gohlx002 @ 2010-01-21 17:12 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
On Jan 21 2010, Gilles Chanteperdrix wrote:
>gohlx002@domain.hid wrote:
>> Hello all,
>>
>> I'm doing some investigation on migrating my application from RTAI to
>> Xenomai. From the description of a Xenomai skin, it seems like I might
>> be
>> able to use the RTAI skin to run my application "as is". Along this
>> line, I
>> put together a small test application in RTAI that would be very
>> illustrative if I can get it to run in Xenomai. The first step is of
>> course
>> compiling it which I haven't been able to do because of missing
>> references
>> to all the RTAI functions (e.g. rt_task_init_schmod). If someone feels
>> like
>> helping out, we could work through this whole process (from an RTAI app
>> to
>> running on Xenomai) and turn this into another example to add to the
>> examples folder for future reference. Here's the application I'm trying
>> to
>> compile (the Makefile I just adapted from the native examples folder and
>> changed the application name):
>
>The RTAI skin is mostly kernel-space. User-space only supports a few
>things (like shared memory). In an case, to find what is supported,
>check src/skins/rtai in xenomai sources tree.
>
>In the makefile, what is important is:
>
>XENO_DESTDIR=/path/to/xenomai/installation/root
>XENO_CONFIG=$(XENO_DESTDIR)/usr/local/bin/xeno-config)
>XENO_RTAI_CPPFLAGS=$(shell DESTDIR=$(XENO_DESTDIR) $(XENO_CONFIG) --cflags)
> XENO_RTAI_LDFLAGS=$(shell DESTDIR=$(XENO_DESTDIR) $(XENO_CONFIG)
> --ldflags) -lrtai
>
>then add XENO_RTAI_CPPFLAGS to your program CPPFLAGS or CFLAGS, and
>add XENO_RTAI_LDFLAGS to your program LDFLAGS.
>
>
Oh I see. This is helpful thanks Gilles. I'll give this a try and report
back on my progress.
Jesse
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-help] using the RTAI skin
2010-01-21 17:12 ` gohlx002
@ 2010-01-21 17:40 ` Gilles Chanteperdrix
2010-01-21 17:56 ` Philippe Gerum
0 siblings, 1 reply; 5+ messages in thread
From: Gilles Chanteperdrix @ 2010-01-21 17:40 UTC (permalink / raw)
To: gohlx002; +Cc: xenomai
gohlx002@domain.hid wrote:
> On Jan 21 2010, Gilles Chanteperdrix wrote:
>
>> gohlx002@domain.hid wrote:
>>> Hello all,
>>>
>>> I'm doing some investigation on migrating my application from RTAI to
>>> Xenomai. From the description of a Xenomai skin, it seems like I might
>>> be
>>> able to use the RTAI skin to run my application "as is". Along this
>>> line, I
>>> put together a small test application in RTAI that would be very
>>> illustrative if I can get it to run in Xenomai. The first step is of
>>> course
>>> compiling it which I haven't been able to do because of missing
>>> references
>>> to all the RTAI functions (e.g. rt_task_init_schmod). If someone feels
>>> like
>>> helping out, we could work through this whole process (from an RTAI app
>>> to
>>> running on Xenomai) and turn this into another example to add to the
>>> examples folder for future reference. Here's the application I'm trying
>>> to
>>> compile (the Makefile I just adapted from the native examples folder and
>>> changed the application name):
>> The RTAI skin is mostly kernel-space. User-space only supports a few
>> things (like shared memory). In an case, to find what is supported,
>> check src/skins/rtai in xenomai sources tree.
>>
>> In the makefile, what is important is:
>>
>> XENO_DESTDIR=/path/to/xenomai/installation/root
>> XENO_CONFIG=$(XENO_DESTDIR)/usr/local/bin/xeno-config)
>> XENO_RTAI_CPPFLAGS=$(shell DESTDIR=$(XENO_DESTDIR) $(XENO_CONFIG) --cflags)
>> XENO_RTAI_LDFLAGS=$(shell DESTDIR=$(XENO_DESTDIR) $(XENO_CONFIG)
>> --ldflags) -lrtai
>>
>> then add XENO_RTAI_CPPFLAGS to your program CPPFLAGS or CFLAGS, and
>> add XENO_RTAI_LDFLAGS to your program LDFLAGS.
>>
>>
>
> Oh I see. This is helpful thanks Gilles. I'll give this a try and report
> back on my progress.
Maybe what you are looking for is the native skin. It is has some
similarities with the RTAI API.
And it is documented at:
http://www.xenomai.org/documentation/xenomai-2.5/html/api/group__native.html
--
Gilles Chanteperdrix, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-help] using the RTAI skin
2010-01-21 17:40 ` Gilles Chanteperdrix
@ 2010-01-21 17:56 ` Philippe Gerum
0 siblings, 0 replies; 5+ messages in thread
From: Philippe Gerum @ 2010-01-21 17:56 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
On Thu, 2010-01-21 at 18:40 +0100, Gilles Chanteperdrix wrote:
> gohlx002@domain.hid wrote:
> > On Jan 21 2010, Gilles Chanteperdrix wrote:
> >
> >> gohlx002@domain.hid wrote:
> >>> Hello all,
> >>>
> >>> I'm doing some investigation on migrating my application from RTAI to
> >>> Xenomai. From the description of a Xenomai skin, it seems like I might
> >>> be
> >>> able to use the RTAI skin to run my application "as is". Along this
> >>> line, I
> >>> put together a small test application in RTAI that would be very
> >>> illustrative if I can get it to run in Xenomai. The first step is of
> >>> course
> >>> compiling it which I haven't been able to do because of missing
> >>> references
> >>> to all the RTAI functions (e.g. rt_task_init_schmod). If someone feels
> >>> like
> >>> helping out, we could work through this whole process (from an RTAI app
> >>> to
> >>> running on Xenomai) and turn this into another example to add to the
> >>> examples folder for future reference. Here's the application I'm trying
> >>> to
> >>> compile (the Makefile I just adapted from the native examples folder and
> >>> changed the application name):
> >> The RTAI skin is mostly kernel-space. User-space only supports a few
> >> things (like shared memory). In an case, to find what is supported,
> >> check src/skins/rtai in xenomai sources tree.
> >>
> >> In the makefile, what is important is:
> >>
> >> XENO_DESTDIR=/path/to/xenomai/installation/root
> >> XENO_CONFIG=$(XENO_DESTDIR)/usr/local/bin/xeno-config)
> >> XENO_RTAI_CPPFLAGS=$(shell DESTDIR=$(XENO_DESTDIR) $(XENO_CONFIG) --cflags)
> >> XENO_RTAI_LDFLAGS=$(shell DESTDIR=$(XENO_DESTDIR) $(XENO_CONFIG)
> >> --ldflags) -lrtai
> >>
> >> then add XENO_RTAI_CPPFLAGS to your program CPPFLAGS or CFLAGS, and
> >> add XENO_RTAI_LDFLAGS to your program LDFLAGS.
> >>
> >>
> >
> > Oh I see. This is helpful thanks Gilles. I'll give this a try and report
> > back on my progress.
>
> Maybe what you are looking for is the native skin. It is has some
> similarities with the RTAI API.
>
> And it is documented at:
> http://www.xenomai.org/documentation/xenomai-2.5/html/api/group__native.html
>
See also:
http://www.xenomai.org/documentation/branches/v2.3.x/pdf/Native-API-Tour-rev-C.pdf
p.22
--
Philippe.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-01-21 17:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-21 15:59 [Xenomai-help] using the RTAI skin gohlx002
2010-01-21 16:13 ` Gilles Chanteperdrix
2010-01-21 17:12 ` gohlx002
2010-01-21 17:40 ` Gilles Chanteperdrix
2010-01-21 17:56 ` Philippe Gerum
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.