All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Brandt Erickson <brandt@domain.hid>
Cc: xenomai@xenomai.org, Jan Kiszka <jan.kiszka@domain.hid>
Subject: Re: [Xenomai-help] xnpod help
Date: Fri, 2 Jun 2006 14:53:02 +0200	[thread overview]
Message-ID: <17536.13486.254768.91245@domain.hid> (raw)
In-Reply-To: <47190.155.98.4.39.1149199741.squirrel@domain.hid>

Brandt Erickson wrote:
 > > Ok, things get clearer. But why a kernel module? Are you *that* short on
 > > CPU cycles?
 > 
 > The reason why I'm trying to develop a kernel-space application is not for
 > latency issues but because I need to be in kernel-space to read/write
 > to/from my DAC.

There are several way you can write an application with Xenomai:
- first, the canonical way, split your application between driver code
  and application code, implement the driver in kernel-space and the
  application in user-space. Xenomai ease your work by providing the
  RTDM skin for writing drivers in kernel-space, and user-space skins
  (posix, native, vxworks, etc...) for writing applications in
  user-space. For a good portability, I would suggest to use the posix
  skin in user-space.

- second, the rapid way, good for prototyping, do it all in
  user-space. You may use iopl or ioperm to allow your application to
  access I/O regions, and libpci and mmaping /dev/mem to access PCI
  devices from user-space. Xenomai will ease your work here by allowing
  you to run your whole application in gdb, and skins generally provide
  functions to implement IRQ servers in user-space. See for example
  pthread_intr_wait_np.

- a third way, maybe useful as an intermediate between the first
  two. Split your code between kernel-space and user-space, but use
  the same skin in user-space and kernel-space. Xenomai ease your
  work here because skin interfaces are written to be very similar in
  kernel-space and user-space, and IPCs may generally be used to
  communicate between the two address spaces.

 >  Is the IPC between kernel-space realtime and user-space
 > non-realtime that much more difficult the user-space realtime to
 > user-space non-realtime?  I've familiar with regular user-space IPC using
 > condition variables, semaphores, and shared memory, so if it's fairly
 > similar, I'm hoping that won't be a problem.
 > -Brandt

The only IPC existing to communicate between real-time (whether
user-space or kernel-space) and non-realtime user-space threads is the
native skin message pipes: 
http://www.xenomai.org/documentation/trunk/html/api/group__pipe.html

By contrast all other IPC implemented by all skins are accessible to
real-time threads running in secondary mode: they will simply switch to
primary mode the time they use blocking services. So, it is probably a
better idea to create your non-realtime threads as real-time threads and
let them switch to secondary mode when they use non-realtime services.

-- 


					    Gilles Chanteperdrix.


      parent reply	other threads:[~2006-06-02 12:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-01 18:20 [Xenomai-help] xnpod help Brandt Erickson
2006-06-01 19:06 ` Jan Kiszka
2006-06-01 19:56 ` Gilles Chanteperdrix
2006-06-01 20:10   ` Jan Kiszka
2006-06-01 20:51     ` Brandt Erickson
2006-06-01 21:16       ` Jan Kiszka
2006-06-01 22:09         ` Brandt Erickson
2006-06-01 22:55           ` Jan Kiszka
2006-06-02 20:41             ` Brandt Erickson
2006-06-03  8:26               ` Jan Kiszka
2006-06-02 12:53           ` Gilles Chanteperdrix [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=17536.13486.254768.91245@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=brandt@domain.hid \
    --cc=jan.kiszka@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.