I have written a simple loadable kernel module. To create a character device file in /dev/ and a related class directory. The following lines I have added in the project.
MODULE_DESCRIPTION("GSM driver");
MODULE_LICENSE("Dual BSD/GPL");
MODULE_AUTHOR("Guruprasad");
MODULE_DESCRIPTION("A simple driver");
MODULE_VERSION("0.1");
While building I got the following warning
WARNING: modpost: missing MODULE_LICENSE() in /home/.../char_dev_gsm/GSM.o
While inserting I got the following error :
insmod: ERROR: could not insert module GSM.ko: Unknown symbol in module
Please help me with this.
The project has one main file (GSM.c) and an include file (device.c and device.h)
Please get the files from the following link. https://github.com/guruprasad-92/Device-Driver
I've tried with adding the line MODULE_LICENSE("Dual BSD/GPL");
in file device.c which results no warning messages and no error messages as well, but while inserting the module it neither creates the device file /dev/gsm0
nor updating the $dmesg
with printk()
related messages.
I have also tried with writing the functions register_dev()
and unregister_dev()
in the file GSM.c which did not results any warning, and created the the device /dev/gsm0
and class directory in /sys/class/
But I want to know why the file inclusion is giving warning while building.