LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 10-21-2012, 03:32 AM   #1
dungnguyen
LQ Newbie
 
Registered: Jun 2012
Posts: 5

Rep: Reputation: Disabled
Question Compatible between kernel version and source code to compile module


Hi all,

I'm now studying about Linux driver and trying to write a simplest module helloworld follow this tutorial: http://www.freesoftwaremagazine.com/.../drivers_linux

I use Ubuntu 10.04 and this line is output when I type "uname -a"

Code:
dungnguyen@dungnguyen:~$ uname -a
Linux dungnguyen 2.6.32-43-generic #97-Ubuntu SMP Wed Sep 5 16:43:09 UTC 2012 i686 GNU/Linux
I wonder about compatible between kernel version and source code to compile module. Can I using kernel source code 2.6.30 to build module for my 2.6.32-43 kernel? Or I have to download exactly source 2.6.32-43?

By the way, I don't know what "-43-generic" mean. Please somebody explain for me.

Thank you and best regard,

DungNguyen
 
Old 10-22-2012, 08:59 AM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Your source code (obviously...) must exactly match the underlying kernel version being used.

Your module should be recompiled along with that of every other module if anything about the kernel changes. "Do not mix apples and oranges."
 
1 members found this post helpful.
  


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
how to cross compile code when the target is for another kernel version ? schneidz Linux - Embedded & Single-board computer 2 11-27-2011 11:20 PM
I am having probelm to compile my source code in linux-2.6 version kiran@ccpu Linux - Software 3 10-31-2007 04:02 AM
compile kernel module got version mismatched? blackzone Programming 1 11-07-2004 09:41 PM
how to compile a module with a newer version of the linux kernel? fvarela Programming 2 07-29-2004 02:00 AM

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

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