为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 studio打包apk时遇见的一些问题
- android ListView中添加ImageButton按钮并绑定事件
- Activity去除标题栏和状态栏
- android添加广告之--有米
- android 显示系统 surfaceflinger 分析
- Android运行机制
- Android(安卓)TextView跑马灯效果
- android 有关怎么自己添加系统级服务 java层 重点aidl
- Android(安卓)Studio之编译t提示Invoke-customs are only suppor