All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Michael Haberler <mail17@mah.priv.at>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] universal application binary: how to auto-detect Xenomai/RT-PREEMPT/vanilla kernel
Date: Mon, 14 Jan 2013 13:06:23 +0100	[thread overview]
Message-ID: <50F3F4BF.4050501@siemens.com> (raw)
In-Reply-To: <D9F55F45-EC38-45B2-A922-08F24868BA87@mah.priv.at>

On 2013-01-14 09:29, Michael Haberler wrote:
> Hi,
> 
> thanks to patience on this list we were able to build linuxcnc such that it runs on Xenomai, besides RT-PREEMPT, vanilla kernels (in a simulator/non-RT mode) and RTAI
> 
> 
> I'm planning to adapt linuxcnc such that a universal binary can be built which runs under Xenomai, RT-PREEMPT and vanilla kernels as this will simplify logistics quite a bit; what I'd like have is reliable auto-detection of the kernel type and 'do the right thing' (RTAI will remain a separate build).
> 
> Autodetection could be one of several things - digging around with a shell script, using system calls, digging in /proc - unsure how to best do this, in particular I'm unsure how to tell an RT-PREEMPT kernel from a vanilla kernel 
> 
> I know it's a bit OT - still I'd be thankful for suggestions
> 
> any other low-lying cliffs I might hit?

I do not see why you application should have to tell -RT from vanilla
apart (syscalls are identical).

To handle the existence of Xenomai dynamically, you could push all
Xenomai API calls into a separate library, some abstraction layer (I
suppose you already have one in LinuxCNC), link that one against the
Xenomai libs, have a "vanilla" version as well that builds against
standard Linux, and then pull in the right version via dlopen (enable
support for this via --enable-dlopen-skins during Xenomai configure).
You could test in /proc for the existence of Xenomai before that, e.g.

Jan

-- 
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux


  parent reply	other threads:[~2013-01-14 12:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-14  8:29 [Xenomai] universal application binary: how to auto-detect Xenomai/RT-PREEMPT/vanilla kernel Michael Haberler
2013-01-14 11:57 ` Gilles Chanteperdrix
2013-01-14 12:05   ` Michael Haberler
2013-01-14 14:07     ` Philippe Gerum
2013-01-16  6:55       ` John Morris
2013-01-16  8:13         ` Jan Kiszka
2013-01-16  8:19           ` Gilles Chanteperdrix
2013-01-16 10:21             ` Paul
2013-01-14 12:06 ` Jan Kiszka [this message]
2013-01-14 12:16   ` 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=50F3F4BF.4050501@siemens.com \
    --to=jan.kiszka@siemens.com \
    --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.