LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Is modules and drivers are same (https://www.linuxquestions.org/questions/linux-newbie-8/is-modules-and-drivers-are-same-662718/)

FS8880 08-14-2008 06:34 AM

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.

tronayne 08-14-2008 07:18 AM

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.

FS8880 08-14-2008 08:36 AM

Quote:

Originally Posted by tronayne (Post 3247253)
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

jschiwal 08-14-2008 08:55 AM

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.

tronayne 08-14-2008 09:03 AM

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.

FS8880 08-19-2008 04:26 AM

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.

jschiwal 08-19-2008 04:36 AM

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.

gcy 10-03-2008 09:41 AM

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!


All times are GMT -5. The time now is 04:29 AM.