Re: error : insmod

2013-02-11 Thread Kristof Provost
On 2013-02-11 16:50:45 (+0530), sunil  wrote:
> when i executed the below line. i din't get what i suppose to
> get...the message "hello, world"..
> 
> did i miss any steps
> sunil@ubuntu:~/test/drive$ sudo insmod helloworld.ko
> 
The traces you've inserted in your kernel module do not print to stdout.
They get logged in the kernel ring buffer.

Try 'dmesg' after loading your module.

Regards,
Kristof


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: error : insmod

2013-02-11 Thread sunil
Hi kristof,

when i executed the below line. i din't get what i suppose to
get...the message "hello, world"..

did i miss any steps
sunil@ubuntu:~/test/drive$ sudo insmod helloworld.ko


On Mon, Feb 11, 2013 at 4:34 PM, Kristof Provost  wrote:
> On 2013-02-11 16:24:17 (+0530), sunil  wrote:
>> Have a look at this:
>>
>> donno wats happening:
>>
>> sunil@ubuntu:~/test/drive$ sudo rmmod helloworld
>> sunil@ubuntu:~/test/drive$ lsmod|grep hellow*
>> Binary file helloworld.ko matches
>> Binary file helloworld.o matches
>
> This doesn't actually do what you seem to think it does.
> You're not passing the 'hellow*' argument to grep. The 'hellow*' is
> first expaned by your shell, so it probably turns that command line into
> 'lsmod | grep helloworld.c helloworld.o helloworld.ko'.
> Try using 'lsmod | grep hellow' instead (i.e. without the *).
>
>> sunil@ubuntu:~/test/drive$ modprobe -r helloworld
>> FATAL: Module helloworld not found.
>
> Obviously, because your previous command succeeded. The module is no
> longer loaded.
>
> Regards,
> Kristof
>
> PS: Please don't top-post.
> PS 2: Please keep the mailing list in cc.
>



-- 

Regards,
Sunil A S

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: error : insmod

2013-02-11 Thread Kristof Provost
On 2013-02-11 16:24:17 (+0530), sunil  wrote:
> Have a look at this:
> 
> donno wats happening:
> 
> sunil@ubuntu:~/test/drive$ sudo rmmod helloworld
> sunil@ubuntu:~/test/drive$ lsmod|grep hellow*
> Binary file helloworld.ko matches
> Binary file helloworld.o matches

This doesn't actually do what you seem to think it does.
You're not passing the 'hellow*' argument to grep. The 'hellow*' is
first expaned by your shell, so it probably turns that command line into
'lsmod | grep helloworld.c helloworld.o helloworld.ko'.
Try using 'lsmod | grep hellow' instead (i.e. without the *).

> sunil@ubuntu:~/test/drive$ modprobe -r helloworld
> FATAL: Module helloworld not found.

Obviously, because your previous command succeeded. The module is no
longer loaded.

Regards,
Kristof

PS: Please don't top-post.
PS 2: Please keep the mailing list in cc.


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: error : insmod

2013-02-11 Thread Kristof Provost
On 2013-02-11 16:10:38 (+0530), sunil  wrote:
> -output
> sunil@ubuntu:~/test/drive$ sudo insmod ./helloworld.ko
> insmod: error inserting './helloworld.ko': -1 File exists
> 
This means you've already loaded the module.

Try 'sudo rmmod helloworld' to unload it first.
This should generate the 'Goodbye, cruel world' dmesg trace.
After that you can load the module again.

Regards,
Kristof

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: error : insmod

2013-02-11 Thread Kristof Provost
On 2013-02-11 15:24:08 (+0530), sunil  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


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: error : insmod

2013-02-11 Thread Jeff Kirsher
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



signature.asc
Description: OpenPGP digital signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


RE: error : insmod

2013-02-11 Thread Ashish_Bunkar
Try it through root access.

Regards
ASHU

-Original Message-
From: kernelnewbies-boun...@kernelnewbies.org 
[mailto:kernelnewbies-boun...@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

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


error : insmod

2013-02-11 Thread sunil
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