Kernel compilation, driver compilation

Source: Internet
Author: User

Today just to compile the kernel, and then compile and install the kernel module, and then compile the driver, drive the makefile in Kerneldir=/lib/modules/2.6.38/build, you can compile success, just the KO file down to the board, Insmod When Xx.ko, an error

XX version Magic ' 2.6.38 mod_unload modversion armv5 ' should be ' 2.6.38-friendlyarm mod_unload '

Insmod:cannot insert ' Xx.ko ': Invalid module format '

Before I knew, the version of the kernel source code for the compiler driver must be consistent with the version of the system in the Development Board, and I did, too, 2.6.38, but it went wrong.

After a friend's help, is the kernel configuration problem, with his already configured config file, copy to linux-2.6.38 root directory as. config, and then make Menuconfig arch=arm cross_compile=arm-linux- , the result I tried, will drive makefile Kerneldir directory as/home/student/tiny6410/linux-2.6.38, the result is correct. Before I configured the time, compile the kernel, so that the compiler driver is wrong, so I compiled and installed the kernel module, that only installed the kernel module, and then modify the driver makefile in the dependent kernel directory, it seems to be the kernel configuration problem.

Then I recompile driver, download KO file to the board, Insmod, still appear the same error.

I thought: This should not be the kernel configuration of the problem. I just thought I accidentally, when I copied the config file from samba to Linux, Found that can not be copied to the linux-2.6.38 directory, and other directories can be copied in, so think is not the issue of permissions, check the linux-2.6.38 permissions, is drwxr-xr-x, so I held the idea of trying to modify its permissions: chmod 777 linux-2.6.38, but the result was successful ...

Now finally can normal insmod and rmmod, this time can be assured to proceed to the next step.

To sum up the wrong reason:

1, there is a problem with the kernel configuration. The makefile can be driven, as before, just a linux-2.6.38 directory.

2, the folder linux-2.6.38 permissions issues.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.