All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Randy Smith <rsmith@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Questions porting existing rtai-24.1.12 app to xenomai
Date: Fri, 31 Mar 2006 22:15:53 +0200	[thread overview]
Message-ID: <442D8DF9.2050802@domain.hid> (raw)
In-Reply-To: <442D8580.9020507@domain.hid>

Randy Smith wrote:
> Hello list,
> 
> I'm confused and I hope someone can illuminate a path to enlightenment.  
> Please be gentle. :-)
> 
> I have inherited some linux 2.4.25 kernel module code for a powerpc that 
> uses rtai-24.1.12.  In my xenomai enabled kernel, I have disabled native 
> support and enabled the RTAI emulator.  This works as far as I know.  I 
> can insmod it at least but to test it, I need some user mode code and 
> that is where I am running into problems.
> 
> The kernel module runs as a periodic task and uses kernel mode shared 
> memory to communicate with the user mode application.  The user mode 
> application uses rtai_malloc to allocate the shared memory that the 
> kernel module created with rtai_kmalloc.  My application fails to link 
> since librtai.so cannot resolve the call to rtai_malloc.  What should I 
> migrate the rtai_malloc call to in order to use the rtai skin with 
> xenomai??

The thing is that the RTAI emulator provided currently covers a minimal 
set of kernel-space only RTAI services, and does not provide any 
user-space interface to these calls. The librtai.so library that would 
contain the user-space interface mimicking LXRT is actually empty, and 
basically a placeholder, waiting for someone to be motivated enough to 
extend the existing support and flesh it. (hint, hint...).

> 
> Can I not communicate kernel to user via shared memory in that skin?
> 

No, but you could use a combo with the POSIX skin which provides a 
complete shm support to create the shared segment, and make your 
kernel-based RTAI tasks tap into this memory. The user-space side would 
just need to bind to this segment using the regular Xenomai support the 
POSIX skin provides to user-space. This still would not bring you the 
LXRT support, but it would allow you to access the shared memory block 
from user-space.

I.e.

- A kernel module using the POSIX skin creates a shared memory segment 
in kernel space, and exports it as a global variable;
- A kernel module implementing your RTAI application taps into this 
segment by importing its address from the variable.
- A user-space process linking with the POSIX skin real-time services in 
user-space (libpthread_rt.so) binds itself to this segment and peeks at 
the shared memory.

Not pretty, but still a bit simpler than creating your own memory mapped 
pseudo-device.

> I get the feeling that this is an old api that xenomai doesn't support, 
> is this the case?
> 

In fact, it's just that the RTAI emulator over Xenomai currently 
provides only a small subset of the > 300 routines the original RTAI API 
exports, and solely in kernel space. The reason for that is likely that 
people porting from the RTAI API to Xeno usually switch to Xeno's native 
API directly.

> Any help would be appreciated.
> 
> Thanks,
> 
> -Randy Smith
> Software Engineer
> ImageMap, Inc.
> 
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
> 


-- 

Philippe.


      reply	other threads:[~2006-03-31 20:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-31 19:39 [Xenomai-help] Questions porting existing rtai-24.1.12 app to xenomai Randy Smith
2006-03-31 20:15 ` Philippe Gerum [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=442D8DF9.2050802@domain.hid \
    --to=rpm@xenomai.org \
    --cc=rsmith@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.