Re: vulcano math problem

Paolo Mantegazza <[email protected]>
Newsgroups gmane.linux.real-time.rtai
Message-ID <[email protected]>
On 11/23/2015 07:13 PM, Sebastian Kuzminsky wrote:
> On 11/23/15 1:35 AM, Paolo Mantegazza wrote:
>> On 11/23/2015 06:09 AM, Sebastian Kuzminsky wrote:
>>> I'm still building RTAI Volcano on i386, Debian Jessie, and Linux
>>> 3.16.7.  I disabled selfcalibrate.sh as mentioned in a previous email,
>>> and that let the build complete.
>>>
>>> But now when i try to insmod rtai_math.ko, I get this in my dmesg:
>>>
>>>> [10158.160931] I-pipe: head domain RTAI registered.
>>>> [10158.160935] RTAI[hal]: mounted. ISOL_CPUS_MASK: 0, LINUX CPU
>>>> ISOLATED MAP: 0).
>>>> [10158.160938] SYSINFO - # CPUs: 2, TIMER NAME: 'lapic', TIMER IRQ:
>>>> 2305, TIMER FREQ: 65469999, CLOCK NAME: 'tsc', CLOCK FREQ:
>>>> 2095059000, CPU FREQ: 2095059000, LINUX TIMER IRQ: 2305.
>>>> [10158.162410] rtai_math: Unknown symbol errno (err 0)
>>>> [10158.162425] rtai_math: Unknown symbol rt_smp_current (err 0)
>>>> [10158.162442] rtai_math: Unknown symbol _GLOBAL_OFFSET_TABLE_ (err 0)
>>>> [10158.162452] rtai_math: Unknown symbol _dl_hwcap (err 0)
>>>
>>> I'm building with CONFIG_RTAI_MATH_LIBM_TO_USE=3 and
>>> CONFIG_RTAI_MATH_LIBM_DIR=/usr/lib/$(ARCH)-linux-gnu, as that was the
>>> recommended configuration for RTAI 4.1.
>>>
>>> I see no complete library of kernel math code included with RTAI.  
>>> Is it
>>> really still recommended to just link against glibc's (or uclibc's, or
>>> newlib's) libm.a?  That seems very fragile.
>> It seem that the above errors are the same as those you have with
>> RTAI-4.1. That relieves me from a check backward. The (unlucky) fact is
>> that your configuration works well for me on i386 (gcc 4.2.1, libc 2.7).
>> Is it possible that your libm.a is made so that is not for kernl 
>> addresses?
>
> That's certainly possible.  It's the libm.a from Debian Jessie's 
> libc6-dev (Version: 2.19-18+deb8u1).  I have no idea how upstream 
> compiled it.
>
> It seems like it'd be much safer and less error prone for RTAI to 
> compile its own math code, specifically how it wants it, rather than 
> use object code from some other project.  Are you interested in a 
> patch against Vulcano to do that?
>
Well what you suggest is what we had before. It was not smooth either 
has the making failed with changing versions of the common used headers 
files (and other things). Moreover a few functions of interest to in 
kernel comprehensive and demanding applications were missing and we have 
a more comprehensive support now.
My solution has been to statically link what is already available in a 
libm.a, with a minimal compatibility interface and without caring of the 
math function code, so with a minimal maintenance effort. Unfortunately 
the need to address kernel space is not supported by glibc, except for 
32 bit, and so I had to provide possible alternatives available from the 
embeddable free software.
At the moment, the lack of a kernel space making is what has halted me 
from the possibility of unifying the all stuff under the MUSL library.

In any case I want to keep the possibility to fully support weorking in 
kernel space (a thing I like). I'm open to any solution, provided it is 
maintained by somebody committed to it. As it was in the old time when 
Dave Schleef duly cared for RTAI in kernel math support.

Paolo

>
>> While I could understand missing symbols due to linking just libm.a I
>> find it strange  the missing of rt_smp_current.
>> Did you insmod rtai_sched.ko?
>
> The previous time i did not, good catch.  Here's the dmesg output of 
> loading the following three modules in order:
>
> rtai_hal.ko:
>> Nov 23 10:33:53 jessie-i386 kernel: [55152.322287] I-pipe: head 
>> domain RTAI registered.
>> Nov 23 10:33:53 jessie-i386 kernel: [55152.322294] RTAI[hal]: 
>> mounted. ISOL_CPUS_MASK: 0, LINUX CPU ISOLATED MAP: 0).
>> Nov 23 10:33:53 jessie-i386 kernel: [55152.322300] SYSINFO - # CPUs: 
>> 2, TIMER NAME: 'lapic', TIMER IRQ: 2305, TIMER FREQ: 65469999, CLOCK 
>> NAME: 'tsc', CLOCK FREQ: 2095059000, CPU FREQ: 2095059000, LINUX 
>> TIMER IRQ: 2305.
>
> rtai_sched.ko:
>> Nov 23 10:33:59 jessie-i386 kernel: [55157.679699] RTAI[malloc]: 
>> global heap size = 2097152 bytes, <BSD>.
>> Nov 23 10:33:59 jessie-i386 kernel: [55157.680021] , <uses LINUX 
>> SYSCALLs>, kstacks pool size = 524288 bytes.
>> Nov 23 10:33:59 jessie-i386 kernel: [55157.680021] RTAI[sched]: hard 
>> timer type/freq = lapic/65469999(Hz); timing: oneshot; linear timed 
>> lists.
>> Nov 23 10:33:59 jessie-i386 kernel: [55157.680251] RTAI[sched]: Linux 
>> timer freq = 250 (Hz), TimeBase freq = 2095059000 hz.
>> Nov 23 10:33:59 jessie-i386 kernel: [55157.680255] RTAI[sched]: timer 
>> setup = 2185 ns, resched latency = 0 ns.
>
> rtai_math.ko:
>> Nov 23 10:34:04 jessie-i386 kernel: [55162.849071] rtai_math: Unknown 
>> symbol errno (err 0)
>> Nov 23 10:34:04 jessie-i386 kernel: [55162.849112] rtai_math: Unknown 
>> symbol _GLOBAL_OFFSET_TABLE_ (err 0)
>> Nov 23 10:34:04 jessie-i386 kernel: [55162.849129] rtai_math: Unknown 
>> symbol _dl_hwcap (err 0)
>
>
>> A finale point is that you must ensure you patched the kernel with the
>> patches found in VULCANO CVS, not with the one you are using for 
>> RTAI-4.1.
>
> Yep, the running kernel on the machine i'm testing on is patched with 
> hal-linux-3.16.7-x86-5.patch from Vulcano (md5sum 
> 9a6c595ea62b04076aedb50120aa0256).
>
>

_______________________________________________
Rtai mailing list
[email protected]
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.