All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Michael Haberler <mail17@mah.priv.at>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] shared memory compatibility - advice sought
Date: Thu, 11 Apr 2013 08:40:20 +0200	[thread overview]
Message-ID: <51665AD4.7030503@xenomai.org> (raw)
In-Reply-To: <51660709.3010809@xenomai.org>

On 04/11/2013 02:42 AM, Gilles Chanteperdrix wrote:

> Let us talk concretely. If I assume you want to share the same piece of
> memory in all the cases (which I originally did not). You would have a
> common kernel module able to allocate a piece of memory and associate it
> with an identifier (a string, ala shm_open/sem_open, for instance).
> 
> Then an rtdm module, with an ioctl allowing to retrieve that piece of
> memory or allocate it given the id, and if called from user-space use
> rtdm_mmap_to_user to put it in the process adress-space, if called from
> kernel-space, return the memory directly. The same RTDM code can be
> compiled both for RTAI and Xenomai and covers 4 cases. And RTDM drivers
> can be called as well from kernel space as from user-space, if I
> remember correctly.
> 
> Then another linux module, with an ioctl and an mmap call allowing to
> retrieve the same piece of memory with the same ID and map it in the
> process user-space.


That is still way too complicated. The only thing you need is a plain
Linux character device driver, with an ioctl and mmap method allowing to
map so kernel memory in user-space, and a kernel-space API giving access
to the kernel memory.

The kernel API would be used in the module initialization/cleanup
routines of your kernel mode applications. The user API would be used by
the non real-time part initialization of user applications in any mode.

As a starting point, you can have a look at the "linux device drivers"
book examples.

-- 
                                                                Gilles.


  reply	other threads:[~2013-04-11  6:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10 21:24 [Xenomai] shared memory compatibility - advice sought Michael Haberler
2013-04-10 22:31 ` Gilles Chanteperdrix
2013-04-10 23:39   ` Michael Haberler
2013-04-11  0:42     ` Gilles Chanteperdrix
2013-04-11  6:40       ` Gilles Chanteperdrix [this message]
2013-04-11  7:00       ` Michael Haberler
2013-04-11  7:05         ` Gilles Chanteperdrix
2013-04-11  8:35           ` Michael Haberler
2013-04-11 19:28             ` Gilles Chanteperdrix
2013-04-16 12:59               ` Michael Haberler
2013-04-16 18:08                 ` Gilles Chanteperdrix
2013-04-16 19:53                   ` Michael Haberler

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=51665AD4.7030503@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=mail17@mah.priv.at \
    --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.