LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-13-2005, 02:02 AM   #1
guam
LQ Newbie
 
Registered: Feb 2004
Location: Korea
Posts: 25

Rep: Reputation: 15
Compiling kernel module for linux kernel 2.4 in 2.6


Hello Everyone,

I have a kernel module that perfectly compiles and works with kernel version 2.4.20-18 on Redhat 9.0. This is third party code.

I have upgraded OS to Fedora Core 3 with kernel version 2.6.9. I downloaded the kernel source from the same distribution in rpm form and installed it. The kernel rpm is "kernel-2.6.9-1.667.src.rpm" and followed the steps below:

1. Install kernel-<version>.src.rpm. By default, the files of the package will be written to /usr/src/redhat/.
# rpm -ivh kernel-2.6.9-1.667.src.rpm

2. Change directory to /usr/src/redhat/SPECS/, and issue the command: rpmbuild -bp --target=<arch> kernel.spec
# cd /usr/src/redhat/SPECS/
# rpmbuild -bp --target=i686 kernel-2.6.spec

On a default RPM configuration, the kernel tree will be located in /usr/src/redhat/BUILD/.

Now I have problem compiling the kernel module.

The error message is as follows:
=====================================================
kaodv.c:30:31: linux/modversions.h: No such file or directory
In file included from /lib/modules/2.6.9-1.667/build/include/asm/processor.h:18,
from /lib/modules/2.6.9-1.667/build/include/asm/thread_info.h:16,
from /lib/modules/2.6.9-1.667/build/include/linux/thread_info.h:21,
from /lib/modules/2.6.9-1.667/build/include/linux/spinlock.h:12,
from /lib/modules/2.6.9-1.667/build/include/linux/capability.h:45,
from /lib/modules/2.6.9-1.667/build/include/linux/sched.h:7,
from /lib/modules/2.6.9-1.667/build/include/linux/module.h:10,
from kaodv.c:38:
/lib/modules/2.6.9-1.667/build/include/asm/system.h: In function `__set_64bit_var':
/lib/modules/2.6.9-1.667/build/include/asm/system.h:193: warning: dereferencing type-punned pointer will break strict-aliasing rules
/lib/modules/2.6.9-1.667/build/include/asm/system.h:193: warning: dereferencing type-punned pointer will break strict-aliasing rules
kaodv.c:43:27: linux/wrapper.h: No such file or directory
In file included from /lib/modules/2.6.9-1.667/build/include/linux/irq.h:20,
from /lib/modules/2.6.9-1.667/build/include/asm/hardirq.h:6,
from /lib/modules/2.6.9-1.667/build/include/linux/hardirq.h:6,
from /lib/modules/2.6.9-1.667/build/include/linux/interrupt.h:11,
from /lib/modules/2.6.9-1.667/build/include/asm/highmem.h:24,
from /lib/modules/2.6.9-1.667/build/include/linux/highmem.h:14,
from /lib/modules/2.6.9-1.667/build/include/linux/skbuff.h:27,
from /lib/modules/2.6.9-1.667/build/include/linux/if_ether.h:106,
from kaodv.c:45:
/lib/modules/2.6.9-1.667/build/include/asm/irq.h:16:25: irq_vectors.h: No such file or directory
In file included from /lib/modules/2.6.9-1.667/build/include/asm/hardirq.h:6,
from /lib/modules/2.6.9-1.667/build/include/linux/hardirq.h:6,
from /lib/modules/2.6.9-1.667/build/include/linux/interrupt.h:11,
from /lib/modules/2.6.9-1.667/build/include/asm/highmem.h:24,
from /lib/modules/2.6.9-1.667/build/include/linux/highmem.h:14,
from /lib/modules/2.6.9-1.667/build/include/linux/skbuff.h:27,
from /lib/modules/2.6.9-1.667/build/include/linux/if_ether.h:106,
from kaodv.c:45:
/lib/modules/2.6.9-1.667/build/include/linux/irq.h: At top level:
/lib/modules/2.6.9-1.667/build/include/linux/irq.h:70: error: `NR_IRQS' undeclared here (not in a function)
In file included from /lib/modules/2.6.9-1.667/build/include/linux/irq.h:72,
from /lib/modules/2.6.9-1.667/build/include/asm/hardirq.h:6,
from /lib/modules/2.6.9-1.667/build/include/linux/hardirq.h:6,
from /lib/modules/2.6.9-1.667/build/include/linux/interrupt.h:11,
from /lib/modules/2.6.9-1.667/build/include/asm/highmem.h:24,
from /lib/modules/2.6.9-1.667/build/include/linux/highmem.h:14,
from /lib/modules/2.6.9-1.667/build/include/linux/skbuff.h:27,
from /lib/modules/2.6.9-1.667/build/include/linux/if_ether.h:106,
from kaodv.c:45:
/lib/modules/2.6.9-1.667/build/include/asm/hw_irq.h:28: error: `NR_IRQ_VECTORS' undeclared here (not in a function)
kaodv.c: In function `init_module':
kaodv.c:188: error: `EXPORT_NO_SYMBOLS' undeclared (first use in this function)
kaodv.c:188: error: (Each undeclared identifier is reported only once
kaodv.c:188: error: for each function it appears in.)
make: *** [kaodv.o] Error 1
=====================================================

I think this is due to some change in the linux kernel source tree. Can someone point me in correct direction for the changes to be made to make the module working?

I mean what are the changes required in source and compilation procedure.

Thanks in advance.

Devel.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
compiling only one module without recompiling the kernel l_9_l Linux - General 8 07-06-2009 10:00 PM
Compiling kernel...whats a module? TheDude05 Linux - Newbie 2 01-18-2005 09:29 PM
Compiling a module/Kernel mismatch fbarre Linux - Newbie 2 09-04-2003 08:26 PM
Error compiling Module in Linux kernel iannou Linux - Software 1 06-27-2003 07:06 PM
compiling a kernel module for a different target akaBeaVis Linux - Software 10 06-09-2003 12:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration