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


_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai

Reply via email to