前几天有个人写了个PATCH,但是无语的是,不知道怎么搞得一直就调试不出要的效果,后来在里面加了打印信息,不过就是看不到,开始以为是应为只对KERNEL进行编译所造成的,但是全部编译也没有用,后来才知道,这根本就没有设备去注册啊,这些驱动程序怎么会调到呢!无语的一天就这样开始了,看了别人写的平台设备文件:
1,打开相应的宏定义;使驱动有效啊
2,因为驱动程序已经写好了,所以只要写好相关的设备文件就可以了,而他们之间是通过name来匹配的,进行注册就可以了。
3,如果这个设备文件是新建立的,就需要在每个地方去让它编译,否则不会编译进去的
Makefile:
obj-y += platform_pp.o //obj-y 只默认情况下直接编译进去
obj-$(CONFIG_SENSORS_MS5607) += platform_ms5607.o //而这个CONFIG_SENSORS_MS5607 可以在相应的Kconfig文件中找到,但是体系架构相关的东西(arch/)它里面配置的可能分散在不同目录下的Kconfig.
eg:
linux-2.6/fs/ufs$ vim Makefile
#
# Makefile for the Linux ufs filesystem routines.
#
obj-$(CONFIG_UFS_FS) += ufs.o
ufs-objs := balloc.o cylinder.o dir.o file.o ialloc.o inode.o \
namei.o super.o symlink.o truncate.o util.o
linux-2.6/fs/ufs$ vim Kconfig
config UFS_FS ----------------------->这个是CONFIG_UFS_FS 去掉config的宏定义,还记得在make menuconfig(呵呵,刚刚我就随便在PC机上的某个目录中敲如了 make menuconfig,结果没有出现我想要的现象,后来同事才告诉我是应为这个命令是要在kener下目录下运行的,这是选择对模块的编译,它会自带拷贝到相应的目录中,但等到系统运行起来,需要什么模块,就会自动的到相应的路径中去加载模块)
tristate "UFS file system support (read only)"
depends on BLOCK
help
BSD and derivate versions of Unix (such as SunOS, FreeBSD, NetBSD,
OpenBSD and NeXTstep) use a file system called UFS. Some System V
Unixes can create and mount hard disk partitions and diskettes using
this file system as well. Saying Y here will allow you to read from
these partitions; if you also want to write to them, say Y to the