Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 10-21-2012, 03:32 AM   #1
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:

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

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,

Old 10-22-2012, 08:59 AM   #2
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,889

Rep: Reputation: 1355Reputation: 1355Reputation: 1355Reputation: 1355Reputation: 1355Reputation: 1355Reputation: 1355Reputation: 1355Reputation: 1355Reputation: 1355
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

All times are GMT -5. The time now is 03:02 PM.

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