为Android内核添加新驱动,并添加到menuconfig菜单
为Android内核添加新驱动,并提供menuconfig选项 为Android的Linux内核2.6.25添加驱动。 1. 在drives目录下添加hello目录,内含hello.c Kconfig Makefile static int hello_init(void) printk(KERN_ALERT"Goodbye, cruel world/n"); module_init(hello_init); config HELLO tristate "Hello Driver added by Dong" default n help test for adding driver to menuconfig. MakeFile内容:
在drivers/Kconfig menu "Device Drivers" endmenu之间添加 (不知为什么arch/arm/Kconfig中竟然含有Drivers里Kconfig内容的一个复本, 3.修改Drivers目录下的Makefile文件,添加如下行, linux-2.6.25目录下make menuconfig,在Device Drivers菜单下选中Hello Driver added by Dong项比如M,作为module。然后保存配置,执行make命令,就可以看到 CC [M] drivers/hello/hello.o 的log了,hello目录里生成了hello.o hello.ko的等文件。 流程: |
更多相关文章
- Android(安卓)端如何添加自定义表情
- Fragment沉浸式
- 自己写的一个在线汇率转换工具-MoneyDroid sources
- android SQLiteDatabase之一
- Android(安卓)签名失败 Lint found fatal errors while assembli
- [置顶] Android(安卓)[Dex Loader] Unable to execute dex:
- AndroidStudio打包出现问题: `Error:Execution failed for task
- android socket client
- 编译Android时,添加或者删除system.img中第三方apk、更改Android