http://www.linuxtopia.org/online_books/linux_kernel/kernel_configuration/ch09.html
很有用的资料,对驱动学习很有帮助
Chapter 9. Kernel Configuration Recipes
Table of Contents
Previous chapters taught the mechanics of reconfiguring the kernel;the payoff comes in this chapter where you can find all the mostcommon kinds of changes people need to make to their kernels, withspecific instructions on how to do so.
The Linux kernel supports a wide range of different disk types.This section shows how to configure the kernel so that it supports most ofthe more common types of disk controllers.
To use a USB storage device (commonly referred to as USB "flash"device, or an external USB disk drive) USB support must be first workingproperly. Refer to the recipe inthe section called “USB” for how to dothis.
A USB storage device can be identified by using thelsusb program. If the following command sequenceproduces the results shown, a USB storage device is present on thesystem:
$
/usr/sbin/lsusb -v | grep Storage
bInterfaceClass 8 Mass Storage
Enable it as follows.
-
A USB Storage device is in reality a USB SCSI device that talks over aUSB connection. Because of this, the SCSI subsystem must be enabled:
Device Drivers SCSI Device Support [*] SCSI Device Support
-
Also in the SCSI system, the "SCSI disk support" must be enabled inorder for the device to be mounted properly:
Device Drivers SCSI Device Support [*] SCSI disk support
-
Enable USB Storage support:
Device Drivers USB Support [M] USB Mass Storage support
A number of specific USB storage devices are listed as separateconfiguration items, as they do not follow the standard USBspecification and require special code. If you have one of thesedevices, please enable support for them.
IDE disks are the most common type of PC disks. The device that enablesthem to work properly is an IDE disk controller. To determine if you havea IDE disk controller on the system, use thelspcicommand in the following manner:[13]
$
/usr/sbin/lspci | grep IDE
00:1f.1 IDE interface: Intel Corporation 82801EB/ER (ICH5/ICH5R) IDE Controller (rev 02)
00:1f.2 IDE interface: Intel Corporation 82801EB (ICH5) SATA Controller (rev 02)
Note that your response will probably not be identical; what isimportant is that the command shows some an IDE Controller (the firstdevice in the previous example.) If you find only SATA controllers, pleaseseethe section called “Serial ATA (SATA)”.
Enable PCI support for the kernel:
Bus options (PCI, PCMCIA, EISA, MCA, ISA)
[*] PCI Support
Enable the IDE subsystem, and IDE support:
Device Drivers
[*] ATA/ATAPI/MFM/RLL support
[*] Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
In the ATA system, the specific type of IDE controller that you have mustbe enabled in order for it to work properly. To provide a good backupin case you choose the wrong type, select the "generic" IDE controller:
Device Drivers
ATA/ATAPI/MFM/RLL support
[*] generic/default IDE chipset support
Enable the different PCI IDE controllers:
Device Drivers
ATA/ATAPI/MFM/RLL support
[*] PCI IDE chipset support
This opens up a lengthy submenu of the different IDE controller types.Select the proper one based on the name of the device you found in thelspci step.
SATA is a type of disk controller that is the successor to the IDE diskcontroller.To determine if you have a SATA disk controller on the system, run thefollowing command:
$
/usr/sbin/lspci | grep SATA
00:1f.2 IDE interface: Intel Corporation 82801EB (ICH5) SATA Controller (rev 02)
Note that your response will probably not be identical; what isimportant is that the command shows some SATA devices.
SATA disks use a kernel library called libata that handles most of theSATA-specific functionality. That library uses the SCSI layer to talkto the block layer, so many different kernel options need to be enabledin order for SATA disks to work properly.Enable PCI support for the kernel:
Bus options (PCI, PCMCIA, EISA, MCA, ISA)
[*] PCI Support
Enable the SCSI subsystem:
Device Drivers
SCSI Device Support
[*] SCSI Device Support
Also in the SCSI system, the "SCSI disk support" option must be enabled inorder for the device to be mounted properly:
Device Drivers
SCSI Device Support
[*] SCSI disk support
The SATA options are under the "SCSI low-level drivers" section:
Device Drivers
SCSI Device Support
SCSI low-level drivers
[*] Serial ATA (SATA) support
In that section, enable the specific SATA controller type that you have.Look at the output of the previously mentionedlspcicommand for a list of the types of SATA controllers that are present onyour system. For example, most motherboards from Intel require the PIIX/ICHSATA driver (as the previous example showed.)
Device Drivers
SCSI Device Support
SCSI low-level drivers
[*] Serial ATA (SATA) support
[*] Intel PIIX/ICH SATA support
Burning a CD-ROM is very simple on Linux. If your kernel can supportreading from a CD-ROM, it can also support burning a CD-ROM. There aretwo ways to enable CD-ROM support in Linux, one for IDE drives and one forSCSI and SATA drives.
IDE CD-ROM drives are controlled by the same IDE controller as your main IDEdisk drives. Make sure the IDE controller is properly supported asdescribed inthe section called “IDE Disks”. If it is properly supported,then only one other configuration item need to be selected:
Device Drivers
[*] ATA/ATAPI/MFM/RLL support
[*] Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
[M] Include IDE/ATAPI CDROM support
SATA and SCSI CD-ROM drives are controlled by the same controller as yourmain disk drives. Make sure the SATA or SCSI controller is properlysupported. For SATA disks, seethe section called “Serial ATA (SATA)”.
To support SATA or SCSI CD-ROM drives, the SCSI CD-ROM driver must beenabled:
Device Drivers
SCSI Device Support
[*] SCSI CDROM support
Once that is enabled, the SATA or SCSI CD-ROM drive should work properly.
[13]Almost all distributions place the lspci program in the/usr/sbin/ directory, but some place it in otherlocations. To find out where it is located, do:
$
which lspci
/usr/sbin/lspci
If you are using a distribution that puts it somewhere else,please use that path for whenever we discuss usinglspci