Configuring Hardware


The following section describes how to add and reconfigure hardware using kudzu. The section after that describes how to manage loadable modules when hardware isn't being detected and configured properly.

Reconfiguring hardware with kudzu

When you add or remove hardware from your computer and reboot Fedora, a window appears during the reboot process advising that hardware has either been added or removed and asking if you want to reconfigure it. The program that detects and reconfigures your hardware is called kudzu.

The kudzu program is a hardware autodetection and configuration tool that runs automatically at boot time. If you like, you can also start kudzu while Fedora is running. In either case, here is what kudzu does:

  1. It checks the hardware connected to your computer.

  2. It compares the hardware it finds to the database of hardware information stored in the /etc/sysconfig/hwconf file.

  3. It prompts you to change your system configuration, based on new or removed hardware that was detected.

The following is a list of hardware that kudzu can detect (according to the kudzu README file), followed by a description of what kudzu does to configure the device. Other devices may be detected as well (such as USB devices).

  • Network devices — Adds an Ethernet interface alias (eth0, eth1, and so on) if necessary and either migrates the old device configuration or creates a new one.

  • SCSI — Adds an alias for scsi_hostadapter.

  • Sound card — Runs the sndconfig command to configure and test the sound card.

  • Mouse — Links the new mouse device to /dev/mouse and runs the mouseconfig command to configure and test the mouse.

  • Modem — Links the new modem device to /dev/modem.

  • CD-ROM — Links the CD-ROM device to /dev/cdrom.

  • Scanner — Links the new scanner device to /dev/scanner.

  • Keyboard — Runs the kbdconfig command to reconfigure the keyboard. Also, if you are using a serial console, it makes sure /etc/inittab and /etc/securetty are configured to be used by a serial console.

The following is a list of actions kudzu takes when a device is removed:

  • Network — Removes the alias for the Ethernet interface (eth0, eth1, and so on).

  • SCSI — Removes the alias for the SCSI host adapter (scsi_hostadapter).

  • Mouse — Removes the link to /dev/mouse.

  • Modem — Removes the link to /dev/modem.

  • CD-ROM — Removes the link to /dev/cdrom.

  • Scanner — Removes the link to /dev/scanner.

To run kudzu, either reboot (during the reboot, kudzu is run automatically) or switch to a virtual terminal (Ctrl+Alt+F2), log in as root, and run the kudzu command. For any hardware that has been added or removed since the last time kudzu was run, you are asked if you want to configure it, not configure it, or do nothing.

Configuring modules

In a perfect world, after installing and booting Linux, all of your hardware should be detected and available for access. While Fedora and other Red Hat Linux systems are rapidly moving closer to that world, there are times when you must take special steps to get your computer hardware working.

Fedora systems come with tools for configuring the drivers that stand between the programs you run (such as CD players and Web browsers) and the hardware they use (such as CD-ROM drives and network cards). The intention is to have the drivers your system needs most often built into the kernel; these are called resident drivers. Other drivers that are added dynamically as needed are referred to as loadable modules.

Finding available modules

If you have installed the Linux kernel source code that comes with Fedora (as described in Chapter 27), source code files for available drivers are stored in subdirectories of the /usr/src/redhat/BUILD/kernel-*/linux-2.6*/drivers directory. There are several ways of finding information about these drivers:

  • make menuconfig — With linux-2.6* as your current directory, type make menuconfig from a Terminal window on the desktop. Select the category of module you are interested in and select Help for the driver that interests you. The help information that appears tells you the module name and a description of the driver.

  • Documentation — The linux-2.6*/Documentation directory contains lots of plain-text files describing different aspects of the kernel and related drivers.

  • kernel-doc — The kernel-doc software package (available on the DVD that comes with this book) contains a large set of documents describing the kernel and drivers. These documents are stored in the /usr/share/doc/kernel-doc* directory.

After modules have been built, they are installed in the /lib/modules/2.6* directory. The name of the directory is based on the current release number of the kernel. Modules that are in that directory can then be loaded and unloaded as they are needed.

Note 

In previous releases, Fedora and other Red Hat Linux systems stored modules in the /lib/modules directory, rather than the /lib/modules/2.6* directory. This new structure allows you to store modules on your system that relate to different kernel versions you may be running.

Listing loaded modules

To see which modules are currently loaded into the running kernel on your computer, you can use the lsmod command. Here’s an example:

# lsmod  Module                  Size  Used by  snd_seq_oss            38912  0   snd_seq_midi_event      9344  1 snd_seq_oss  snd_seq                67728  4 snd_seq_oss,snd_seq_midi_event  snd_seq_device          8328  2 snd_seq_oss,snd_seq  .  .  .  autofs                 16512  0   ne2k_pci                9056  0   8390                   13568  1 ne2k_pci  ohci1394               41860  0   ieee1394              284464  1 ohci1394  floppy                 65712  0   sg                     36120  0   scsi_mod              124600  1 sg  parport_pc             39724  0   parport                47336  1 parport_pc  ext3                  128424  2   jbd                    86040  1 ext3  

This output shows a variety of modules that have been loaded on a Linux system. The modules loaded on this system include several to support the ALSA sound system, including some that provide OSS compatibility (snd_seq_oss).

To find information about any of the loaded modules, you can use the modinfo command. For example, you could type the following:

# modinfo snd-seq-oss  filename:       /lib/modules/2.6.8-1.541/kernel/sound/core/seq/oss/snd- seq-oss.ko  author:         Takashi Iwai <tiwai@suse.de>  description:    OSS-compatible sequencer module  license:        GPL  alias:          sound-service-?-1  alias:          sound-service-?-8  parm:           seq_oss_debug:debug option  parm:           maxqlen:maximum queue length  vermagic:       2.6.8-1.541 686 REGPARM 4KSTACKS gcc-3.4  depends:        snd,snd-seq,snd-seq-midi-event,snd-seq-device 

This output tells you the location of the module (filename), the author, and description, among other information. The output describes snd-seq-oss as an OSS-compatible sequencer module. You can use the -d option to list just the description, the -a option to see the author of the module or -n to see the object file representing the module. The author information often has the e-mail address of the driver's creator, so you can contact the author if you have problems or questions about it.

Loading modules

You can load any module that has been compiled and installed (to the /lib/modules directory) into your running kernel using the modprobe command. The most common reasons for loading a module are that you want to use a feature temporarily (such as loading a module to support a special file system on a floppy you want to access) or to identify a module that will be used by a particular piece of hardware that could not be autodetected.

Here is an example of the modprobe command being used to load the parport module. The parport module provides the core functions to share parallel ports with multiple devices.

 # modprobe parport 

After parport is loaded you can load the parport_pc module to define the PC-style ports available through the interface. The parport_pc module lets you optionally define the addresses and IRQ numbers associated with each device sharing the parallel port. For example:

 # modprobe parport_pc io=0x3bc irq=auto  

In the previous example, a device is identified as having an address of 0x3bc. The IRQ for the device is autodetected.

The modprobe command loads modules temporarily. At the next system reboot, the modules you enter disappear. To permanently add the module to your system, add the modprobe command line to one of the start-up scripts that are run a boot time.

Note 

An alternative to using modprobe is the insmod command. The advantage of using modprobe, however, is that insmod will only load the module you request, while modprobe will try to load other modules that the one you requested is dependent on.

Removing modules

You can remove a module from a running kernel using the rmmod command. For example, to remove the module parport_pc from the current kernel, type the following:

 # rmmod parport_pc  

If the module is not currently busy, the parport_pc module is removed from the running kernel.




Red Hat Fedora Linux 3 Bible
Red Hat Fedora Linux 3 Bible
ISBN: 0764578723
EAN: 2147483647
Year: 2005
Pages: 286

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net