LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-23-2007, 09:33 PM   #1
jaepi
Member
 
Registered: Apr 2007
Location: Urban Jungle
Distribution: Ubuntu
Posts: 189
Blog Entries: 1

Rep: Reputation: 30
help with insmod and rmmod


hello there, im currently studying linux kernel, i have a problem..i can compile my program using gcc but i cannot run my module using the insmod command nor remove it using the rmmod...i viewed the list of commands i was not able to find these commands(insmod and rmmod)...what do you think is the problem?? my suspicion is i was not able to configure my applications well or i missed something when i installed my distro, btw im using fedora core 3...thanks...
 
Old 05-24-2007, 02:04 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you just can't run the programs? they both live in /sbin/ and *will* be there. maybe a path issue if you anre't logging in directly as root?
 
Old 05-24-2007, 04:08 PM   #3
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
try modprobe then
 
Old 05-25-2007, 02:10 AM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
You need to be root to run those commands.
 
Old 05-25-2007, 03:01 AM   #5
jaepi
Member
 
Registered: Apr 2007
Location: Urban Jungle
Distribution: Ubuntu
Posts: 189

Original Poster
Blog Entries: 1

Rep: Reputation: 30
i logged in as root and i tried using modprob...but no effect... i just passed by linux device drivers, just to have an idea on how modules are created and it's difference from an application..
 
Old 05-25-2007, 03:36 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
"no effect" really is no use... are you getting permission denied? command not found..??
 
Old 05-25-2007, 03:38 AM   #7
jaepi
Member
 
Registered: Apr 2007
Location: Urban Jungle
Distribution: Ubuntu
Posts: 189

Original Poster
Blog Entries: 1

Rep: Reputation: 30
im getting command not found...
 
Old 05-25-2007, 03:49 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
right so next time you ask a question, give information like that... so as i originalyl said, it'll be a path issue. try /sbin/insmod etc...
 
Old 05-25-2007, 04:08 AM   #9
jaepi
Member
 
Registered: Apr 2007
Location: Urban Jungle
Distribution: Ubuntu
Posts: 189

Original Poster
Blog Entries: 1

Rep: Reputation: 30
tried it...but im getting this one...

Code:
[dinglej@localhost dev-drive]$ /sbin/insmod ./hello.c
insmod: error inserting './hello.c': -1 Operation not permitted
 
Old 05-25-2007, 04:09 AM   #10
jaepi
Member
 
Registered: Apr 2007
Location: Urban Jungle
Distribution: Ubuntu
Posts: 189

Original Poster
Blog Entries: 1

Rep: Reputation: 30
shit, i was not logged as root...im trying it again...*sigh*
 
Old 05-25-2007, 04:13 AM   #11
jaepi
Member
 
Registered: Apr 2007
Location: Urban Jungle
Distribution: Ubuntu
Posts: 189

Original Poster
Blog Entries: 1

Rep: Reputation: 30
after logged as root, i got this one...

Code:
[root@localhost dev-drive]# /sbin/insmod ./hello.c
insmod: error inserting './hello
 
Old 05-25-2007, 06:39 AM   #12
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
the output of dmesg might show you more information.
 
Old 05-25-2007, 06:48 AM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,669

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
Quote:
Originally Posted by jaepi
after logged as root, i got this one...

Code:
[root@localhost dev-drive]# /sbin/insmod ./hello.c
insmod: error inserting './hello
Adding my 2 cents worth, from your post it appears that you are trying to load the source code and not the compiled module.

Last edited by michaelk; 05-25-2007 at 06:57 AM.
 
Old 05-27-2007, 08:18 PM   #14
jaepi
Member
 
Registered: Apr 2007
Location: Urban Jungle
Distribution: Ubuntu
Posts: 189

Original Poster
Blog Entries: 1

Rep: Reputation: 30
oh...so instead of hello.c, i will load hello.o?? but i still get the same error...
 
Old 05-28-2007, 01:51 AM   #15
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Is your hello a program or a kernel module? Sounds like it is not a valid kernel module.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rmmod: command not found ferradura Slackware 3 12-19-2006 01:42 PM
making sys call ex:insmod,rmmod from function in user module shashishankar_h Linux - General 1 09-01-2005 12:36 AM
rmmod -f not working R0UTE Linux - Software 0 10-27-2004 09:12 AM
rmmod and cron issue? Manuel-H Linux - Software 1 10-23-2004 07:05 AM
Why can't I use lsmod rmmod etc JohnSharp Linux - Newbie 4 04-08-2004 10:11 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration