Ubuntu: Error: 'Operation not permitted' from both insmod and modprobe [closed]


I am trying to insert a module in Ubuntu 14.04, but both

sudo insmod xpcie.ko  


sudo modprobe xpcie  

return the error

could not insert xpcie.ko: Operation not permitted  

I have placed a copy of xpcie.ko in /lib/modules/uname -r/kernel/drivers and have run

depmod -a xpcie.ko  

This module comes from Xilinx's XAPP1022. It was originally designed for Fedora 9. Could that be the cause of this error, and if so, what would I need to change in the module? If not, what else would cause this?



uname -r  

Returns 3.10.40-gb271e8f


It turns out that if a module tries to initialize a device using a major number that is already taken, insmod and modprobe will fail with the error message

operation not permitted  

For XAPP 1022 in particular, the driver tries to register a char device, to which it assigns the major number 240. There was already another device registered with that major number on my machine, which caused the driver to fail its init function.

The solution is to change

int gDrvrMajor = 240;  


int gDrvrMajor = {some major number that isn't taken}  

inside xpcie.c. It is then also necessary to change

mknod /dev/xpcie c 240 1  


mknod /dev/xpcie c {same other major number as above} 1  

inside make_device.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »