LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   more about linux drivers & modules? (https://www.linuxquestions.org/questions/linux-newbie-8/more-about-linux-drivers-and-modules-35815/)

mrengc 11-18-2002 08:23 PM

more about linux drivers & modules?
 
I am new linux fan so bare with me.

I am wanting to find out more about installing drivers for devices in linux. Is the actual terminology called inserting a module and re-compiling the kernel?

Please someone explain to me in exact terminology the process of getting a device to work in linux with a new downloaded driver. If possible, delve into the stuff about tar balz? compression? etc etc.

Psycho 11-18-2002 10:14 PM

What the hey, I'll give it a go.

Most traditional Linux users recompile the kernel to optimize it for their hardware. Linux as distribuited is intended to support as much hardware as is reasonably possible, so the odds of it being usable 'out of the box' are greater for the majority. For instance; You don't need every network card driver known to man (or machine), just the one for your card.

If you download a driver (or a module) as a tarball. You have to unpack it (see man tar, man gzip) Like unzipping a zip file... Lots of folks recommend working out of your home dir to do this... Personal preference I think.

Then you have to compile it, you pretty much have to have the kernel development stuff installed and have compiled the kernel to do this. Unless you're running the 'stock' kernel, which would match your kernel source stuff which you still need to have installed.

Most packages come with things all set up to make it reasonably easy to to do this. Usually this is outlined in a readme or something of that natrue. Or documented where you obtained the tarball. Frequently both.

Traditionally ./configure, make, and make install for 'software packages; and maybe ./configure make and insmod... for drivers I think.

After compiling it, one has to install it. Either adding it, along with any arguments or whatever to etc\modules or modules.config or whatever your distro uses... Or one one can test it 'on the fly' by doing an insmod on it (insert or install? module) again with any appropriate arguments... Note after testing it, you would still add it to modules so it's loaded automatically at boot time.

You can choose to build some drivers / modules into the kernel, or keep them as modules. Smaller kernels load faster and are more portable, like if you needed Linux on a floppy for a rescue disk or whatever.

Some folks like to make the kernel as small as possible, just to see who can be 'lete (eliete), super hacker, etc... Whatever, I'm happy if everything works well and boots quickly myself. I have plenty of room for the kernel.

This is the $0.05 tour, of the whole idea. I probably have a detail or two fuzzy or completely off base, but that's the general idea. And someone will no doubt point out my errors, then I learn too ;)

--g

For that matter, someone probably spun out a better explanation while I was wavering on how to put this 'n that...

http://www.linuxnewbie.org/nhf/Compiling_Kernels
http://www.linuxjunior.org/cgi-bin/p...=Category&id=3

aaronruss 03-21-2004 04:29 PM

Is there any thing like a device manager where you can quickley install drivers with out having to recompile the kernal?

smehi 03-21-2004 04:38 PM

You dont need to recompile your kernel to install drivers. Including support for your hardware in the kernel is optional (except of course, things like IDE controller, chipset etc etc).

If you wanted to say, install a driver for a sound card, where support is not built into the kernel, you would download either a Package, and use the utility for that package type (distro-dependant), or download the source.

If compiling from source, you should
A) ./configure (if it doesnt want to, theres no need to worry about this)
B) make && make install

From my experience (I could be wrong here), doing make install should setup the driver to be ready to use (copy files to the appropriate directory, and modprobe (load) them).

To see what modules (drivers), are loaded, type lsmod
If you build the driver package, but it doesnt modprobe, you will have to type "modprobe DRIVERNAME"
If you then want it to load on startup you need to add that line to your startup script (files are named different depending on distro).
In slackware, I know I add module loads to /etc/rc.d/rc.local, although I believe the proper way is to add the line to /etc/modprobe.conf or conf.modules. I'm really hazy on which startup file to add the line to, so if you get to the "modprobe MODULENAME" stage, and it works, you might want to check around for the proper file to add that line to, instead of guessing at it like I am. =)

The benefit of kernel builtin modules, is that they load automatically, and it can (apparently) speed up your system. Im a newbie too though, so I don't really know the reason. . .


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