LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Compatible between kernel version and source code to compile module (https://www.linuxquestions.org/questions/linux-kernel-70/compatible-between-kernel-version-and-source-code-to-compile-module-4175433313/)

dungnguyen 10-21-2012 03:32 AM

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

sundialsvcs 10-22-2012 08:59 AM

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."


All times are GMT -5. The time now is 10:54 AM.