LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 06-29-2009, 07:30 AM   #1
dinkyverma279
LQ Newbie
 
Registered: Jun 2009
Posts: 29

Rep: Reputation: 15
Quick Question about CONFIG_MODVERSIONS


Hi,

I am using Ubuntu version 8.10 desktop. When i installed ubuntu from CD, it has installed with CONFIG_MODVERSIONS=y

Now the problem is i have my own driver, I have built it but the problem is

I have two a.ko and b.ko modules where b.ko has dependency on a.ko. Since CONFIG_MODVERSIONS will append some version information in the exported symbols. So when i am trying to do insmod b.ko, it is reporting me unknown symbol version.

I have read one tutorial that i will include modversions.h file in every c file before compilation. I did that but still i am getting the same error.

Can some body will tell what should i do to compile the kernel module when CONFIG_MODVSERSIONS is enabled.

Regards,
dinky
 
Old 06-29-2009, 02:35 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Are you sure that CONFIG_MODVERSIONS is your problem (check logs for the symbols in question, for instance use dmesg)? Does it work when this is disabled? Are you sure you are running the same kernel as you compile the module for? I mean *exactly* the same versions (including all additions to kernel version).
 
Old 06-29-2009, 03:32 PM   #3
dinkyverma279
LQ Newbie
 
Registered: Jun 2009
Posts: 29

Original Poster
Rep: Reputation: 15
Post

Hi Mara,

Really thanks for your quick reply. The problem is when i installed the ubuntu linux version 2.6.27-7-generic,the thing is I do not have source code for this ubuntu linux version kernel as i just had kernel headers.
Now when i tried to compile my kernel module, it is compiling successfully. When i did insmod as

insmod ./a.ko
it is successfully inserting it into existing kernel. since b.ko has dependencies on a.ko. So when i am doing like this..

insmod ./b.ko

it is failing and when i saw with dmesg, i am getting following output:

b: no symbol version for Register_Driver
b: unknown symbol Register_Driver

When i checked this error in more detail, i found that my existing kernel is compiled with CONFIG_MODVERSIONS.

So i have to include modversions.h file in every c file. But the problem is in ubuntu linux 8.04 version, modversions.h file is not there in the current distribution of ubuntu linux that i have.

So Now what should i do to compile my kernel module if CONFIG_MODVERSIONS is enabled. I have my standalone kernel module and i am trying to build it with same kernel that is installed using kernel source directory as kernel headers directory?

I do not have any kernel source just i am building my standalone kernel module.

So what should i do to get rid of this problem? Any help will be appreciated.

Regards,
dinky
 
  


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
Quick question :) krutten1986 Linux - Newbie 4 08-30-2006 11:32 AM
CONFIG_MODVERSIONS Turn of!! tertius Linux - Software 2 04-10-2006 05:03 AM
Quick question... b00sted Slackware 1 12-27-2004 11:20 PM
Question Concerning ISO's and one quick question. evrae Linux - Software 2 06-21-2004 03:53 AM
samba smb.config question (quick question) TheDOGG Linux - Networking 1 03-02-2004 07:19 AM

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

All times are GMT -5. The time now is 03:11 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