Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi!
Now that you guys have this kernel thingy, i was wondering whether you could help me understand the error messages i get when trying to compile a kernel module. It seems like the kernel Header files have errors in them. Are there clean headers i could use or what?
well... it depends on what kind of errors you're getting. If you're getting warnings, then it's usually nothing to worry about - if you're getting a failed compile, then it might be bad dependencies; do you have the output with the errors?
Distribution: Fedora 10/9/8/6 - FC3 - RH9 + Puppy Dog
Posts: 27
Rep:
I've noticed that kernel 2.6.16 doesn't like to build modules! Can't get fglrx to build and seen a few threads with the same. What kernel version are you using
Distribution: Fedora 10/9/8/6 - FC3 - RH9 + Puppy Dog
Posts: 27
Rep:
Scratch that just updated to 2.6.16.2096 (2.6.16-1.2096_FC4smp) from 2.6.16.2069 and now able to compile modules again. Have got fglrx to work even if not using the ati agp.
hi,
i am new to linux. When I try to insert object file into kernel using insmod, I get message like kernel version mismatch. I am using red hat 9, kernel version 2.4.20-8 and gcc 3.2.2. what should i do ?
Regards,
Aditya
hi,
i am new to linux. When I try to insert object file into kernel using insmod, I get message like kernel version mismatch. I am using red hat 9, kernel version 2.4.20-8 and gcc 3.2.2. what should i do ?
Regards,
Aditya
Well, since you're compiling something related to kernel, you've gotta compile it with the kernel headers and not glibc headers.
So, your compile command should look like: gcc -c hello.c -o hello.o -I /usr/src/linux-2.4.20-8/include -D__KERNEL__
Adapt the command to suite your configuration.
HTH
[QUOT:E=the_unforgiven]Well, since you're compiling something related to kernel, you've gotta compile it with the kernel headers and not glibc headers.
So, your compile command should look like: gcc -c hello.c -o hello.o -I /usr/src/linux-2.4.20-8/include -D__KERNEL__
Adapt the command to suite your configuration.
HTH [/QUOTE]
hi,
I tried this, but still error
" couldn't find the kernel version the module was compiled for"
Kernel modules should be rebuilt by using make in the /usr/src/linux directory. I don't see any value in trying to compile them "by hand."
Each kernel module contains a version-identifier designed specifically to prevent them from being loaded by a kernel other than the one they were built for. (Obviously, this would mean instant death. )
If you are running on binary "distros," and are not compiling things for your own kernel, then you simply need to find the right version of "the package or RPM or whatever" that contains the binary module corresponding to the kernel you now have installed.
If you are running on a kernel that you compile yourself, from source, then a simple re-make of the kernel ought to update that module as well, and make install and make modules_install should put it into place.
Remember that you'll have to reboot the system before attempting to install the new module.
Kernel modules should be rebuilt by using make in the /usr/src/linux directory. I don't see any value in trying to compile them "by hand."
Each kernel module contains a version-identifier designed specifically to prevent them from being loaded by a kernel other than the one they were built for. (Obviously, this would mean instant death. )
This wasn't applicable in the days of 2.4.x kernels.
This is what the new kernel build system for 2.6.x kernels (kbuild) has brought with it.
For 2.4 series kernels, you have to build the modules by hand - unless they've updated the current 2.4 tree to use the kbuild process - I've not tried it in ages now.
error: couldn't find the kernel version the module was compiled for
then instead of -isystem i tried -I the problem is not yet solved
Thanx
What's the output of uname -r command?
Are you sure you're building the module for a 2.4.x kernel?
And do you have the configured sources for your current kernel installed?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.