LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-14-2008, 06:34 AM   #1
FS8880
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Rep: Reputation: 0
Is modules and drivers are same


Hi,

What is meant by a module in linux? Is modules and drivers are same ?
How can we install drivers in linux? What format drivers has? Is it like rpm files?

For example If I buy a new hardware How I can Install the driver in linux for the same?

lsmod command lists all modules which is configured.
 
Old 08-14-2008, 07:18 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060
A module is code that can be added to a running kernel dynamically; i.e., you do not need to recompile the entire kernel to add (or, for that matter, remove) module code because you can simply load it and unload from the running kernel at will (within reason). What we know as "drivers" are code that lets the kernel communicate with, say, a device (like a graphics controller) and many of those are written as modules that may be included or excluded (if you don't have a particular device you probably don't need to have the code for it in your kernel) dynamically. Take a look at this link http://tldp.org/HOWTO/Module-HOWTO/x73.html for a fuller explanation.

When you buy a piece of hardware it's likely that there will be a module ("driver") already available for it in Linux -- but, if it's cutting-edge, that may not be true (always a good idea to check first). Some hardware vendors -- H-P comes to mind -- provide software for their products for Linux, others don't for various reasons (one would be a lack of funds and expertise to produce Linux code); bear in mind that hardware vendors are targeting a massive market and Linux is pretty tiny when compared to Windows so we sometimes have to wait.

Hope this helps some.
 
Old 08-14-2008, 08:36 AM   #3
FS8880
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by tronayne View Post
A module is code that can be added to a running kernel dynamically; i.e., you do not need to recompile the entire kernel to add (or, for that matter, remove) module code because you can simply load it and unload from the running kernel at will (within reason). What we know as "drivers" are code that lets the kernel communicate with, say, a device (like a graphics controller) and many of those are written as modules that may be included or excluded (if you don't have a particular device you probably don't need to have the code for it in your kernel) dynamically. Take a look at this link http://tldp.org/HOWTO/Module-HOWTO/x73.html for a fuller explanation.

When you buy a piece of hardware it's likely that there will be a module ("driver") already available for it in Linux -- but, if it's cutting-edge, that may not be true (always a good idea to check first). Some hardware vendors -- H-P comes to mind -- provide software for their products for Linux, others don't for various reasons (one would be a lack of funds and expertise to produce Linux code); bear in mind that hardware vendors are targeting a massive market and Linux is pretty tiny when compared to Windows so we sometimes have to wait.

Hope this helps some.

Thank you very much Tronayne.

How to install modules/drivers in linux?
Is it like rpm installation #rpm -ivh ---------.rpm
 
Old 08-14-2008, 08:55 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Usually, there already is a kernel module that can control your device. Most kernel development is in writing drivers. If you run "lspci -v" you will get a listing of the devices connected to the PCI bus. Often, a class of hardware devices will use the same controller chip and that is what the kernel controls. Once you determine the hardware you need to control, you can try search on google to find out which kernel module you need. If you have the kernel source installed, the /usr/src/linux-<version>/Documentation/ directory may contain information as well. Most stock kernels have the loadable module compiled and will detect what you need.

Wireless devices can be difficult. The manufacturers may not release the specs on the device or any source code. For some wireless devices that use the b43 driver, you need to install a b43-fwcutter package (your disto will have it) that cuts firmware from a driver written for windows. This one isn't so hard because the b43-fwcutter program has a script "/usr/sbin/install_bcm43xx_firmware" that will download the driver you need, cut out the firmware and save files it creates. Another group of wireless devices need to wrap the entire windows driver and use it to control the device. This is the ndiswrapper package.

Some like the nvidia propriety driver have an install program that you run as root and it compiles the nvidia.ko driver and installs it. There are also packages that have this precompiled for some distro's. This will taint the kernel, so if you use it, don't plan on submitting kernel bug reports.

For the vast majority of devices, there are already kernel modules for them that come with the kernel. It depends whether the kernel was compiled with the module built in or as a module. If not, you may need to re-configure and build a new kernel. The stock kernels that come with a distro usually have everything you may need enabled to avoid this. Many people will reconfigure a kernel, disabling support they don't need, to slim down their kernel.

So to answer your last question, usually you use the modprobe command. Sometimes you install a package, like an rpm. Sometimes you run an install program. It depends on the device you have and how helpful the manufacturer is in working with the kernel developers to help write a kernel driver.
 
Old 08-14-2008, 09:03 AM   #5
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060
Usually modules will come from your distribution (and may be in an RPM or some other "package" form), from a vendor or from a add-on package.

For example, ATI provides drivers (in the form of modules and additional software) for many of their products; e.g., Radeon graphics boards and chips, and they're provided by ATI with an installer utility that does all the work for you. ATI considers their drivers proprietary and don't hand out the source code but they do give away usable modules that are dynamically loaded into the kernel at boot time.

Note that not all -- in fact I believe very few -- additional software you add to your system will include modules; modules are specifically for the kernel and won't typically be used for other purposes.
 
Old 08-19-2008, 04:26 AM   #6
FS8880
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Hi,

Thanks for the help.
Where these all installed drivers located?

How to see Cicso fiber channel cable device and How we install Cicso fiber channel channel cable driver?

Please help me in this regard also.

Thanks in advance.
 
Old 08-19-2008, 04:36 AM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Usually the start is to run "lspci -v" to see what controller the device uses. Then try google, or your network config gui program. The device may be detected. Also install the kernel source and kernel docs packages and see if the device is listed. You also need to be more exact on which device you are referring to. It describes transceiver modules that plug into cisco routers which I don't think you mean.

I'm not familiar with this device. If it is iSCSI, investigate these kernel modules:
locate scsi_ | grep ko | grep -v xen
/lib/modules/2.6.25.11-0.1-default/kernel/drivers/scsi/iscsi_tcp.ko
/lib/modules/2.6.25.11-0.1-default/kernel/drivers/scsi/scsi_debug.ko
/lib/modules/2.6.25.11-0.1-default/kernel/drivers/scsi/scsi_mod.ko
/lib/modules/2.6.25.11-0.1-default/kernel/drivers/scsi/scsi_tgt.ko
/lib/modules/2.6.25.11-0.1-default/kernel/drivers/scsi/scsi_transport_fc.ko
/lib/modules/2.6.25.11-0.1-default/kernel/drivers/scsi/scsi_transport_iscsi.ko
/lib/modules/2.6.25.11-0.1-default/kernel/drivers/scsi/scsi_transport_sas.ko
/lib/modules/2.6.25.11-0.1-default/kernel/drivers/scsi/scsi_transport_spi.ko
/lib/modules/2.6.25.11-0.1-default/kernel/drivers/scsi/scsi_transport_srp.ko
/lib/modules/2.6.25.11-0.1-default/kernel/drivers/scsi/scsi_wait_scan.ko

You might also look into articles on clusters. I think that may be used to connect hosts in a cluster. Also check the Cisco website.
 
Old 10-03-2008, 09:41 AM   #8
gcy
LQ Newbie
 
Registered: Jun 2007
Distribution: gentoo
Posts: 26

Rep: Reputation: 15
FS8880

Might I suggest you beg, buy or borrow a book (there are many available) about linux? I am sure the answers you have received must do nothing but confuse if you are totally new to linux. No:... a module is not necessarily a driver, it is what the name implies, a small unit of code which can be inserted or removed as required.

I suggest, if you are new to linux, that you:

1: Check with the manufacturers/suppliers, or by a search on the internet, that the hardware you wish to install will function on linux. If you already own the hardware you could try a live CD/DVD to see if that picks it up.

2: If the hardware is not picked up by the software you are running, then you could try a fresh installation, to see if the necessary modules are automatically installed.

lspci -v will only tell you which devices you have installed in your pci slots, and lsusb -v those on your USB bus.

Unfortunately, most packaged hardware will include a statement to the effect that it will work with Windows98 WindowsXP Windows Vista, and occasionally with Apple Mac. I don't think, in 15 years of working with linux I have ever seen "Linux" on the box. One has to hunt around to find where some kind soul has taken the trouble to write a "module".

So...; if you intend to stick with linux, I suggest you go out and find that book which tells you how to compile a kernel, and install a module!

Last edited by gcy; 10-03-2008 at 09:56 AM.
 
  


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
how to install tvtime and what modules and drivers it needs? Fleshless Linux - Software 1 02-11-2008 12:07 PM
Problems with modules.h and drivers segapla Red Hat 2 08-19-2005 07:40 AM
modules.conf with multiple drivers? sausagejohnson Linux - Hardware 4 08-17-2005 07:49 PM
more about linux drivers & modules? mrengc Linux - Newbie 3 03-21-2004 04:38 PM
Sound drivers aren't in rc.modules Oooska Linux - Newbie 1 01-29-2002 03:32 AM


All times are GMT -5. The time now is 07:18 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration