Compile the Android driver into Moudle and start automatically after booting

Source: Internet
Author: User

Let's say we've written the driver: xxx.c, and it works (Init match probe and so on are OK)

First look at the case of the driver compiled into the kernel , the main focus on the following several files:

In the drive folder, there is a sentence in the makefile:

obj-$(CONFIG_XXX)  += xxx.o

The kconfig under the Drive folder (for example, my kconfig.x86) are:

config XXX    "ABCD"    depens on YYYY    help        ...

There is a sentence in Arch/x86/configs/kkkk_defconfig:

CONFIG_XXX=y

(Do not leave blank spaces on both sides of the equals sign)

The driver is then compiled into module:

Makefile not change

Change the Kconfig to:

config XXX    "ABCD"    depends on YYYY    help        ...

In Defconfig, change to:

CONFIG_XXX=m

After the compilation is successful, the compiled module can be found in the directory android/out/target/product/your_image_name/obj/kernel/directory.
After the system is started, use ADB to view the/system/lib/modules/directory, you can also find the corresponding module.

Now that the driver has been included in our system, it is only in the form of Moudle, and the next task is to use the script to insmod the module when the system is started. The call to the script at system startup remains to be researched ...

Compile the Android driver into Moudle and start automatically after booting

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.