开发者

compiling a driver

i require to convert a linux driver to android. can anyone help me with the kernel twiking ? is there a change to the driver makefile ? where to get the source files of the kernel ? can i use insmod/mknod开发者_高级运维 in adb shell to load the driver dynamically ?

any hint will be welcomed...

noam


Lots of questions...

Yes, you need to change the makefiles in the kernel. For example, if your driver source is in drivers/net, you'll need to change the Makefile there so that it builds your sources.

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

Kernel sources are available in the same way as the Android sources (see http://source.android.com); you have to add a .repo/local_manifest.xml file such as:

<?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 build your driver as a module then you can use insmod/rmmod to insert/remove it from a running kernel.

HTH!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜