How do I tell Linux what driver to use?

How do I tell Linux what driver to use?

With most Linux distributions, the drivers exist as loadable modules, which are small binary files that are merged with the operating system at run time. A module gives the operating system (kernel) the information on how to control that particular ethernet card. The name of each module is listed in the heading of the section for each card in this document. Once you know the name of the module, you have to add it to the file /etc/modules.conf so Linux will know what module to load for your card. The syntax is typically as follows.

        alias eth0 module_name
options module_name option1=value1 option2=value2 ...

The options line is typically only needed for older ISA hardware. For multiple card systems, additional lines with eth1, eth2 and so on are usually required.

The module files typically live in the directory /lib/modules/ which is further subdivided by kernel version (use uname -r) and subsystem (in this case net). These are put there by the distribution builder, or by the individual user when they run make modules_install after building their own kernel and modules (see the kernel howto for more details on building your own stuff).

If you build your own kernel, you have the option of having all the drivers merged with the kernel right then and there, rather than existing as separate files. When this is done, the drivers will detect the hardware at boot up. Options to the drivers are supplied by the kernel command line prior to boot (see BootPrompt Howto for more details). The user chooses what drivers are used during the make config step of building the kernel (again see the kernel howto).

No comments:

Post a Comment