2) THE HARDWARE INTERFACE
Parallel port devices are becoming rarer by the day in favour of USB (that's a diplomatic way of saying that I don't know how to set one of those up...), so I won't go into any detail about them. I'll be concentrating on IDE, USB and SCSI devices. If your device is an internal or external SCSI drive then you can skip this part and move straight on to "Locating your (re)writer".
So, if you've continued reading this then you're either overly curious or in possession of an IDE or USB CD writer that you'd like to use in Linux.
If it's an IDE device you have and if you're using version 2.0 or later of cdrecord then you don't have to do anything with the kernel and you can skip straight to the "Locating your (re)writer" section.
Otherwise, this drive has to show up as a SCSI device for CD writing software to be able to address it and use it as more than a plain CD-ROM drive. This isn't a trick specific to Linux, in fact all CD writing software has this requirement, even on other operating systems, simply because the commands sent to the hardware which does the job are only defined in the SCSI standards.
USB devices: First of all you must realise that you might never be able to get your CD writer to work in Linux. I've heard stories of experienced Linux users pulling their hair out over this kind of thing in situations where the darn thing works in one distro but flatly refuses to work in another. All I can provide here are guidelines which, if followed, should get your thing up and running, but I can't guarantee that they will. Also bear in mind that many USB devices, CD writers and others, are made up of some kind of standard device such as an IDE disk or CD drive with a USB-to-whatever converter between them and the PC's USB port. Many of these onboard USB converters need some kind of firmware uploaded to them before they even know what they are since they are generic pieces of equipment designed to do all kinds of things. Only once the firmware is installed do they know what they are and how to interact with the equipment on the other side of the interface. This is the case of a USB CD writer belonging to a friend in Seattle (/me waves to Meph) and of a USB scanner here that doesn't even know that the button on the front is supposed to turn the thing off until the firmware is uploaded.
Anyway, back to CD writers... There are three prerequisites for this kind of device to work.
- USB support must be provided for in the kernel. This means using a 2.4.x kernel or later, although I believe that USB support may have heen backported to the 2.2.18 kernel - this needs confirming.
- The preliminary USB device filesystem must be mounted under /proc/bus/usb.
- USB-storage must be activated for your USB device to be emulated as a SCSI device.
Start by finding out if 2. is set up (and therefore 1. since 2. cannot exist without 1.):$ grep usb /etc/mtab usbdevfs /proc/bus/usb usbdevfs rw 0 0
If you don't get something like this then refer to the section entitled "Linux kernel configuration". If you do, then we can check for 3. "su" to root and find out if cdrecord can see your device:$ su Password: # cdrecord -scanbus Cdrecord 1.10 (i686-pc-linux-gnu) Copyright (C) 1995-2001 Jörg Schilling Linux sg driver version: 3.1.20 Using libscg version 'schily-0.5' scsibus0: 0,0,0 0) 'Manufacturer' 'model' and 'firmware revision' of your device, Removable CD-ROM 0,1,0 1) * 0,2,0 2) * 0,3,0 3) * 0,4,0 4) * 0,5,0 5) * 0,6,0 6) * 0,7,0 7) *
If you get an output similar to this, with the manufacturer, model and firmware revision of your USB CD writer, then you're ready to proceed straight to the section entitled "Locating your (re)writer". If not, we have to try and add USB storage capabilities to the kernel so that the storage devices attached to the USB bus become attached to a virtual SCSI host which can be addressed by cdrecord. Still as root, try this:# modprobe usb-storage
If the kernel doesn't complain about the module not being found, then you should be able to try "cdrecord -scanbus" again and see what gives. This gets the kernel to look for a module called "usb-storage.o" and add it to its list of installed drivers. However, if USB support is active and if the preliminary USB device filesystem is mounted, your system startup scripts should detect any attached USB devices belonging to the "storage" class and modprobe usb-storage automagically if need be.
If either of the above tests failed then you need to add some bits and pieces to your kernel. See the section entitled "Linux kernel configuration". Otherwise, if all went well, then move straight on to "Locating your (re)writer".
IDE devices: Getting an IDE device working requires 2 steps.
Reminder: if you're using version 2.0 or later of cdrecord and if you have an IDE device then you should be reading "Locating your (re)writer" instead of this.
- What's known as IDE-SCSI emulation needs to be active. This is a piece of software which announces itself to the kernel as a SCSI adapter driver but which is in reality connected to the IDE device. The kernel, and therefore cdrecord, thinks that there's a SCSI adapter in your box with SCSI drives attached to it, but in reality the driver is just forwarding commands to your IDE device.
- The IDE-SCSI emulator needs to be told which IDE devices are to be emulated as SCSI devices.
IDE-SCSI emulation may already be active on your system. This is how we're going to find out. First of all, find out which device your IDE CD writer is:$ dmesg | grep '^hd.:' hda: ST320011A, ATA DISK drive hdc: R/RW 12x8x32, ATAPI CD/DVD-ROM drive hdd: CREATIVECD3630E, ATAPI CD/DVD-ROM drive hda: 39102336 sectors (20020 MB) w/2048KiB Cache, CHS=2434/255/63
This tells me that my CD ReWriter, a Traxdata 12x8x32 drive, is hdc, or more precisely /dev/hdc.
Now we have to find out if IDE-SCSI emulation uses hdc:$ dmesg | grep '=ide-scsi' Kernel command line: auto BOOT_IMAGE=linux ro root=305 BOOT_FILE=/boot/vmlinuz-2.4.10 hdc=ide-scsi ide_setup: hdc=ide-scsi
The thing to look out for is "hdx=ide-scsi", where "hdx" is either hda, hdb, hdc or hdd, depending on where your CD (Re)Writer is. If your output is similar to this then you can go straight to the "Locating your (re)writer" section. If not, read "Linux kernel configuration".
|<< 1) The software you'll be using||3) Linux kernel configuration >>|
Back to the howto title page
Back to howto-pages.org