Problems porting old xeno2 module
Hello everybody. I'm trying to port some kernel modules which we used on xeno2 to xeno3 cobalt.
The old code used the native skin so I'm trying to get it working using the
transaction kit (trank/native).
I've got some major differences between the two env though. The old xeno2 had some libraries included in itself which seem to me had been deprecated in over OS standard ones.
This is my old makefile configuration:
$ make print-EXTRA_CFLAGS EXTRA_CFLAGS = -I/lib/modules/2.6.35.9-xenomai-2.5.6-acpi-3/build/include/xenomai -I/lib/modules/2.6.35.9-xenomai-2.5.6-acpi-3/build/include/xenomai/posix -I/root/iarte/include
$ ls -l /lib/modules/2.6.35.9-xenomai-2.5.6-acpi-3/build/include/xenomai total 52 drwxr-xr-x 2 root root 4096 Oct 14 2011 analogy drwxr-xr-x 4 root root 4096 Oct 14 2011 compat drwxr-xr-x 2 root root 4096 Sep 19 09:19 native drwxr-xr-x 2 root root 4096 Oct 14 2011 nucleus drwxr-xr-x 3 root root 4096 Sep 14 12:18 posix drwxr-xr-x 2 root root 4096 Oct 14 2011 psos+ drwxr-xr-x 2 root root 4096 Oct 14 2011 rtai -rw-r--r-- 1 root root 1911 Oct 14 2011 rtdk.h drwxr-xr-x 2 root root 4096 Oct 14 2011 rtdm drwxr-xr-x 2 root root 4096 Oct 14 2011 testing drwxr-xr-x 2 root root 4096 Oct 14 2011 uitron drwxr-xr-x 2 root root 4096 Oct 14 2011 vrtx drwxr-xr-x 2 root root 4096 Oct 14 2011 vxworks
$ ls -l /lib/modules/2.6.35.9-xenomai-2.5.6-acpi-3/build/include/xenomai/po six total 64 -rw-r--r-- 1 root root 1620 Oct 14 2011 errno.h -rw-r--r-- 1 root root 1384 Oct 14 2011 fcntl.h -rw-r--r-- 1 root root 3634 Oct 14 2011 mqueue.h -rw-r--r-- 1 root root 1606 Oct 14 2011 posix.h -rw-r--r-- 1 root root 14165 Oct 14 2011 pthread.h -rw-r--r-- 1 root root 2176 Oct 14 2011 sched.h -rw-r--r-- 1 root root 2997 Oct 14 2011 semaphore.h -rw-r--r-- 1 root root 2954 Oct 14 2011 signal.h drwxr-xr-x 2 root root 4096 Oct 14 2011 sys -rw-r--r-- 1 root root 4442 Oct 14 2011 syscall.h -rw-r--r-- 1 root root 3506 Oct 14 2011 time.h -rw-r--r-- 1 root root 1869 Oct 14 2011 unistd.h
My code sees errno.h because of this posix include path.
In the new configuration I can't compile because errno.h is not included:
$ /usr/local/src/iarte/source/rt_control# make
make -C /lib/modules/4.9.24-ipipe-xenomai-3.0.5-cobalt/build M=/usr/local/s
rc/iarte/source/rt_control SUBDIRS=/usr/local/src/iarte/source/rt_control m
odules
make[1]: Entering directory '/usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.
5-cobalt'
CC [M] /usr/local/src/iarte/source/rt_control/rt_control_mgm.o
In file included from /usr/local/src/iarte/include/common.h:10:0,
from /usr/local/src/iarte/source/rt_control/rt_control_mgm
.c:35:
/usr/xenomai/include/trank/native/task.h:21:19: fatal error: errno.h: No su
ch file or directory
#include <errno.h>
^
compilation terminated.
scripts/Makefile.build:299: recipe for target '/usr/local/src/iarte/source/
rt_control/rt_control_mgm.o' failed
make[2]: *** [/usr/local/src/iarte/source/rt_control/rt_control_mgm.o] Erro
r 1
Makefile:1490: recipe for target '_module_/usr/local/src/iarte/source/rt_co
ntrol' failed
make[1]: *** [_module_/usr/local/src/iarte/source/rt_control] Error 2
make[1]: Leaving directory '/usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5
-cobalt'
Makefile:45: recipe for target 'all' failed
make: *** [all] Error 2Inclusion paths are:
$ make print-ccflags-y ccflags-y = -I/usr/xenomai/include -I/lib/modules/4.9.24-ipipe-xenomai-3.0.5-cobalt/build/include -I/usr/local/src/iarte/include
$ ls -l /lib/modules/4.9.24-ipipe-xenomai-3.0.5-cobalt/build/include total 196 drwxrwsr-x 3 root root 4096 Apr 21 07:31 acpi drwxrwsr-x 4 root root 4096 Sep 13 10:22 asm-generic drwxrwsr-x 2 root root 4096 Sep 13 10:22 clocksource drwxr-sr-x 683 root root 36864 Sep 19 06:39 config drwxrwsr-x 3 root root 4096 Apr 21 07:31 crypto drwxrwsr-x 5 root root 4096 Apr 21 07:31 drm drwxrwsr-x 27 root root 4096 Apr 21 07:31 dt-bindings drwxr-sr-x 3 root root 4096 Sep 19 06:39 generated drwxr-sr-x 2 root root 4096 Sep 13 10:22 ipipe -rw-rw-r-- 1 root root 83 Apr 21 07:31 Kbuild drwxrwsr-x 2 root root 4096 Apr 21 07:31 keys drwxrwsr-x 2 root root 4096 Apr 21 07:31 kvm drwxrwsr-x 54 root root 36864 Sep 14 10:36 linux drwxrwsr-x 2 root root 4096 Apr 21 07:31 math-emu drwxrwsr-x 6 root root 4096 Apr 21 07:31 media drwxrwsr-x 2 root root 4096 Apr 21 07:31 memory drwxrwsr-x 2 root root 4096 Apr 21 07:31 misc drwxrwsr-x 13 root root 4096 Apr 21 07:31 net drwxrwsr-x 2 root root 4096 Apr 21 07:31 pcmcia drwxrwsr-x 2 root root 4096 Apr 21 07:31 ras drwxrwsr-x 2 root root 4096 Apr 21 07:31 rdma drwxrwsr-x 2 root root 4096 Apr 21 07:31 rxrpc drwxrwsr-x 3 root root 4096 Apr 21 07:31 scsi drwxrwsr-x 12 root root 4096 Apr 21 07:31 soc drwxrwsr-x 2 root root 4096 Apr 21 07:31 sound drwxrwsr-x 3 root root 4096 Apr 21 07:31 target drwxrwsr-x 3 root root 4096 Apr 21 07:31 trace drwxrwsr-x 12 root root 4096 Apr 21 07:31 uapi drwxrwsr-x 2 root root 4096 Apr 21 07:31 video drwxrwsr-x 3 root root 4096 Apr 21 07:31 xen drwxr-sr-x 4 root root 4096 Sep 13 10:22 xenomai
$ ls -l /usr/xenomai/include total 48 drwxr-xr-x 2 root root 4096 Sep 18 14:51 alchemy drwxr-xr-x 2 root root 4096 Sep 14 15:25 boilerplate drwxr-xr-x 5 root root 4096 Sep 14 15:25 cobalt drwxr-xr-x 2 root root 4096 Sep 14 15:25 copperplate drwxr-xr-x 2 root root 4096 Sep 14 15:25 psos drwxr-xr-x 3 root root 4096 Sep 14 15:25 rtdm drwxr-xr-x 2 root root 4096 Sep 14 15:25 smokey drwxr-xr-x 5 root root 4096 Sep 14 15:25 trank drwxr-xr-x 2 root root 4096 Sep 14 15:25 vxworks -rw-r--r-- 1 root root 6272 Sep 14 15:25 xeno_config.h drwxr-xr-x 2 root root 4096 Sep 14 15:25 xenomai
I've tried to find some Xeno related posix directory but couldn't find any (that includes errno.h at least):
$ls -l /usr/xenomai/include/trank/posix
total 4
-rw-r--r-- 1 root root 2864 Sep 14 15:25 pthread.h
$ locate errno.h|grep posix <no results found>
$ locate errno.h /usr/include/errno.h /usr/include/asm-generic/errno.h /usr/include/i386-linux-gnu/asm/errno.h /usr/include/i386-linux-gnu/bits/errno.h /usr/include/i386-linux-gnu/sys/errno.h /usr/include/linux/errno.h /usr/include/sys/errno.h /usr/include/x86_64-linux-gnu/asm/errno.h /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/x86_64-linux-gnu/sys/errno.h /usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5-cobalt/arch/alpha/include/u api/asm/errno.h /usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5-cobalt/arch/frv/include/uap i/asm/errno.h /usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5-cobalt/arch/ia64/include/ua pi/asm/errno.h /usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5-cobalt/arch/m32r/include/ua pi/asm/errno.h /usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5-cobalt/arch/microblaze/incl ude/uapi/asm/errno.h /usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5-cobalt/arch/mips/include/as m/errno.h /usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5-cobalt/arch/mips/include/ua pi/asm/errno.h /usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5-cobalt/arch/mn10300/include /uapi/asm/errno.h /usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5-cobalt/arch/parisc/include/ uapi/asm/errno.h /usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5-cobalt/arch/powerpc/include /uapi/asm/errno.h /usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5-cobalt/arch/s390/include/ua pi/asm/errno.h /usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5-cobalt/arch/score/include/u api/asm/errno.h /usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5-cobalt/arch/sparc/include/u api/asm/errno.h /usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5-cobalt/arch/x86/include/uap i/asm/errno.h /usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5-cobalt/drivers/media/platfo rm/exynos4-is/fimc-is-errno.h /usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5-cobalt/drivers/staging/lust re/lustre/include/lustre/lustre_errno.h /usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5-cobalt/include/linux/errno. h /usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5-cobalt/include/uapi/asm-gen eric/errno.h /usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.5-cobalt/include/uapi/linux/e rrno.h /usr/src/linux-headers-4.9.0-3-common/arch/alpha/include/uapi/asm/errno.h /usr/src/linux-headers-4.9.0-3-common/arch/mips/include/asm/errno.h /usr/src/linux-headers-4.9.0-3-common/arch/mips/include/uapi/asm/errno.h /usr/src/linux-headers-4.9.0-3-common/arch/parisc/include/uapi/asm/errno.h /usr/src/linux-headers-4.9.0-3-common/arch/powerpc/include/uapi/asm/errno.h
/usr/src/linux-headers-4.9.0-3-common/arch/s390/include/uapi/asm/errno.h /usr/src/linux-headers-4.9.0-3-common/arch/sparc/include/uapi/asm/errno.h /usr/src/linux-headers-4.9.0-3-common/arch/x86/include/uapi/asm/errno.h /usr/src/linux-headers-4.9.0-3-common/include/linux/errno.h /usr/src/linux-headers-4.9.0-3-common/include/uapi/asm-generic/errno.h /usr/src/linux-headers-4.9.0-3-common/include/uapi/linux/errno.h
trank/native/task.h includes this:
grep -n errno.h /usr/local/src/xenomai-3.0.5/include/trank/native/task.h 21:#include <errno.h>
Including /usr/include/errno.h generates tons of errors:
$ make 2>&1 |egrep -i "error|warning" |wc -l 166
Like:
$ make 2>&1 |head
make -C /lib/modules/4.9.24-ipipe-xenomai-3.0.5-cobalt/build M=/usr/local/s
rc/iarte/source/rt_control SUBDIRS=/usr/local/src/iarte/source/rt_control m
odules
make[1]: Entering directory '/usr/local/src/linux-4.9.24-ipipe-xenomai-3.0.
5-cobalt'
CC [M] /usr/local/src/iarte/source/rt_control/rt_control_mgm.o
In file included from /usr/include/features.h:364:0,
from /usr/include/errno.h:28,
from /usr/xenomai/include/trank/native/task.h:21,
from /usr/local/src/iarte/include/common.h:10,
from /usr/local/src/iarte/source/rt_control/rt_control_mgm
.c:35:
/usr/include/sys/cdefs.h:236:0: warning: "__attribute_const__" redefined
# define __attribute_const__ __attribute__ ((__const__))I'm using Kernel 4.9.24 iPipe patched with xenomai 3.0.5 cobalt core.
Am I doing something wrong? How could I proceed?
Thanks in advance,
Simone
Quoted 5 lines · Simone Zucchi
Hello everybody. I'm trying to port some kernel modules which we used on xeno2 to xeno3 cobalt.
The old code used the native skin so I'm trying to get it working using the
transaction kit (trank/native).
The transition kit is for porting user-space apps from the legacy "native" API of Xenomai 2.x to alchemy. The only API available in kernel space with Xenomai 3 is RTDM, for drivers.
Signature · 1 line
Philippe.
Thanks a lot, missed that part in the FAQ.
Simone
On 09/19/2017 10:59 AM, Philippe Gerum wrote:
On 09/19/2017 10:20 AM, Simone Zucchi wrote:
Hello everybody. I'm trying to port some kernel modules which we used on xeno2 to xeno3 cobalt.
The old code used the native skin so I'm trying to get it working using the
transaction kit (trank/native).
The transition kit is for porting user-space apps from the legacy "native" API of Xenomai 2.x to alchemy. The only API available in kernel space with Xenomai 3 is RTDM, for drivers.