⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lsg09.htm

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTM
📖 第 1 页 / 共 4 页
字号:


<BR>







<P>The most commonly used proprietary CD-ROM drive is one manufactured by Matsushita and partners, which is sold under many trade names (including Creative Labs, Panasonic, and others). Linux also supports several Sony CD-ROM drives and some Philips drives. A list of all supported CD-ROM drives is supplied with the Linux distribution set and is updated with each new release. Check the list supplied with your version of Linux and the manufacturer of the drive you're considering before you purchase a CD-ROM drive, if possible. Note that many companies relabel these drives to their own brand names, so it may be a little difficult to determine who manufactured the drive and its model number just by looking at the box. If you can't tell who made the CD-ROM drive, and it's not a major brand name (such as Creative Labs), postpone purchasing the unit until you can get more information about it. Most boxes have a telephone number for the vendor, so copy it down and give the vendor a call. (Beware of salespeople who give you the &quot;of course it will work&quot; line; most of them have no idea!) If your distribution software does not have support for your proprietary CD-ROM, you can check the FTP and BBS sites for new drivers. The primary proprietary models are supported, though.







<BR>







<P>Another differentiating factor with CD-ROM drives is the amount of RAM provided on the drive unit. This difference is common among SCSI drives. Most drives have 256K RAM, and others sport 1M or more. Plextor drives (such as the Plextor 4Plex and 6Plex) are usually available with 1M and are some of the fastest CD-ROM drives available for Linux and DOS/Windows. In theory, the more RAM there is on board, the more buffering and caching the drive can perform. Because Linux has a cache system of its own, the on-board RAM is generally not as important a factor as access speed, although more RAM does provide a small increase in speed.







<BR>







<BR>







<A NAME="E69E78"></A>







<H4 ALIGN=CENTER>







<CENTER>







<FONT SIZE=4 COLOR="#FF0000"><B>Recordable CD-ROMs</B></FONT></CENTER></H4>







<BR>







<P>A slight variation on the CD-ROM drive is the newer CD-R (Compact Disk - Recordable) drive, which is essentially a CD-ROM drive that can write to a CD. CD discs are only capable of being written to once, so these devices are usually limited to special applications. Most CD-R drives are designed for DOS/Windows, although a few have generic UNIX drivers designed for high-end multimedia workstations.







<BR>







<P>You can add a CD-R drive to a Linux system, although few drivers are available for actually writing data to the CD-R. If you have a CD-R drive that you want to use with Linux, you can install it as a CD-ROM drive for read-only purposes. If you want to write data to the CD, you will have to find an application that is compatible with Linux or find a CD-ROM device driver that treats the CD-R as a normal filesystem. Such applications and drivers are currently rare and difficult to find, although the dropping prices of CD-R units will result in more interest in this type of device. Check an FTP site for recent developments along this line.







<BR>







<BR>







<A NAME="E68E48"></A>







<H3 ALIGN=CENTER>







<CENTER>







<FONT SIZE=5 COLOR="#FF0000"><B>Installing a CD-ROM Drive</B></FONT></CENTER></H3>







<BR>







<P>If you have just bought a CD-ROM drive or want to add an existing drive to your Linux system, you must follow a series of steps to install and configure the drive properly. This section assumes that you have checked to ensure that Linux supports the drive and that a device driver is available (either in the Linux distribution software or on a separate disk or file).







<BR>







<P>Although adding a CD-ROM drive to your Linux system may seem to be a daunting task, it is quite simple. Doing the following process will result in a working CD-ROM with a minimum of effort, even if you are not very familiar with Linux:







<BR>







<OL>







<LI>Physically install the drive.







<BR>







<BR>







<LI>Configure and rebuild the Linux kernel.







<BR>







<BR>







<LI>Create the device files.







<BR>







<BR>







<LI>Mount and test the CD-ROM.







<BR>







<BR>







</OL>







<P>The following sections describe each of these steps in a little more detail.







<BR>







<BR>







<A NAME="E69E79"></A>







<H4 ALIGN=CENTER>







<CENTER>







<FONT SIZE=4 COLOR="#FF0000"><B>Physically Install the Drive</B></FONT></CENTER></H4>







<BR>







<P>Linux doesn't impose any special requirements on the physical installation of a CD-ROM drive. Follow the manufacturer's directions. The instructions for installing your CD-ROM drive should be supplied with the drive itself.







<BR>







<P>For an internal drive the basic steps are as follows:







<BR>







<OL>







<LI>Place the drive in an unused drive bay.







<BR>







<BR>







<LI>Screw the drive into place.







<BR>







<BR>







<LI>Plug in the power connector and run the interface cable to the CD-ROM drive. (If you have a SCSI CD-ROM drive, plug the CD-ROM drive into an unused SCSI cable plug.)







<BR>







<BR>







<LI>Plug the interface board into a PC slot, and attach the cable from the CD-ROM drive.







<BR>







<BR>







<LI>Some CD-ROM drives have a special cable for digital sound which connects between the CD-ROM and a sound card. If your drive has such a connector, attach it.







<BR>







<BR>







</OL>







<P>External drives are easier to install because you need only add the interface board to an empty slot on the motherboard (assuming you need a new interface board) and attach the cable from the CD-ROM drive to the port on the back of the board. You add SCSI drives to the external SCSI chain. Make sure you have the proper connectors to add the CD-ROM drive to the chain. Also, when adding a SCSI CD-ROM, make sure that you set the SCSI ID to an unused value (see <A HREF="lsg07.htm">Chapter 7</A>, &quot;SCSI Devices,&quot; for more information on SCSI IDs). The SCSI ID is usually set with jumpers on internal CD-ROM drives, although some drives use DIP switches. External SCSI CD-ROM drives use a variety of methods to change SCSI ID numbers. The most popular method is a dial that shows the proper ID.







<BR>







<BR>







<A NAME="E69E80"></A>







<H4 ALIGN=CENTER>







<CENTER>







<FONT SIZE=4 COLOR="#FF0000"><B>Configure and Rebuild the Kernel</B></FONT></CENTER></H4>







<BR>







<P>You must add ISO 9660 filesystem support and the CD-ROM device driver to the Linux kernel to provide support for a CD-ROM drive. Linux requires CD-ROMs to have the ISO 9660 (High Sierra) format, so your Linux system must have ISO 9660 filesystem support built in before the you can use the CD-ROM drive. The Linux ISO 9660 drivers include support for the Rock Ridge Extensions. The ISO 9660 driver is provided as part of the distribution set. Most Linux kernels have the ISO 9660 drivers included automatically when you install Linux from a CD-ROM. You can verify that the drivers are loaded by displaying the boot messages with the following command:







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">dmesg | more</FONT></PRE>







<P>Examine the lines at the bottom of the output. As shown in Figure 9.1, you will see a line similar to the following







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">ISO9660 Extensions: RRIP_1991A</FONT></PRE>







<P>if the ISO 9660 drivers are included in your kernel. If you don't see any message about IS0 9660 drivers, add them manually.







<BR>







<P><B> <A HREF="09LSG01.gif">Figure 9.1.</B>







<BR><B>If your Linux kernel has the ISO 9660 drivers already linked, you will </B><B>see a message during startup that shows the extension name.</A></B>







<BR>







<P>To add the ISO 9660 driver on most systems, you select a configure option from the Linux setup program or install script. Alternatively, on some Linux systems, you can change to the Linux source directory (usually /usr/src/linux) and perform a







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">make config</FONT></PRE>







<P>command and select the proper driver from the list presented. After adding ISO 9660 filesystem support, you must relink and rebuild the kernel. See <A HREF="lsg25.htm">Chapter 25</A>, &quot;Modifying the Kernel,&quot; for more information on rebuilding the kernel.







<BR>







<P>As with all physical devices on a Linux system, a CD-ROM drive requires a device driver. This device driver must be available before you start the installation process. Most popular IDE and proprietary CD-ROM drives have a device driver provided as part of the Linux distribution software. For some CD-ROM drives, you may have to obtain a driver from an FTP or BBS site, or even write it yourself. Whichever method you use, have the device driver file readily available to Linux for this step. If your device driver is on floppy disk, copy it to the /dev directory.







<BR>







<P>SCSI CD-ROM drives are the easiest to add to a Linux system. If you are adding a SCSI CD-ROM drive, the kernel configuration routine may ask you whether you want to add SCSI support. Answer yes. This question may be followed by a question about SCSI CD-ROM support, depending on the version of Linux you are running. Again, answer yes to this question. Some later versions of Linux with setup scripts enable you to select the CD-ROM drive from a list, as shown in Figure 9.2. When you install Linux from a CD-ROM, the drivers are linked in automatically. Select the SCSI option and continue with the configuration process.







<BR>







<P><B> <A HREF="09LSG02.gif">Figure 9.2.</B>







<BR><B>The Linux setup program lets you add support for a CD-ROM.</A></B>







<BR>







<P>For IDE and proprietary CD-ROM drives, use the setup or installation routine supplied with Linux. Linux asks you for the type of CD-ROM drive you want to add. Select the drive type that matches your drive, assuming it is on the list. For example, if you are using a Creative Labs CD-ROM drive connected to one of the Creative Labs sound cards, you would select the Matsushita/Panasonic or Mitsumi drive, depending on the type of CD-ROM drive supplied in your package.







<BR>







<P>If your CD-ROM drive is not on the list presented by the installation or setup script, as is sometimes the case with IDE and some Sony CD-ROM drives, you must manually apply the patch for the drive yourself. If you need to manually patch the kernel, you must rebuild it using the process explained in <A HREF="lsg25.htm">Chapter 25</A>, &quot;Modifying the Kernel.&quot;







<BR>







<P>If you are using a CD-ROM drive driven by a sound card, you can configure the sound card at the same time as the CD-ROM interface. Some sound cards are not supported by Linux, but their CD-ROM interface is. Check the on-line documentation and FTP/BBS sites for specific information about your sound card.







<BR>







<BR>







<A NAME="E69E81"></A>







<H4 ALIGN=CENTER>







<CENTER>







<FONT SIZE=4 COLOR="#FF0000"><B>Create the Device Files</B></FONT></CENTER></H4>







<BR>







<P>For the most popular CD-ROM drives, the device files may already be installed in your /dev directory, especially if you used an installation or setup script to add your CD-ROM drive. For other CD-ROM drives, you will have to perform this step manually. Even if the device files were created for you, you should still check the directories manually to ensure that they were installed properly.







<BR>







<P>To create the device files, you run a command that differs based on the type of CD-ROM drive you are installing. The mknod command is used to create the proper major and minor device numbers (see <A HREF="lsg06.htm">Chapter 6</A>, &quot;Devices and Device Drivers,&quot; for more information on device numbers). For example, you can create a SCSI CD-ROM drive file with the command







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">mknod /dev/scd0 b 11 0</FONT></PRE>







<P>The device name /dev/scd0 refers to the first CD-ROM drive the kernel finds. A second drive would be /dev/scd1, the third would be /dev/scd2, and so on. Most Linux systems use this naming convention for SCSI CD-ROM drives. The command line indicates that the CD-ROM drive is a block mode device and has a major device number of 11 and a minor device number of 0. A second SCSI CD-ROM drive would have a minor device number of 1; you would add it with the following command:







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">mknod /dev/scb1 b 11 1</FONT></PRE>







<P>Figure 9.3 shows the /dev/scd device drivers used for a SCSI CD-ROM. Linux usually aliases the device /dev/cdrom to the primary CD device (in this case /dev/scd0), as you can see from the symbolic link.







<BR>







<P><B> <A HREF="09LSG03.gif">Figure 9.3.</B>







<BR><B>Two SCSI CD-ROM device drivers are present in most Linux systems.</A></B>







<BR>







<P>Proprietary and IDE CD-ROM drives require different device names, and the names vary considerably depending on the model. In most cases, the Linux documentation files that explain supported CD-ROM drives will include the name of the device file to use.







<BR>







<P>To create a CD-ROM device file for a Matsushita drive (common with Creative Labs and other multimedia add-on CD-ROM drives), use the command







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">mknod /dev/sbpcd b 25 0</FONT></PRE>







<P>or







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">mknod /dev/sbpcd0 b 25 0</FONT></PRE>







<P>This command uses the device driver /dev/sbpcd or /dev/sbpcd0 (the sb portion refers to the Sound Blaster drive card). The device major number is 25, and the minor number is 0. If you have a second drive of the same type, add it as /dev/sbpcd1 with the command







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">mknod /dev/sbpcd1 b 25 1</FONT></PRE>







<P>You can add more CD-ROM drives of the same type, incrementing the device driver number and the minor device number each time, up to the limit of four CD-ROM drives on the controller. Figure 9.4 shows the device drivers for four Sound Blaster-type CD-ROM drives created by a typical Linux installation. Whether they are used by the kernel depends on the kernel configuration. The device drivers /dev/sbpcd and /dev/sbpcd0 are the same.







<BR>







<P><B> <A HREF="09LSG04.gif">Figure 9.4.</B>



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -