hi all, while inserting module to the linux kernel, m facing this problem -------------------------------------------ERROR----------------------------------------------------- sunil@ubuntu:~/test/drive$ insmod helloworld.ko insmod: error inserting 'helloworld.ko': -1 Operation not permitted sunil@ubuntu:~/test/drive$ sudo modprobe helloworld FATAL: Module helloworld not found. please help!! thanks & regards Sunil
Try it through root access. Regards ASHU -----Original Message----- From: kernelnewbies-bounces@kernelnewbies.org [mailto:kernelnewbies-bounces@kernelnewbies.org] On Behalf Of sunil Sent: Monday, February 11, 2013 3:24 PM To: kernelnewbies@kernelnewbies.org Subject: error : insmod hi all, while inserting module to the linux kernel, m facing this problem -------------------------------------------ERROR----------------------------------------------------- sunil@ubuntu:~/test/drive$ insmod helloworld.ko insmod: error inserting 'helloworld.ko': -1 Operation not permitted sunil@ubuntu:~/test/drive$ sudo modprobe helloworld FATAL: Module helloworld not found. please help!! thanks & regards Sunil _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
On 02/11/2013 01:54 AM, sunil wrote:
hi all, while inserting module to the linux kernel, m facing this problem -------------------------------------------ERROR-----------------------------------------------------
sunil@ubuntu:~/test/drive$ insmod helloworld.ko insmod: error inserting 'helloworld.ko': -1 Operation not permitted
sunil@ubuntu:~/test/drive$ sudo modprobe helloworld FATAL: Module helloworld not found.
It is a path issue, you need to specify the entire path to helloworld.ko. For example: sudo insmod /path/to/your/helloworld.ko
On 2013-02-11 15:24:08 (+0530), sunil <sunil.slvphsn@gmail.com> wrote:
while inserting module to the linux kernel, m facing this problem -------------------------------------------ERROR-----------------------------------------------------
sunil@ubuntu:~/test/drive$ insmod helloworld.ko insmod: error inserting 'helloworld.ko': -1 Operation not permitted
For obvious reasons normal users are not allowed to load kernel modules. This requires root access (or more accurately, CAP_SYS_MODULE capabilities). That's why your insmod fails.
sunil@ubuntu:~/test/drive$ sudo modprobe helloworld FATAL: Module helloworld not found.
This is a different action from 'insmod helloworld.ko'. modprobe tries to load the module from /lib/modules/`uname -r`. It's slightly more convenient because it will also load all modules this one depends on. In this case this fails because your module doesn't actually live in /lib/modules/.... Try sudo insmod helloworld.ko instead. Regards, Kristof
participants (4)
-
Ashish_Bunkar@Dell.com -
Jeff Kirsher -
Kristof Provost -
sunil