2 Compilation, installation, and configuration

Contents of this section

2.1 Prerequisites and kernel setup

For the latest version, you will need to have kernel version 1.1.93 or higher, or kernel 1.2.0 or higher. There are no kernel patches specifically for PCMCIA support. You'll also need to have a relatively recent set of module utilities. If your man page for insmod describes the [symbol=value ...] syntax, your utilities are current enough.

You need to have a complete linux source tree for your kernel, not just an up-to-date kernel image, when you compile the PCMCIA package. The PCMCIA modules contain some references to kernel source files.

Current kernel sources and patches are available from sunsite.unc.edu in /pub/Linux/kernel/v1.1, or from tsx-11.mit.edu in /pub/linux/sources/system/v1.1. Current module utilities can be found in the same places, in the file modules-1.1.87.tgz.

When configuring your kernel, if you plan on using a PCMCIA ethernet card, you should turn on networking support but turn off the normal Linux network card drivers, including the ``pocket and portable adapters''. The PCMCIA network card drivers are all implemented as loadable modules. All of the PCMCIA net drivers except the 3Com 3c589 driver depend on the 8390.o driver module which is part of the Linux kernel.

If you want to use SLIP, PPP, or PLIP, you do need to either configure your kernel with these enabled, or use the loadable module versions of these drivers. There is an unfortunate deficiency in the kernel config process, in that it is not possible to set configuration options (like SLIP compression) for a loadable module, so it is probably better to just link SLIP into the kernel if you need it.

If you will be using a PCMCIA SCSI adapter, you should enable CONFIG_SCSI when configuring your kernel. Also, enable any top level drivers (SCSI disk, tape, cdrom, generic) that you expect to use. All low-level drivers for particular host adapters should be disabled. There is currently a bad interaction between the SCSI modules and CONFIG_MODVERSIONS, so you will need to disable this option if you plan to use one of these cards.

For recent kernels, you must explicitly do ``make modules'' followed by ``make modules_install'' in /usr/src/linux to build the loadable driver modules. They will be installed under /lib/modules.

2.2 Installation

Starting with release 2.4.8, this package includes an X-based card status utility called cardinfo. This utility is based on a public domain user interface toolkit called the Forms Library, which you will need to install before building cardinfo. A binary distribution is on cb-iris.stanford.edu in /pub/pcmcia/extras/bxform-0.61.tgz. There is a small bug in the Makefile: the line that starts with ``ln -s'' should have ``; fi'' added to the end.

Unpack the pcmcia-cs-2.5.1.tgz package in a convenient location, like /usr/src.

Make sure the definitions in make.options are consistent with your site setup. Running ``make prereq'' will check your system configuration to verify that it satisfies all prerequisites for installing PCMCIA support.

Running ``make all'' followed by ``make install'' will build and then install the kernel modules and utility programs. Kernel modules are installed under /lib/modules/<version>/pcmcia. The cardmgr and cardctl programs are installed in /sbin. If cardinfo is built, it is installed in /usr/bin/X11.

Configuration files are kept in the /etc/pcmcia directory: do ``make install-etc'' to set up this directory. If you are installing over an older version, the new config files will be installed with a ``.N'' suffix -- you should replace or update your existing files by hand. Finally, ``make install-man'' will install man pages for all the loadable modules and programs.

If you don't know what kind of PCMCIA controller chip you have, you can use the probe utility in the cardmgr/ subdirectory to determine this. There are two major types: the Databook TCIC-2 type and the Intel i82365SL-compatible type.

A user-level daemon processes card insertion and removal events. This is called cardmgr. It is similar in function to Barry Jaspan's pcmciad in earlier PCMCIA releases. Cardmgr reads a configuration file describing known PCMCIA cards from /etc/pcmcia/config. This file also specifies what resources can be allocated for use by PCMCIA devices, and may need to be customized for your system. See the pcmcia man page for more information about this file.

The script rc.pcmcia, installed in /etc/rc.d, controls starting up and shutting down the PCMCIA system. ``make install-etc'' will use the probe command to determine your controller type and modify rc.pcmcia appropriately. You should add a line to your system startup file /etc/rc.d/rc.M to invoke this:

/etc/rc.d/rc.pcmcia start

If you are using a PCMCIA ethernet card, you should not try to configure it in /etc/rc.d/rc.inet1, since the card may not be present when this script is executed. Comment out everything except the loopback stuff in rc.inet1 and instead edit the /etc/pcmcia/network script to match your local network setup. This script will be executed only when your ethernet card is actually present.

2.3 Site-specific configuration options

Card Services should automatically avoid allocating IO ports and interrupts already in use by other standard devices. This should work for any devices that have Linux drivers, like serial and parallel ports, IDE drives, and some sound cards. If a device is unsupported by Linux, you may need to explicitly exclude the resources it uses in /etc/pcmcia/config.

Some PCMCIA controllers have optional features that may or may not be implemented in a particular system. It is generally impossible for a socket driver to detect if these features are implemented. Check the man page for your driver to see what optional features may be enabled.

The low level socket drivers, tcic and i82365, have numerous bus timing parameters that may need to be adjusted for systems with particularly fast processors. Symptoms of timing problems include lock-ups under heavy loads, high error rates, or poor device performance. Check the corresponding man pages for more details, but here is a brief summary:

All these options should be configured by modifying the top of /etc/rc.d/rc.pcmcia. For example:

# Should be either i82365 or tcic
PCIC=i82365
# Put socket driver timing parameters here
OPTS="async_clock=1"

On some systems using Cirrus controllers, including the NEC Versa M, the BIOS puts the controller in a special suspended state at system startup time. On these systems, the probe command will fail to find any known PCMCIA controller. In this case, edit /etc/rc.pcmcia by hand as follows:

# Should be either i82365 or tcic
PCIC=i82365
# Put socket driver timing parameters here
OPTS="wakeup=1"

2.4 Can I install Linux via NFS with a PCMCIA network card?

I've created a set of 1.44MB boot and root disks with PCMCIA support for the Slackware 2.1 distribution. The files are pcboot14.gz and pcroot14.gz on cb-iris.stanford.edu and sunsite.unc.edu (see section 1.3 ). The root disk includes cardmgr, the core PCMCIA modules, and all the network drivers. As for how to use these, you should familiarize yourself with the Slackware installation instructions, available from the usual FTP sites. The PCMCIA drivers will be loaded automatically, and installation will be the same as for a non-PCMCIA net card. Note that Slackware root disks do not include any normal user-level network utilities (ftp, telnet, etc). They only include enough network support to establish an NFS mount.

After installation is complete, you'll have a non-PCMCIA setup on your root disk. It is possible to copy things from the boot and root disks to get a working network setup, but it is tricky to put everything in the right places by hand. First, with the boot disk mounted on /mnt, do:

cp /mnt/vmlinuz /linuz
rootflags /vmlinuz 1
lilo

Then, with the root disk mounted on /mnt, do:

cp /mnt/sbin/cardmgr /sbin
(cd /mnt ; tar cf - etc/pcmcia lib/modules) | (cd / ; tar xf -)

Edit /etc/pcmcia/config and un-comment the ``start'' and ``stop'' commands for the net cards, and edit /etc/pcmcia/network to conform to your network setup.

Alternatively, if your install server has a current set of source files, you can copy current kernel sources, pcmcia sources, and module utilities to your hard disk while it is NFS mounted. Then, after rebooting, build a new kernel and install the PCMCIA software as normal.

2.5 Why doesn't my system respond to card insertions?

In most cases, the socket driver (i82365 or tcic) will automatically probe and select an appropriate interrupt to signal card status changes. The automatic interrupt probe doesn't work on some Intel-compatible controllers, including Cirrus chips and the chips used in some IBM ThinkPads. In these cases, the i82365 driver may pick an interrupt that is used by another device.

With the i82365 driver, the irq_mask option can be used to limit the interrupts that will be tested. This mask limits the set of interrupts that can be used by PCMCIA cards as well as for monitoring card status changes. For the tcic driver, the cs_irq option can be used to explicitly set the interrupt to be used for monitoring card status changes.

If you can't find an interrupt number that works, there is also a polled status mode: both i82365 and tcic will accept a poll_interval=100 option, to poll once per second.

Next Chapter, Previous Chapter

Table of contents of this chapter, General table of contents

Top of the document, Beginning of this Chapter