Some easy steps to compile the visa modules under 2.6.29 kernels .
I follow the advise of Anshul Jain in this post http://decibel.ni.com/content/message/4564#4564
Steps to Complete
1)Install the latest Visa runtime modules
2)Edit the configure script under the nikal src directory and go to line 88 ,and change the line to look like above:
nano +88 /usr/local/natinst/nikal/src/configure
pte_offset_kernel=`$GREP -d skip pte_offset_kernel $headersDir/include/asm/* $headersDir/arch/x86/include/asm/* | $GREP -wc pte_offset_kernel`
save and exit
3) Now edit the the init_task.c of the linux kernel and add the the line EXPORT_UNUSED_SYMBOL(init_mm); under the line struct mm_struct init_mm = INIT_MM(init_mm);
nano +16 /usr/src/linux-2.6.29-gentoo-r1/arch/x86/kernel/init_task.c
and edit the file like above
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
save the file ,go to the /usr/src/linux-2.6.29-gentoo-r1 and recompile the kernel and kernel-modules
cd /usr/src/linux-2.6.29-gentoo-r1/;make clean;make ;make modules;make modules_install
copy the /usr/src/linux-2.6.29-gentoo-r1/arch/x86/boot/bzImage to /boot and configure the bootloader to boot the new kernel
4)reboot ,login as root and execute the the update updateNIDrivers script
now the modules will compile fine,when the compilation finish reboot again
5) log in as root again,and check with lsmod is the visa modules loaded
lsmod |grep ni
and the output seams that the modules has bean loaded
nipxirmk 120416 0
nidimk 341312 1 nipxirmk
niorbk 93556 2 nipxirmk,nidimk
nipalk 1210896 4 nipxirmk,nidimk,niorbk
nikal 43268 2 nipalk
Also checking the dmesq
nikal: module license 'Copyright (c) 2002-2008 National Instruments Corporation. All Rights Reserved. Any and all use of the copyrighted materials is subject to the then current terms and conditions of the applicable license agreement, which can be found at <http://www.ni.com/linux/>.' taints kernel.
Symbol init_mm is marked as UNUSED, however this module is using it.
This symbol will go away in the future.
Please evalute if this is the right api to use and if it really is, submit a report the linux kernel mailinglist together with submitting your code for inclusion.
modprobe used greatest stack depth: 5724 bytes left
Thank you very much! This was really helpful. Just wanted to mention that the second step is unnecessary with NIKAl-1.10 and in your kernel .config file you must have
I really wonder why some propriatary driver lays it's dirty fingers on init_mm.
Seriously, drivers are *NOT* supposed to play with the MMU/VMs directly. Sooner or later this will crash *horribly*.
That's yet another example why proprietary drivers are really, really bad.
Here's a small list of other examples ... note the long list of linked forum postings.