The following things should be installed on your system before you start installing PCMCIA:
The latest version requires a kernel version 1.2.8 or higher, or a
development kernel 1.3.30 or higher. It has been tested with 1.3.30,
1.3.37, 1.3.39, 1.3.43, and 1.3.45. 1.3.38 is definitely broken, and
1.3.31 to 1.3.36 are untested. It also requires a relatively recent
set of module utilities. If your man page for insmod
describes
the [symbol=value ...]
syntax, your utilities are current enough.
There are no kernel patches specifically for PCMCIA.
You need to have a complete linux source tree for your kernel, not just an up-to-date kernel image, to compile the PCMCIA package. The PCMCIA modules contain some references to kernel source files. While you may want to build a new kernel to remove unnecessary drivers, installing PCMCIA does not require you to do so.
Current kernel sources and patches are available from
sunsite.unc.edu
in /pub/Linux/kernel/v1.2
, or from
tsx-11.mit.edu
in /pub/linux/sources/system/v1.2
.
Current module utilities can be found in the same places, in the file
modules-1.2.8.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. Any drivers compiled into your kernel will only waste space.
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 1.2.X kernels, 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, as they will just take up space.
If your kernel is compiled with CONFIG_MODVERSIONS
enabled, for
kernel symbol version checking, the configure script will check for
the existence of /usr/include/linux/modversions.h
, the symbol
version database. This is created by running ``make dep'' in the
kernel source tree.
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
hyper.stanford.edu
in /pub/pcmcia/extras
: there are both
a.out and ELF versions of the library.
Here is a synopsis of the installation process:
make config
'' in the new pcmcia-cs-2.8.?
directory.make all
'', then ``make install
''./etc/rc.d/rc.pcmcia
and the files in
/etc/pcmcia
for your site.Running ``make config
'' prompts for a few configuration options,
and checks out your system to verify that it satisfies all
prerequisites for installing PCMCIA support. In most cases, you'll be
able to just accept all the default configuration options. Be sure to
carefully check the output of this command in case there are problems.
If you are compiling the PCMCIA stuff for installation on another
machine, specify an alternate target directory when prompted by the
configure script. This should be an absolute path. All the PCMCIA
tools will be installed relative to this directory. You will then be
able to tar
this directory tree and copy to your target machine,
and unpack relative to its root directory to install everything in the
proper places.
If you are cross compiling on another machine, you may want to specify alternate names for the compiler and linker. This may also be helpful on mixed a.out and ELF systems. The script will also prompt for additional compiler flags for debugging.
There are a few kernel configuration options that affect the PCMCIA tools. The configuration script can deduce these from the running kernel (the most common case). Alternatively, if you are compiling for installation on another machine, it can read the configuration from a kernel source tree, or each option can be set interactively.
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 will be installed in the /etc/pcmcia
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.
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
'' 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
In a few cases, the probe
command will be unable to determine
your controller type automatically. The Tadpole P1000 and some other
PCI-based laptops have a special Cirrus PCI-to-PCMCIA bridge chip that
can't be detected by probe
. If you have one of these systems,
you'll need to edit rc.pcmcia
by hand to load the i82365
module.
Card Services should automatically avoid allocating IO ports and
interrupts already in use by other standard devices. It will also
attempt to detect conflicts with unknown devices, but this is not
completely reliable. In some cases, you may need to explicitly
exclude resources for a device in /etc/pcmcia/config.opts
.
Here are some resource settings for specific laptop types.
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
card recognition problems, 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:
freq_bypass
flag which changes the
multiplier for the PCMCIA bus clock to slow down all operations.fast_pci
flag, which
should be set if the PCI bus speed is greater than 25 MHz.async_clock
flag changes the relative clocking of PCMCIA bus and
host bus cycles. Setting this flag adds extra wait states to some
operations.pcmcia_core
module has the cis_speed
parameter for
changing the memory speed used for accessing a card's Card Information
Structure (CIS). On some systems with fast bus clocks, increasing
this parameter (i.e., slowing down card accesses) may be beneficial.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
PCIC_OPTS="async_clock=1"
# Put pcmcia_core options here
CORE_OPTS="cis_speed=500"
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. If this happens, edit
/etc/rc.d/rc.pcmcia
by hand as follows:
# Should be either i82365 or tcic
PCIC=i82365
# Put socket driver timing parameters here
PCIC_OPTS="wakeup=1"
If you have an ARM Pentium-90 or Midwest Micro Soundbook Plus laptop,
use the combination
``freq_bypass=1 cmd_time=8
'' to slow down your PCMCIA bus cycles.
On a Midwest Micro Soundbook Elite, try ``cmd_time=12''.
These may help on other very fast systems that use the non-PCI Cirrus
chip (the PD672x).
Red Hat and Caldera have a System V-ish arrangement for system startup
files. The PCMCIA installation scripts will automatically detect this
and adjust accordingly. The rc.pcmcia
script will be installed as
/etc/rc.d/init.d/pcmcia
. There is no need to edit any of the
Caldera startup scripts to enable PCMCIA: it will happen
automatically.
A separate configuration file, /etc/sysconfig/pcmcia
, will
be created for startup options. If you need to change any module
options (like the PCIC=
or PCIC_OPTS=
settings), edit this config
file rather than the actual PCMCIA startup script. This file will not
be overwritten by subsequent installs.
Previous releases used the /etc/sysconfig/pcmcia-scripts
directory in place of /etc/pcmcia
. The current release
instead uses /etc/pcmcia
for all systems, and will move
/etc/sysconfig/pcmcia-scripts
to /etc/pcmcia
if it
is present.
For me, distributing binaries is a significant hassle. It is complicated because some features can only be selected at compile time, and because the PCMCIA modules are somewhat dependent on having the ``right'' kernel configuration. So, I would probably need to distribute precompiled modules along with matching kernels. Beyond this, the greatest need for precompiled modules is when installing Linux on a clean system. This typically requires setting up PCMCIA so that it can be used in the installation process for a particular Linux distribution. Each Linux distribution has its own procedures, and it is not feasible for me to provide boot and root disks for even just the common combinations of drivers and distributions.
PCMCIA is now a part of many of the major Linux distributions, including Red Hat, Caldera, Slackware, Yggdrasil, and Nascent Technology.
The configure script will normally ensure that the PCMCIA modules are
compatible with your kernel. So, module loading problems generally
indicate that the user has interfered with the normal installation
process in some way. Some module loading errors are sent directly to
the Linux console. Other errors are recorded in the system log file,
normally /usr/adm/messages
. To track down a problem, be sure
to check both locations, to pin down which module is actually causing
trouble.
Some of the PCMCIA modules require kernel services that may or may not
be present, depending on kernel configuration. For instance, the SCSI
card drivers require that the kernel be configured with SCSI support,
and the network drivers require a networking kernel. If a kernel
lacks a necessary feature, insmod
may report undefined symbols
and refuse to load a module.
If insmod
reports ``wrong version'' errors, it means that the
module was compiled for a different kernel version than your system is
actually running. This might occur if modules compiled on one machine
are copied to another machine with a different configuration, or if
the kernel is reconfigured after PCMCIA is installed.
A final source of module loading errors is when the modules and kernel
were compiled with different settings of CONFIG_MODVERSIONS
. If
a module with version checking is loaded against a kernel without
version checking, insmod
will complain about undefined symbols.
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. If a device is inactive at probe time,
its interrupt may also appear to be available. In these cases, the
socket driver may pick an interrupt that is used by another device.
With the i82365
and tcic
drivers, 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. The cs_irq
option can
also 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 for card status changes once
per second.
All these options should be set in the PCIC_OPTS=
line in either
/etc/rc.d/rc.pcmcia
or /etc/sysconfig/pcmcia
,
depending on your site setup.
The most common problem of this type seems to be a conflict with a
PS/2 pointer device on interrupt 12. In this case, edit
rc.pcmcia
so the PCIC_OPTS=
line reads:
PCIC_OPTS="irq_mask=0xefff"