LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   modprobe or insmod? (https://www.linuxquestions.org/questions/linux-newbie-8/modprobe-or-insmod-168522/)

GT_Onizuka 04-10-2004 03:59 PM

modprobe or insmod?
 
This has always bothered me as they seem to do the same thing. What's the difference between insmod and modprobe? Is there a benefit to using one over the other?

AutOPSY 04-10-2004 05:14 PM

modprobe, I think may try to set detected values for a module, that uses hardware, as insmod, will just insert the module for the device without parameters or settings 'OR' the modules own default settings.

Not sure.
Perhaps someone else has a better explanation.

Mara 04-10-2004 05:29 PM

Insmod just installs the module you specify. If it requires another one that's not loaded, the operation fails.
Modprobe loads the module you specify and all dependencies.

GT_Onizuka 04-10-2004 05:32 PM

Cool, another question, to get my joytick working, I have to do modprobe joydev, do I have to do this while its plugged in? Or can I do it then plug it in, and expect the device to work?

Mara 04-10-2004 05:41 PM

Don't have a joystick, so it's hard to say but probably when you run modprobe without it plugged in, it'll fail. But it depends. Test it :)

GT_Onizuka 04-10-2004 05:49 PM

Hm, I guess that was a bad idea :P. I had joydev already loaded, so I unplugged it then plugged it back in, and launched ZSNES. Instead of just giving me a message about one joystick, its convinced there are two.
Code:

Joystick 0 (2 Buttons): /dev/input/js0
Joystick 1 (32 Buttons): 0b43:0003

And the joystick doesn't work in ZSNES :(. I can't remove the module either
Code:

root@onizuka:ynadji$ rmmod joydev
joydev: Device or resource busy

Any idea on how to force remove a module?

Perhaps I should've removed it first...

Mara 04-10-2004 05:55 PM

Make sure all programs using the module are closed, then it should be possible to remove the module.
Good thing is that it looks you can load the module and then plug in the device.

GT_Onizuka 04-10-2004 06:03 PM

Ah, I had XMMS running, and I have a joystick plug-in for that thing. Should've checked on that before. And I can modprobe, then insert the USB adapter, and it works perfectly. Totally sweet.


All times are GMT -5. The time now is 03:37 PM.