- 修改相关目录下的Kconfig文件,加入新增模块的描述:
例如:
vim drivers/net/Kconfig
menu "XXXX"
depends on NETDEVICES
config MY_NEW_DRIVER
tristate "My New Network Adaptor"
depends on PCI
---help---
This driver supports XXXX adapters. ...
此例中,在drivers/net/下面放入驱动源码,比如,mynewdriver
vim drivers/net/Makefile
加入 obj-$(CONFIG_MY_NEW_DRIVER) += mynewdriver/
vim drivers/net/mynewdriver/Makefile,加入如下内容:
#如果有额外的参数,可以加给CFLAGS
#CFLAGS += -XXX
#
obj-$(CONFIG_MY_NEW_DRIVER) += mynewdriver.o
ixgbe-objs := mynewdriver_main.o a.o b.o
- 重新make menuconfig,选中新加载的模块,测试。
阅读(1121) | 评论(0) | 转发(0) |