Driver compilation

I need to convert Linux driver to android. can anyone help me with twiking core? are there any changes to the makefile driver? where to get the kernel source files? can i use insmod / mknod in adb shell to dynamically load driver?

any greetings would be welcome ...

Noam

+3
source share
1 answer

A lot of questions ...

Yes, you need to modify the makefiles in the kernel. For example, if your driver source is in the drivers / network, you will need to modify the Makefile there so that it creates your sources.

You will also need to add a new configuration setting in the Kconfig file so that the build process knows if you need to create your sources if it should be built as a module, etc. You will need to run 'make oldconfig' or similar to include your new option in the .config kernel.

Kernel sources are available in the same way as Android sources (see http://source.android.com ); you need to add the .repo / local_manifest.xml file, for example:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
 <project path="kernel" name="kernel/omap"
revision="refs/heads/android-omap-2.6.29"/>
</manifest>

And yes, if you create your driver as a module, you can use insmod / rmmod to insert / remove it from a working kernel.

NTN!

0
source

Source: https://habr.com/ru/post/1756570/


All Articles