分类:
2005-10-13 12:59:53
insmod 的时候出错:
[root@localhost 07-TalkingToDeviceFiles]# insmod chardev.o
chardev.o: unresolved symbol module_unregister_chrdev
chardev.o: unresolved symbol module_register_chrdev
chardev.o:
Hint: You are trying to load a module without a GPL compatible license
and it has unresolved symbols. The module may be trying to access
GPLONLY symbols but the problem is more likely to be a coding or
user error. Contact the module supplier for assistance, only they
can help you.
google了一下,发现没有module_register_chrdev()和module_unregister_chrdev()。
于是修改代码:
module_register_chrdev()为register_chrdev()
module_unregister_chrdev()为unregister_chrdev()
然后insmod的时候又出错
[root@localhost 07-TalkingToDeviceFiles]# insmod chardev.o
Warning: loading chardev.o will taint the kernel: no license
See for information about tainted modules
chardev.o: init_module: Device or resource busy
Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters.
You may find more information in syslog or the output from dmesg
dmsg内容如下:
Sorry, registering the character device failed with -16
然后 cat /proc/devices
发现major num 100已经使用,
于是修改 chardev.h
#define MAJOR_NUM 200
then ok