MandrakeUser.Org - Your Mandrake-Linux Knowledge Base!


 
 

*DocIndex - Hardware

Hardware Configuration I

* 1 Is A Device Supported?
* 2 Do You Need To Configure The Device Anyway?
* 3 Finding the Right Driver
* 3.1 The Name Of The Device
* 3.2 Scanning The System For Information And Drivers
* 3.3 Trial And Error
* 4 Configuring The Driver
* 4.1 User-space Configuration

Related Resources:

Linux Hardware Compatibility HOWTO
Compatibility & Drivers (MUO)

Revision / Modified: Sep. 10, 2001
Author: Tom Berger

 

* 1 Is A Device Supported by GNU/Linux?

GNU/Linux now supports an astonishing amount of hardware, given the fact that most drivers are still written and maintained by GNU/Linux users.
If you consider buying new hardware, you can help by buying products from GNU/Linux-friendly hardware vendors which either publish the specifications of their products (like Matrox) or even supply their own GNU/Linux drivers in GPL'ed source code (like 3Com). See the Hardware Resources page for more.

Make sure you have the kernel-source package installed. It's a lot, but you will need it. The package installs to '/usr/src/linux'. I will refer to this directory as 'linux/'.

* section index * top

* 2 Do You Need To Configure The Device Anyway?

This may sound funny, but there is a good chance the device is already up and running, but you just do not access it correctly. Scan 'linux/Documentation/devices.txt'. This file contains the names of all device files and which devices they refer to.
Let's assume you are looking for the correct device file for a SCSI CD-ROM:

grep -i scsi /usr/src/linux/Documentation/devices.txt | grep -i cd

returns

block SCSI CD-ROM devices
0 = /dev/sr0 First SCSI CD-ROM
1 = /dev/sr1 Second SCSI CD-ROM

so something like mount /dev/sr0 -t auto /mnt/cdrom might be a good shot at accessing a CD in this drive. (More on 'mounting')

* section index * top

* 3 Finding The Right Driver

* 3.1 The Name Of The Device

If you don't even know the name of the device and it's too inconvenient to look it up (e.g. because it is a card), you can scan your system for PCI cards using lspci (from the 'pciutils' package). Reading the boot messages with dmesg may also help. Or use Windows' 'System Manager' (or any other operating system's hardware tool).

* 3.2 Scanning The System For Information And Drivers

This method isn't very subtle, but it works in many cases ;-): go to /usr/src/linux and run

grep -r [name of device or vendor] *

Remember this only works as expected if the kernel sources are installed!
Example: You have an old Aztech CD-ROM drive. grep -ir Aztech * will give you a list of all files in the source tree which contain the string 'Aztech', for example 'Documentation/cdrom/aztcd', which you can now read for further enlightenment. But there is more:

drivers/cdrom/aztcd.c: linux/drivers/block/aztcd.c - Aztech CD268 CDROM driver

Bingo! ;-) aztcd is the name of the driver you need.

By the way, this also works for hardware which relies on programs like Ghostscript or X: just use the grep command in '/usr/doc' or in the special case of X in '/usr/X11R6/lib/X11/doc'.

* 3.3 Trial And Error

An even less elegant method is to have GNU/Linux try to load modules until one succeeds. Of course this only works for devices which are accessed via kernel modules and not for those which need program-supplied drivers (like graphics cards or printers).

Go to '/lib/modules/[kernel-version]'. Change to the subdirectory matching the type of hardware you have. As 'root' run

modprobe -t . *

You will get error messages for wrong modules: Device or resource busy. If the command stops before reaching the last module in the directory, you can take a cookie. Run lsmod, the module listed on top of the list is the driver you need.

This also works for program-driven hardware, though it is somewhat more tedious: if you can't find the driver which matches your hardware exactly, try one for an earlier model by the same vendor or look for an 'generic' option.

* section index * top

* 4 Configuring The Driver

This depends on whether the driver is supplied by a program (user-space) or via a kernel module (kernel-space). The first is usually configured by a utility of the program or the distribution itself, the second via entries in '/etc/rc.d/rc.local', '/etc/conf.modules' (or 'modules.conf') and / or '/etc/lilo.conf'. If you need help with the latter, jump right to the page about kernel-space configuration.

4.1 User-space Configuration

ML comes with some tools to help you configuring your hardware (which require root privileges to run). Since ML 7.0 most of these have been integrated into 'DrakConf' and the 'Mandrake Control Center', but you can also access most of these tools from the console (package 'drakxtools-newt')
The package names refer to the RPMs which contain them in short form, i.e. 'package sndconfig' refers to 'sndconfig-[version]mdk.i586.rpm' (in case you can't find the program and have to install the package from your ML CD). The vast majority of these programs require root privileges.

  • Sound cards: 'sndconfig' (package 'sndconfig', in some releases 'lothar-soundconfig'). For Plug-and-Play ISA and PCI sound cards.

  • Printers: Pre-8.0: 'printtool' (package 'printtool'). Newer releases use 'printerdrake'.

  • Graphic Cards/Monitors: Mandrake 8.x relies on 'XFdrake'. Older releases use Red Hat's 'Xconfigurator' (package 'Xconfigurator'). Alternatively, you can use XFree's own graphical 'xf86cfg' (package 'XFree86') or the console program 'xf86config' (package 'XFree86').

  • Mice: Pre-8.0: 'mouseconfig' (package 'mouseconfig'). Newer releases use 'mousedrake'.

  • Keyboard: Pre-8.0: 'kbdconfig' (package 'kbdconfig'), KDE and GNOME provide their own key map utilities, so does XFree with 'xmodmap' (package 'XFree86'). On the console, there's 'setkeycodes' (package 'console-tools'). Since 8.0, 'keyboarddrake' is M's configuration tool for keyboards.

  • Serial Devices: 'setserial' (package 'setserial'). You are strongly recommended to read its man page (man setserial) before changing any settings. Try M's own 'HardDrake' first.

  • Clock: 'hwclock' (package 'util-linux') allows you to adjust your hardware clock from the commandline. From within X, do it via the Mandrake Control Center.

  • Modems: 'modemtool' (package 'modemtool', not included in ML 7 or later. In KDE, use 'kppp'). Newer releases of Mandrake use 'draknet'.

* section index * top

* Configuring kernel-space devices


 
Legal: All texts on this site are covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB (Tom Berger) and Mandrakesoft 1999-2002.