* [Xenomai] universal application binary: how to auto-detect Xenomai/RT-PREEMPT/vanilla kernel @ 2013-01-14 8:29 Michael Haberler 2013-01-14 11:57 ` Gilles Chanteperdrix 2013-01-14 12:06 ` Jan Kiszka 0 siblings, 2 replies; 10+ messages in thread From: Michael Haberler @ 2013-01-14 8:29 UTC (permalink / raw) To: xenomai 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? - Michael ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai] universal application binary: how to auto-detect Xenomai/RT-PREEMPT/vanilla kernel 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 12:06 ` Jan Kiszka 1 sibling, 1 reply; 10+ messages in thread From: Gilles Chanteperdrix @ 2013-01-14 11:57 UTC (permalink / raw) To: Michael Haberler; +Cc: xenomai On 01/14/2013 09:29 AM, Michael Haberler wrote: > Hi, 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). I have no idea about preempt_rt, however, in order to detect xenomai, you can check for /dev/rtheap. If it does not exist, xenomai programs will not start anyway. Also, I guess for a universal binary, you would dlopen xenomai libraries (native or posix, depending on the one you want to use), if you want to do that, you have to pass --enable-dlopen-skins to xenomai configure script. Regards. -- Gilles. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai] universal application binary: how to auto-detect Xenomai/RT-PREEMPT/vanilla kernel 2013-01-14 11:57 ` Gilles Chanteperdrix @ 2013-01-14 12:05 ` Michael Haberler 2013-01-14 14:07 ` Philippe Gerum 0 siblings, 1 reply; 10+ messages in thread From: Michael Haberler @ 2013-01-14 12:05 UTC (permalink / raw) To: xenomai Gilles, Am 14.01.2013 um 12:57 schrieb Gilles Chanteperdrix: > On 01/14/2013 09:29 AM, Michael Haberler wrote: > >> Hi, > > > 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). > > > I have no idea about preempt_rt, however, in order to detect xenomai, > you can check for /dev/rtheap. If it does not exist, xenomai programs > will not start anyway. Also, I guess for a universal binary, you would > dlopen xenomai libraries (native or posix, depending on the one you want > to use), if you want to do that, you have to pass --enable-dlopen-skins > to xenomai configure script. thanks, that is a good idea to verify the libraries are in place; I had to use --enable-dlopen-skins anyway to make Python imports happy. I'll muddle my way through some string matching to find rt-preempt running; https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO#Checking_the_Kernel gives some hints Is there any chance somebody runs Xenomai AND RT_PREEMPT patches applied? I heard a rumor but havent actually seen that regards - Michael ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai] universal application binary: how to auto-detect Xenomai/RT-PREEMPT/vanilla kernel 2013-01-14 12:05 ` Michael Haberler @ 2013-01-14 14:07 ` Philippe Gerum 2013-01-16 6:55 ` John Morris 0 siblings, 1 reply; 10+ messages in thread From: Philippe Gerum @ 2013-01-14 14:07 UTC (permalink / raw) To: Michael Haberler; +Cc: xenomai On 01/14/2013 01:05 PM, Michael Haberler wrote: > Gilles, > > Am 14.01.2013 um 12:57 schrieb Gilles Chanteperdrix: > >> On 01/14/2013 09:29 AM, Michael Haberler wrote: >> >>> Hi, >> >> >> 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). >> >> >> I have no idea about preempt_rt, however, in order to detect xenomai, >> you can check for /dev/rtheap. If it does not exist, xenomai programs >> will not start anyway. Also, I guess for a universal binary, you would >> dlopen xenomai libraries (native or posix, depending on the one you want >> to use), if you want to do that, you have to pass --enable-dlopen-skins >> to xenomai configure script. > > thanks, that is a good idea to verify the libraries are in place; I had to use --enable-dlopen-skins anyway to make Python imports happy. > > I'll muddle my way through some string matching to find rt-preempt running; https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO#Checking_the_Kernel gives some hints > > Is there any chance somebody runs Xenomai AND RT_PREEMPT patches applied? I heard a rumor but havent actually seen that Yes, this works. The current target is ppc 85xx, but I don't see any showstopper for running such combo on other archs, provided the I-pipe patch is adapted to a -rt kernel. This requires Xenomai 2.6.1+, stock. -- Philippe. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai] universal application binary: how to auto-detect Xenomai/RT-PREEMPT/vanilla kernel 2013-01-14 14:07 ` Philippe Gerum @ 2013-01-16 6:55 ` John Morris 2013-01-16 8:13 ` Jan Kiszka 0 siblings, 1 reply; 10+ messages in thread From: John Morris @ 2013-01-16 6:55 UTC (permalink / raw) To: Philippe Gerum; +Cc: xenomai On 01/14/2013 08:07 AM, Philippe Gerum wrote: > On 01/14/2013 01:05 PM, Michael Haberler wrote: >> Is there any chance somebody runs Xenomai AND RT_PREEMPT patches >> applied? I heard a rumor but havent actually seen that > > Yes, this works. The current target is ppc 85xx, but I don't see any > showstopper for running such combo on other archs, provided the > I-pipe patch is adapted to a -rt kernel. This requires Xenomai > 2.6.1+, stock. Comparing the xenomai-2.6.2 x86/patches directory and http://www.kernel.org/pub/linux/kernel/projects/rt, it appears there's a common kernel version in 3.2.21. I'm preparing RPM packages for 3.5 because I assume that's where most development and bug fixing is going on, and because I hope the work will be useful beyond the LinuxCNC community. Unfortunately, RT_PREEMPT seems to skip linux 3.5 entirely, jumping from 3.4 to 3.6. John ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai] universal application binary: how to auto-detect Xenomai/RT-PREEMPT/vanilla kernel 2013-01-16 6:55 ` John Morris @ 2013-01-16 8:13 ` Jan Kiszka 2013-01-16 8:19 ` Gilles Chanteperdrix 0 siblings, 1 reply; 10+ messages in thread From: Jan Kiszka @ 2013-01-16 8:13 UTC (permalink / raw) To: John Morris; +Cc: xenomai On 2013-01-16 07:55, John Morris wrote: > On 01/14/2013 08:07 AM, Philippe Gerum wrote: >> On 01/14/2013 01:05 PM, Michael Haberler wrote: >>> Is there any chance somebody runs Xenomai AND RT_PREEMPT patches >>> applied? I heard a rumor but havent actually seen that >> >> Yes, this works. The current target is ppc 85xx, but I don't see any >> showstopper for running such combo on other archs, provided the >> I-pipe patch is adapted to a -rt kernel. This requires Xenomai >> 2.6.1+, stock. > > Comparing the xenomai-2.6.2 x86/patches directory and > http://www.kernel.org/pub/linux/kernel/projects/rt, it appears there's a > common kernel version in 3.2.21. > > I'm preparing RPM packages for 3.5 because I assume that's where most > development and bug fixing is going on, and because I hope the work will > be useful beyond the LinuxCNC community. Unfortunately, RT_PREEMPT > seems to skip linux 3.5 entirely, jumping from 3.4 to 3.6. I-pipe also jumps, and now happened to land on 3.5 with its latest fixes and features. When we jump the next time, we should probably pick 3.8 as target for that reason. I may look into this soon. But I'm also considering to backport recent work to 3.4 (for x86 targets at least). Jan -- Siemens AG, Corporate Technology, CT RTC ITP SDP-DE Corporate Competence Center Embedded Linux ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai] universal application binary: how to auto-detect Xenomai/RT-PREEMPT/vanilla kernel 2013-01-16 8:13 ` Jan Kiszka @ 2013-01-16 8:19 ` Gilles Chanteperdrix 2013-01-16 10:21 ` Paul 0 siblings, 1 reply; 10+ messages in thread From: Gilles Chanteperdrix @ 2013-01-16 8:19 UTC (permalink / raw) To: Jan Kiszka; +Cc: John Morris, xenomai On 01/16/2013 09:13 AM, Jan Kiszka wrote: > On 2013-01-16 07:55, John Morris wrote: >> On 01/14/2013 08:07 AM, Philippe Gerum wrote: >>> On 01/14/2013 01:05 PM, Michael Haberler wrote: >>>> Is there any chance somebody runs Xenomai AND RT_PREEMPT patches >>>> applied? I heard a rumor but havent actually seen that >>> >>> Yes, this works. The current target is ppc 85xx, but I don't see any >>> showstopper for running such combo on other archs, provided the >>> I-pipe patch is adapted to a -rt kernel. This requires Xenomai >>> 2.6.1+, stock. >> >> Comparing the xenomai-2.6.2 x86/patches directory and >> http://www.kernel.org/pub/linux/kernel/projects/rt, it appears there's a >> common kernel version in 3.2.21. >> >> I'm preparing RPM packages for 3.5 because I assume that's where most >> development and bug fixing is going on, and because I hope the work will >> be useful beyond the LinuxCNC community. Unfortunately, RT_PREEMPT >> seems to skip linux 3.5 entirely, jumping from 3.4 to 3.6. > > I-pipe also jumps, and now happened to land on 3.5 with its latest fixes > and features. When we jump the next time, we should probably pick 3.8 as > target for that reason. I may look into this soon. But I'm also > considering to backport recent work to 3.4 (for x86 targets at least). I may jump to 3.6, at least for the ARM architecture. As for the backports to 3.4, I still intend to re-release 2.6.2, so, it would be nice to backport the bugfixes in the core-3.5 branch to the core-3.4 branch. -- Gilles. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai] universal application binary: how to auto-detect Xenomai/RT-PREEMPT/vanilla kernel 2013-01-16 8:19 ` Gilles Chanteperdrix @ 2013-01-16 10:21 ` Paul 0 siblings, 0 replies; 10+ messages in thread From: Paul @ 2013-01-16 10:21 UTC (permalink / raw) To: xenomai On Wednesday 16 January 2013, Gilles Chanteperdrix wrote: > I may jump to 3.6, at least for the ARM architecture. As for the > backports to 3.4, I still intend to re-release 2.6.2, so, it would be > nice to backport the bugfixes in the core-3.5 branch to the core-3.4 > branch. If you plan on updating the 3.2.21 ipipe-core patch, any chance you could include the fix to timer.c that you kindly provided a patch for (see http://www.xenomai.org/pipermail/xenomai/2012-August/026015.html ) I notice the bug affects all architectures, not just the ARM across the 3.2.21 patch set. Other kernel versions already have the fix applied. Thanks. Regards, Paul. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai] universal application binary: how to auto-detect Xenomai/RT-PREEMPT/vanilla kernel 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:06 ` Jan Kiszka 2013-01-14 12:16 ` Michael Haberler 1 sibling, 1 reply; 10+ messages in thread From: Jan Kiszka @ 2013-01-14 12:06 UTC (permalink / raw) To: Michael Haberler; +Cc: xenomai 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 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai] universal application binary: how to auto-detect Xenomai/RT-PREEMPT/vanilla kernel 2013-01-14 12:06 ` Jan Kiszka @ 2013-01-14 12:16 ` Michael Haberler 0 siblings, 0 replies; 10+ messages in thread From: Michael Haberler @ 2013-01-14 12:16 UTC (permalink / raw) To: xenomai Am 14.01.2013 um 13:06 schrieb Jan Kiszka: Jan, > 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). you're right from the ABI point of view when driving a machine some of the motion-related tasks are time critical and will fail with an error message if latency becomes too high; in the very minimum this has to be suppressed on a vanilla kernel after giving an initial warning, and proceed as a 'simulator configuration' (which really translates into 'no time guarantees whatsoever'); in that case one would also avoid loading actual hardware drivers to prevent damage > 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. the current plan is to have the generic RTAPI abstraction layer in a .so plus shared objects as needed per flavor - Michael > > Jan > > -- > Siemens AG, Corporate Technology, CT RTC ITP SDP-DE > Corporate Competence Center Embedded Linux ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2013-01-16 10:21 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 2013-01-14 12:16 ` Michael Haberler
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.