LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-17-2008, 11:43 AM   #1
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Rep: Reputation: 31
how "modprobe" works?


Hello,
i am new to linux...can anyone tell me how this "modprobe" works when booting the kernel....how it fetches the modules path?
 
Old 12-17-2008, 12:21 PM   #2
MoonMind
Member
 
Registered: May 2005
Location: Switzerland
Distribution: Ubuntu
Posts: 448

Rep: Reputation: 38
Do you want to know how modprobe works (Google's your friend for this) or do you need to know how modules are scheduled for loading at boot? In this case, to a certain amount, it depends on the distribution you're using, so for more exact information, you'd need to provide a bit more information.

M.
 
Old 12-17-2008, 12:32 PM   #3
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
ya sure....i am using UBUNTU 7.10...version 2.6.26 kernel...
 
Old 12-17-2008, 12:38 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,495

Rep: Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981
Quote:
Originally Posted by shariefbe View Post
ya sure....i am using UBUNTU 7.10...version 2.6.26 kernel...
Uhh..so which is it? Do you want to know how modprobe works, or how the modules are loaded at boot?
 
Old 12-17-2008, 12:43 PM   #5
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
yes...i want to know this both things....how modprobe works and how modules loaded at boot time....
 
Old 12-17-2008, 01:19 PM   #6
MoonMind
Member
 
Registered: May 2005
Location: Switzerland
Distribution: Ubuntu
Posts: 448

Rep: Reputation: 38
Use Google to find out about modprobe (Wikipedia helps, too) or use man modprobe - documentation's on-board with GNU/Linux.

The rest is sifting through all of /etc/init.d - it's a bit of work, but it's extremely informative. I'd start by carefully reading the output of dmesg | less (less lets you scroll back and forth, leave the listing with "q") to find out something about what gets configured when. With that information (especially init states), it's easier to find a particular module or configuration script. It's a very educating experience.

M.
 
Old 12-17-2008, 01:26 PM   #7
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
yes i saw that directory /etc/init.d.......i cant understand whats that directory contains...i am newbie...can you help me to know more.....
 
Old 12-17-2008, 02:04 PM   #8
MoonMind
Member
 
Registered: May 2005
Location: Switzerland
Distribution: Ubuntu
Posts: 448

Rep: Reputation: 38
Okay, I didn't give you the best advice - I directed you to a directory where you find important scripts, but the actual information is elsewhere. But it's not really easier...

I'm not an expert on the stuff I'm going to talk about, so please, don't come down too hard on any shortcomings, I'm just trying to make things understandable, but what follows is far from complete.

Booting up means that an initial process, called init, takes the system through different phases, called "runlevels"; during every phase, certain parts of the system get configured and several services and sometimes applications are started. All hardware recognition and configuration happens in one of those phases. When exactly a specific module is called is visible in the configuration files within the runlevels' configuration directories. Those sit in /etc and are called "rc*.d" (where the "*" marks a number from 0 to 6 and the letter "S"). Looking through those directories gives you an idea of what gets done how and when. But as I said, if you don't use a file like /etc/modules to load specific modules, you'll find everything that's important somewhere in there. For instance, all "restricted" modules (those are mostly highly specific to the machine you're on - and for that reason, crucial) get loaded very early by a special tool; the script for that sits - accordingly - in /etc/rc0.d. Other stuff is only useful later, so it gets called in a later phase.

M.

Last edited by MoonMind; 12-17-2008 at 02:05 PM.
 
Old 12-17-2008, 08:51 PM   #9
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
ya thanks a lot...actually i am having the file called "/etc/modules"...

it contains

sharief@sharief-desktop:~$ cd /etc
sharief@sharief-desktop:/etc$ cat modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

fuse
lp

sharief@sharief-desktop:/etc$

i dont know how to deal with this...
 
Old 12-17-2008, 09:32 PM   #10
gankoji
Member
 
Registered: Nov 2007
Location: Southern California
Distribution: Slackware-13.0 x86_64, Slackware 12.2, slackware64-current
Posts: 225

Rep: Reputation: 35
Well, sharief, you've been a little too vague with your questions for us to answer you very clearly. If you're looking to load a specific module at boot time (say, your video driver or wireless driver) then you've already found what you're looking for. You can simply add the name of your driver's kernel module (whatever it is that you type in when you load it, i.e.

root@yourbox:/# modprobe DRIVER_NAME

)

Add DRIVER_NAME to that file (/etc/modules) just below lp.

If you're looking for some other type of information, you need to go about asking a bit differently.
 
Old 12-17-2008, 09:44 PM   #11
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
Thanks for your reply...actually i disabled the USB support when i compile the kernel...after that i planned to do that module manually i tried to insert dynamically...and it works nice when i use insmod "insmod".....but my USB port didnt work....so i decided to do with modprobe,so that all nessary module will install automatically....but when i use "modprobe" it tells that "FATAL :module not found"...so i used "depmod -a"....but i dont know the use of that command,one of my friend told me to use that...
after that i used "modprobe" now it works...and i saw that module in the "lsmod" too....but still my USB port is not working...

i used "usbcore" module to make USB to work...
 
Old 12-17-2008, 09:50 PM   #12
gankoji
Member
 
Registered: Nov 2007
Location: Southern California
Distribution: Slackware-13.0 x86_64, Slackware 12.2, slackware64-current
Posts: 225

Rep: Reputation: 35
Well I'm not too sure about your USB problem, that seems a little strange. What modules are loaded in your lsmod?

modprobe is a simple command that takes the name you give it as a parameter and checks against a list of built modules it has. If the module exists then it loads the module, and all of the modules upon which the first is dependent. The 'list' of current modules and their dependcies is created and maintained by using depmod. When you run a depmod -a, you tell your computer to search through the current module tree (/lib/modules/*Your_Kernel_Name*/) and find any modules that have been added since the last time the list was updated, and find out about their dependencies, etc. Hence why your usb module didn't work w modprobe until you established it with depmod.
 
Old 12-17-2008, 10:09 PM   #13
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
Thats i dont know why it didnt work...Thats why i planned to know how this "modprobe" works and from which path the modules are loaded when system boots?

Last edited by shariefbe; 12-17-2008 at 10:11 PM.
 
Old 12-17-2008, 11:51 PM   #14
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
now just i want to know the path from which the kernel is loading while booting?
 
Old 12-18-2008, 08:18 PM   #15
gankoji
Member
 
Registered: Nov 2007
Location: Southern California
Distribution: Slackware-13.0 x86_64, Slackware 12.2, slackware64-current
Posts: 225

Rep: Reputation: 35
the kernel itself loads from your /boot directory, along with the System.map and .config that belong to the corresponding symlinks in said directory.
 
  


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
"Minicom -s" works, but it always show "Offline", then cannot communicate with others reflecter_chen Linux - Hardware 8 05-14-2016 02:05 PM
evdev/xorg help? USB mouse/kbd: 2.6.24="just works">2.6.25="unplug/replug to work". GrapefruiTgirl Linux - Hardware 4 12-13-2012 02:23 PM
How to correct "yum" and "modprobe" when using ndiswrapper? BootLaptop Linux - Wireless Networking 2 07-15-2007 07:14 PM
commands "init" and "modprobe" not working Diagmato Fedora 2 07-22-2005 11:44 PM
"depmod" and "modprobe" commands don't work The1PatO Fedora 7 06-10-2004 12:10 PM


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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration