after command make I call command sudo insmod example1.ko , I am insertig password and then I had error like this insmod error: could not insert module example1.ko: Invalid module format. My version of ubuntu is 5.8.0-44-generic and version of my example1.ko is 5.8.0-38-generic. Maybe these version should me same? I have been trying change in my Makefile from /lib/modules/($ shell uname -r)/build to /lib/modules/5.8.0.-38-generic/build but still was the same error. I have no idea how to fix this problem.
I used command dmesg to search more information about problem and I found some errors
example1: version magic '5.8.0-38-generic SMP mod_unload' should be '5.8.0-44-generic SMP mod_unload' and there are more six lines with same problem and two errors Failed to send host log message.
My Makefile file looks in this way :
obj-m := example1.o default: make -C /lib/modules/5.8.0-44-generic/build M=$(PWD) modules clean make -C /lib/modules/5.8.0-44-generic/build M=$(PWD) clean I ran make clean ; make but it had no effect.