📄 ide-cd
字号:
IDE-CD driver documentationOriginally by scott snyder <snyder@fnald0.fnal.gov> (19 May 1996)Carrying on the torch is: Erik Andersen <andersee@debian.org>New maintainers (19 Oct 1998): Jens Axboe <axboe@image.dk>1. Introduction---------------The ide-cd driver should work with all ATAPI ver 1.2 to ATAPI 2.6 compliant CDROM drives which attach to an IDE interface. Note that some CDROM vendors(including Mitsumi, Sony, Creative, Aztech, and Goldstar) have madeboth ATAPI-compliant drives and drives which use a proprietaryinterface. If your drive uses one of those proprietary interfaces,this driver will not work with it (but one of the other CDROM driversprobably will). This driver will not work with `ATAPI' drives whichattach to the parallel port. In addition, there is at least one drive(CyCDROM CR520ie) which attaches to the IDE port but is not ATAPI;this driver will not work with drives like that either (but see theaztcd driver).This driver provides the following features: - Reading from data tracks, and mounting ISO 9660 filesystems. - Playing audio tracks. Most of the CDROM player programs floating around should work; I usually use Workman. - Multisession support. - On drives which support it, reading digital audio data directly from audio tracks. The program cdda2wav can be used for this. Note, however, that only some drives actually support this. - There is now support for CDROM changers which comply with the ATAPI 2.6 draft standard (such as the NEC CDR-251). This additional functionality includes a function call to query which slot is the currently selected slot, a function call to query which slots contain CDs, etc. A sample program which demonstrates this functionality is appended to the end of this file. The Sanyo 3-disc changer (which does not conform to the standard) is also now supported. Please note the driver refers to the first CD as slot # 0.2. Installation---------------0. The ide-cd relies on the ide disk driver. See Documentation/ide.txt for up-to-date information on the ide driver.1. Make sure that the ide and ide-cd drivers are compiled into the kernel you're using. When configuring the kernel, in the section entitled "Floppy, IDE, and other block devices", say either `Y' (which will compile the support directly into the kernel) or `M' (to compile support as a module which can be loaded and unloaded) to the options: Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support Include IDE/ATAPI CDROM support and `no' to Use old disk-only driver on primary interface Depending on what type of IDE interface you have, you may need to specify additional configuration options. See Documentation/ide.txt.2. You should also ensure that the iso9660 filesystem is either compiled into the kernel or available as a loadable module. You can see if a filesystem is known to the kernel by catting /proc/filesystems.3. The CDROM drive should be connected to the host on an IDE interface. Each interface on a system is defined by an I/O port address and an IRQ number, the standard assignments being 0x170 and 14 for the primary interface and 0x1f0 and 15 for the secondary interface. Each interface can control up to two devices, where each device can be a hard drive, a CDROM drive, a floppy drive, or a tape drive. The two devices on an interface are called `master' and `slave'; this is usually selectable via a jumper on the drive. Linux names these devices as follows. The master and slave devices on the primary IDE interface are called `hda' and `hdb', respectively. The drives on the secondary interface are called `hdc' and `hdd'. (Interfaces at other locations get other letters in the third position; see Documentation/ide.txt.) If you want your CDROM drive to be found automatically by the driver, you should make sure your IDE interface uses either the primary or secondary addresses mentioned above. In addition, if the CDROM drive is the only device on the IDE interface, it should be jumpered as `master'. (If for some reason you cannot configure your system in this manner, you can probably still use the driver. You may have to pass extra configuration information to the kernel when you boot, however. See Documentation/ide.txt for more information.)4. Boot the system. If the drive is recognized, you should see a message which looks like hdb: NEC CD-ROM DRIVE:260, ATAPI CDROM drive If you do not see this, see section 5 below.5. You may want to create a symbolic link /dev/cdrom pointing to the actual device. You can do this with the command ln -s /dev/hdX /dev/cdrom where X should be replaced by the letter indicating where your drive is installed.6. You should be able to see any error messages from the driver with the `dmesg' command.3. Basic usage--------------An ISO 9660 CDROM can be mounted by putting the disc in the drive and typing (as root) mount -t iso9660 /dev/cdrom /mnt/cdromwhere it is assumed that /dev/cdrom is a link pointing to the actualdevice (as described in step 5 of the last section) and /mnt/cdrom isan empty directory. You should now be able to see the contents of theCDROM under the /mnt/cdrom directory. If you want to eject the CDROM,you must first dismount it with a command like umount /mnt/cdromNote that audio CDs cannot be mounted.Some distributions set up /etc/fstab to always try to mount a CDROMfilesystem on bootup. It is not required to mount the CDROM in thismanner, though, and it may be a nuisance if you change CDROMs often.You should feel free to remove the cdrom line from /etc/fstab andmount CDROMs manually if that suits you better.Multisession and photocd discs should work with no special handling.The hpcdtoppm package (ftp.gwdg.de:/pub/linux/hpcdtoppm/) may beuseful for reading photocds.To play an audio CD, you should first unmount and remove any dataCDROM. Any of the CDROM player programs should then work (workman,workbone, cdplayer, etc.). Lacking anything else, you could use thecdtester program in Documentation/cdrom/sbpcd.On a few drives, you can read digital audio directly using a programsuch as cdda2wav. The only types of drive which I've heard supportthis are Sony and Toshiba drives. You will get errors if you try touse this function on a drive which does not support it.For supported changers, you can use the `cdchange' program (appended tothe end of this file) to switch between changer slots. Note that thedrive should be unmounted before attempting this. The program takestwo arguments: the CDROM device, and the slot number to which you wishto change. If the slot number is -1, the drive is unloaded.4. Compilation options----------------------There are a few additional options which can be set when compiling thedriver. Most people should not need to mess with any of these; theyare listed here simply for completeness. A compilation option can beenabled by adding a line of the form `#define <option> 1' to the topof ide-cd.c. All these options are disabled by default.VERBOSE_IDE_CD_ERRORS If this is set, ATAPI error codes will be translated into textual descriptions. In addition, a dump is made of the command which provoked the error. This is off by default to save the memory used by the (somewhat long) table of error descriptions. STANDARD_ATAPI If this is set, the code needed to deal with certain drives which do not properly implement the ATAPI spec will be disabled. If you know your drive implements ATAPI properly, you can turn this on to get a slightly smaller kernel.NO_DOOR_LOCKING If this is set, the driver will never attempt to lock the door of the drive.CDROM_NBLOCKS_BUFFER This sets the size of the buffer to be used for a CDROMREADAUDIO ioctl. The default is 8.TEST This currently enables an additional ioctl which enables a user-mode program to execute an arbitrary packet command. See the source for details. This should be left off unless you know what you're doing.5. Common problems------------------This section discusses some common problems encountered when trying touse the driver, and some possible solutions. Note that if you areexperiencing problems, you should probably also reviewDocumentation/ide.txt for current information about the underlyingIDE support code. Some of these items apply only to earlier versionsof the driver, but are mentioned here for completeness.In most cases, you should probably check with `dmesg' for any errorsfrom the driver.a. Drive is not detected during booting. - Review the configuration instructions above and in Documentation/ide.txt, and check how your hardware is configured. - If your drive is the only device on an IDE interface, it should be jumpered as master, if at all possible. - If your IDE interface is not at the standard addresses of 0x170 or 0x1f0, you'll need to explicitly inform the driver using a lilo option. See Documentation/ide.txt. (This feature was added around kernel version 1.3.30.) - If the autoprobing is not finding your drive, you can tell the driver to assume that one exists by using a lilo option of the form `hdX=cdrom', where X is the drive letter corresponding to where your drive is installed. Note that if you do this and you see a boot message like hdX: ATAPI cdrom (?) this does _not_ mean that the driver has successfully detected the drive; rather, it means that the driver has not detected a drive, but is assuming there's one there anyway because you told it so. If you actually try to do I/O to a drive defined at a nonexistent or nonresponding I/O address, you'll probably get errors with a status value of 0xff. - Some IDE adapters require a nonstandard initialization sequence before they'll function properly. (If this is the case, there will often be a separate MS-DOS driver just for the controller.) IDE interfaces on sound cards often fall into this category. Support for some interfaces needing extra initialization is provided in later 1.3.x kernels. You may need to turn on additional kernel configuration options to get them to work; see Documentation/ide.txt. Even if support is not available for your interface, you may be able to get it to work with the following procedure. First boot MS-DOS and load the appropriate drivers. Then warm-boot linux (i.e., without powering off). If this works, it can be automated by running loadlin from the MS-DOS autoexec.b. Timeout/IRQ errors. - If you always get timeout errors, interrupts from the drive are probably not making it to the host. - IRQ problems may also be indicated by the message `IRQ probe failed (<n>)' while booting. If <n> is zero, that means that the system did not see an interrupt from the drive when it was expecting one (on any feasible IRQ). If <n> is negative, that means the system saw interrupts on multiple IRQ lines, when it was expecting to receive just one from the CDROM drive. - Double-check your hardware configuration to make sure that the IRQ number of your IDE interface matches what the driver expects. (The usual assignments are 14 for the primary (0x170) interface and 15 for the secondary (0x1f0) interface.) Also be sure that you don't have some other hardware which might be conflicting with the IRQ you're using. Also check the BIOS setup for your system; some have the ability to disable individual IRQ levels, and I've had one report of a system which was shipped with IRQ 15 disabled by default. - Note that many MS-DOS CDROM drivers will still function even if there are hardware problems with the interrupt setup; they apparently don't use interrupts. - If you own a Pioneer DR-A24X, you _will_ get nasty error messages on boot such as "irq timeout: status=0x50 { DriveReady SeekComplete }" The Pioneer DR-A24X CDROM drives are fairly popular these days. Unfortunately, these drives seem to become very confused when we perform the standard Linux ATA disk drive probe. If you own one of these drives, you can bypass the ATA probing which confuses these CDROM drives, by
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -