The Linux Ultra-DMA Mini-Howto: Offboard PCI UDMA interfaces

Next Previous Contents

## 5. Offboard PCI UDMA interfaces

These are UDMA interfaces on PCI cards that can be used to add UDMA support to an existing computer without replacing the motherboard, or for adding support for an additional four drives to a machine which has had its onboard interfaces filled. They can also be found preinstalled in some computers, especially Gateway 2000 and Dell machines.

Most of them are not supported by the old stable kernels (2.0.x), but many should work with a 2.2.x kernel - the Red Hat 6.0 and SuSE 6.1 distributions are based on 2.2.x kernels, as are the most recent versions of most other distros. However some of the latest cards (the Promise Ultra66 for instance) won't work even with the current 2.2.x kernels, if you have this or can't get a newer distribution then you must apply a kernel patch or upgrade to a newer kernel version. If you need to install Linux onto a hard drive on one of these interfaces in this case, you will need to use a few odd tricks.

## 5.1 Promise Ultra33

This is a PCI card that has two UDMA channels on it, supporting up to four drives total. You can look up specifications & pricing at http://www.promise.com. This card shipped in early model Gateway 2000 Pentium II systems.

Kernels 2.0.35 and later and all 2.2.x kernels support the Ultra33 and you should have no trouble installing a distribution that uses these kernels. However, the older stable kernels (2.0.34 and below) do not, and since most older Linux distributions include these older kernels it can be a little difficult to get Linux installed if you can't or don't want to use a newer version (for instance if you are standardized on a particular version of a distribution throughout your organization).

Installing Linux with the Ultra33

Although there is a patch for the Ultra33 interface, it is not very easy to apply a patch and recompile your kernel if you have not installed Linux yet! So, here is a workaround which allows you to install. Thanks to Gadi Oxman for the following information on getting the interface settings:

> `

>     If we can access the console with the installation disk, we can also
>     use "cat /proc/pci" to display the Promise interface settings:

>         RAID bus interface: Promise Technology Unknown device (rev 1).
>           Vendor id=105a. Device id=4d33.
>           Medium devsel.  IRQ 12.  Master Capable.  Latency=32.
>           I/O at 0xe000.   (a)
>           I/O at 0xd804.   (b)
>           I/O at 0xd400.   (c)
>           I/O at 0xd004.   (d)
>           I/O at 0xc800.   (e)

>     and pass "ide2=a,b+2 ide3=c,d+2" as a command line parameter to the kernel.

> `

Note that the numbers probably are not the same as what you will have. Just as an example, the parameters to use for the above set of numbers would be ```ide2=0xe000,0xd806 ide3=0xd400,0xd006`''. If you are only using the first channel on the Ultra33 (for instance, if you only have one drive, or two if they are master and slave on the same channel), then you won't need to specify `ide3`.

Red Hat 5.1: Boot with the boot diskette and press enter when prompted. The kernel will load, and then you will be asked for a language, keyboard type, and installation method. You may be prompted for additional information about the source media; it doesn't matter right now what you tell it as long as you can get to the next step. Next you should see a screen titled ``Select Installation Path''; press Alt-F2 now to get to a command prompt. Run ```cat /proc/pci`'', write down the numbers as above, and reboot from the boot disk. This time, type ```linux ide2=` (this is where you put the numbers like shown above)`ide3=`(more numbers)''. It should now be able to install onto your hard disk without difficulty, however LILO will probably not be able to install; instead make a boot floppy and boot it with the same parameters until you can patch LILO and and the kernel.

Red Hat 5.0 and Slackware 3.4: These are similar, but with the wrinkle that the setup programs ignore `/dev/hde-h` (the drives on `ide2` and `ide3`). In order to install to or from these drives it is necessary to override one or both of the onboard interface's channels. However be sure not to override a device that you need to install; for instance if you are installing from a CD-ROM drive on `/dev/hdd` (`ide1` - onboard interface) to a hard drive on `/dev/hde` (`ide2` - the Ultra33), you should override the non-essential `ide0` with `ide2` and leave `ide1` intact. Assuming the numbers above you would boot with ```ide0=0xe000,0xd806`''. Red Hat 5.0 will give you a shell prompt if you use the rescue disk capability, and Slackware includes a shell in the regular installation process. However Red Hat 5.0 is difficult to boot after installation; if you have problems you could try downloading a Slackware boot disk from ftp://ftp.cdrom.com/pub/linux/slackware-3.5/bootdsks.144/ and using that to boot.

With another Linux distribution you will have to improvise a bit, but the process should be about the same as the above.

IMPORTANT: Without the patch (discussed in the section Unified IDE), the kernel needs these boot parameters in order to access your hard disk! Therefore it is very important that when you configure LILO, either on the hard disk or on a boot floppy, that you give it the exact same parameters that you gave when installing. Otherwise your system won't boot! It should be possible to give them to LILO when you boot (ie, press Shift, type in ```linux ide2=`.....'' each time you boot), but only if you kept the numbers! It is recommended that you patch your kernel as soon as possible so you will not have to worry about that anymore; once you are booting with a patched kernel, you can get rid of the boot parameters. Also, as far as I know there is no way to pass boot parameters to a plain kernel boot floppy (as made with ```make zdisk`''), you must use LILO or another loader (such as LOADLIN) that lets you pass boot parameters.

However, unpatched kernels and installation programs often have a difficult time actually using ide2 and ide3, even if the drives are detected properly. So if you can't get Linux to install using the above technique, try specifying ide0 or ide1 instead of ide2 or ide3 (thanks to Martin Gaitan for this technique). This essentially replaces the on-board interface with the Promise Ultra33 as far as the kernel is concerned, and you can follow the directions in the next section as if you had physically moved it. Note that if you're using an IDE CD-ROM drive connected to your on-board interface to install from, you will want to make sure that you do not take over the interface that the CD is on or you will not be able to install! If the CD is hda or hdb, use ide1 for your hard drive, and if it is hdc or hdd, then use ide0.

Installing Linux Around the Ultra33

If you cannot get the software workaround to work, you will have to try a more brute force approach. Here's an alternative method that is virtually guaranteed to work, but will require you to open up your computer and mess about in it. NOTE: If you are not familiar with the process of connecting and disconnecting IDE drives, read the manuals that came with your computer, your hard drive, and/or the Promise Ultra33 before attempting this! If you screw something up and don't know how to put it back, you could end up being sorry!

That being said, it's all really quite simple. Most motherboards these days have built-in EIDE interfaces. Disconnect your hard drive from the Ultra33 and connect it to the onboard interface. If you have other IDE devices, such as a CD-ROM, tape, or ZIP drive, on your oboard interface, it is easiest if you either add the hard drive on an unused channel (the secondary instead of the primary) or temporarily displace a device that you don not need immediately (such as ZIP or tape). Install Linux. Download and apply the Promise UDMA patch (see next section).

Now you are ready to move the drive back onto the Promise... almost. To be safe, make a kernel-image boot floppy (`cd /usr/src/linux ; make zdisk`), which you will be able to use to boot your system in case LILO doesn't work. Actually, to be very safe, make two and put one away for now.

Okay, now it is time to think a little... if you have just one hard drive and it is going to be on the Promise, then it will most likely be `/dev/hde` (`a` and `b` are for the primary onboard interface, `c` and `d` for the secondary onboard interface). If you are going to put any other drives on it, then the slave of the Promise's first channel will be `/dev/hdf`, the master of the second will be `/dev/hdg`, and the slave of the second will be `/dev/hdh`.

Edit `/etc/fstab`, and change all the partitions of the hard drives you are moving from the onboard drives (`/dev/hda`, `hdb`, etc) to their new locations on the Promise (`/dev/hde`, `hdf`, etc). If you had to displace any devices (such as a CD-ROM or ZIP drive) that you want to leave on the onboard interface, then change them to their new locations as well. For instance, if your CD-ROM was originally the master on the primary channel (`/dev/hda`), but you put your hard disk there and had to bump the CD to the slave (`/dev/hdb`) or to the secondary channel (`/dev/hdc`), and now you want to put it back, then change it to `/dev/hda`.

If you are using LILO, reconfigure LILO to use the new location of the drive (LILO configuration is beyond the scope of this document, if you do not know how, read the LILO mini-HOWTO), or else it probably will not be able to boot unless you use that boot floppy I had you make, which you will also want to configure to boot off the new partition. This is done using the `rdev` command. Put the floppy in the drive and type ```rdev /dev/fd0 /dev/hde1`''. Of course that's assuming your root partition is the first on your first UDMA drive. If not (mine is `/dev/hde7`, for instance), then obviously use the appropriate partition number!

Reboot. Your system should now work fine.

Patching for the Ultra33

Kernels 2.0.35 and later support the Promise Ultra33 natively; download an upgrade from your Linux distribution or from http://www.kernel.org.

For instructions on how to compile the kernel, read the Kernel HOWTO.

Using two Ultra33 cards in one machine

This is currently not working correctly... don't do it right now unless you're willing to fiddle with the kernel to try to get things to work.

## 5.2 Promise Ultra66

This is essentially the same as the Ultra33 with support for the new UDMA mode 4 66 MB/sec transfer speed. Unfortunately it is not yet supported by 2.2.x kernels.

There is a patch for 2.0.x and 2.2.x kernels availabe at http://www.kernel.org/pub/linux/kernel/people/hedrick, and support is included in the 2.3.x development kernel series at least as of 2.3.3.

However to get far enough to patch or upgrade the kernel you'll have to pull the same dirty tricks as for the Ultra33 as in the section above, or else use a boot disk image provided by Promise

## 5.3 Artop ATP850UF

This card is supported by the unified IDE code. Installation of Linux onto a system with one of these as the interface for the target disk may be similar to the workarounds for the Promise Ultra33.

## 5.4 Adding device files

The tertiary and quaternary IDE interfaces (ide2 and ide3) use device files of the form `/dev/hde*` through `/dev/hdh*`. On older kernels these devices were not automatically created, so you may need to add them manually for things to work properly.

This can be done easily if you have a current copy of the Linux kernel source installed; simply run `/usr/src/linux/scripts/MAKEDEV.ide` and it will create all relevant device files.

Next Previous Contents