Driver Module compilation Summary

Source: Internet
Author: User

First, the most common mistake during kernel compilation is that the compiler version does not match (too low). Therefore, you should first check the compiler version before compilation. Now let's briefly summarize the compilation and installation methods and comparison of the driver module:

Method 1: Compile the MAKEFILE file by yourself (see my other blog post), specify the kernel source code tree, compile it using the make command, and then add and use insmod dynamically.

Perception: This method is applicable to the kernel-driven development stage and has a convenient and efficient development process.

Method 2: Modify the driver path file under the kernel source directory tree, for example: first copy the driver source file to/linux-2.6.30/deiver/Char/, and then modify the corresponding kconfig file under the directory, for details about how to modify the driver name, refer to the kconfig file. (Modify kconfig because kconfig affects menuconfig during Kernel configuration compilation, menuconfig affects. config, And. config affects

Makefile, So modify the configuration according to the dependency) then enter the menuconfig configuration list, and you can see your module name in Device Drivers-> character devices, select whether to compile it into M or * or. Then, modify the makefile in the corresponding directory, add the target dependency in the appropriate location, and add the target dependency in the same way as the original makefile. Just pay attention to the file name. Then execute the command make zimage. If you select the module, you also need to execute the command make
Modules, and then you can view the. Ko file in the corresponding source directory.

Perception: This method is suitable for the product stage and is directly fixed.

Method 3: Since the dependency between Kernel configuration and compilation is mentioned in method 2. You can directly modify the. config and makefile files. This method is the fastest and most effective.

In short, there are many compilation methods. We can choose the method we like to compile and install.



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.