为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 TabHost小结
- Android添加垂直滚动ScrollView
- 2011.07.05(2)——— android PopupWindow
- ubuntu下无法更新android sdk
- android读写文件
- Linearlayout 添加divider
- Android(安卓)Wear Preview- 为通知添加多个页面(Adding Pages to
- 2011.09.09(2)——— android 桌面添加快捷方式
- Android复制粘贴到剪贴板