s i s t e m a o p e r a c i o n a l m a g n u x l i n u x | ~/ · documentação · suporte · sobre |
Next
Previous
Contents
5. Advanced topics
5.1 Resource allocation for PCMCIA devicesIn theory, it should not really matter which interrupt is allocated to
which device, as long as two devices are not configured to use the
same interrupt. In Similarly, there is no way to directly specify the I/O addresses for a
card to use. The After modifying The interrupt used to monitor card status changes is chosen
by the low-level socket driver module ( All the client card drivers have a parameter called
would specify that the serial driver should only use irq 8 or irq 12.
Regardless of
5.2 PCI interrupt configuration problems and solutions
An overview of PCI interrupt routing issuesEach PCI slot has four PCI interrupt pins, INTA through INTD. Single function devices will only use the INTA pin; multifunction devices may use multiple INT pins. On the processor side, on x86 single processor systems, incoming hardware interrupts are directed to interrupt requests (irq's) numbered 0..15. The PCI interrupt router, usually part of the PCI-to-ISA host bridge, determines how incoming PCI interrupts are mapped to CPU irq numbers. Most modern bridge chips have several PCI interrupt inputs, known as PIRQ1, PIRQ2, etc, each of which can be routed to any CPU irq number. So we might have something like:
Multiple INT pins are often connected to the same PIRQ pin. Usually, the connections from INT pins to PIRQ pins are arranged to spread installed devices out as much as possible, to give the OS the most flexibility for choosing how interrupts are shared. The mapping from bridge PIRQ pins to CPU irq numbers can be obtained by reading registers in the interrupt router. The mapping from INT pins to the router's PIRQ pins, however, depends on how the board designer decided to connect things up, and cannot be directly determined by driver software. For most PCI devices, the OS does not need to understand the interrupt router details. Each PCI device has a configuration register, the PCI Interrupt Line Register, that the BIOS initializes with the appropriate CPU irq number for that device. Unfortunately, the BIOS generally will not configure PCI interrupts for CardBus bridge devices. The PCI BIOS's Interrupt Routing Table is a data structure that contains information about the mapping from PCI INT pins to the PIRQ pins on the PCI interrupt router. The routing information in the table is stored in a somewhat unhelpful form, however. For each device's INT pins, the table specifies a ``link value''. All interrupts with the same link value are wired to the same PIRQ pin; however, the meaning of the link values is defined by the chipset vendor. Several tools are available for examining PCI interrupt routing information:
Several PCMCIA module parameters affect PCI interrupt routing:
If you are having problems that you think may be related to PCI interrupt configuration, you should first verify that you have a reasonably current PCMCIA driver package. Also carefully look at the startup messages when the PCMCIA kernel modules are loaded. You should see something like:
The ``
CardBus bridge is not detected by the PCI BIOS
Symptoms:
The Lucent/SCM PCI-to-CardBus adapters seem to confuse the PCI BIOS on some older systems. Lucent says that this card is only supported on systems that have a BIOS that supports the PCI 2.2 specification, or are PC99 compliant. Some older systems will not detect the Lucent card at all, and if the system can't detect it, the Linux drivers cannot use it. The only possible resolutions are a BIOS upgrade, or using a different motherboard or CardBus adapter.
PCI interrupt delivery problems
Symptoms:
CardBus bridges usually support two types of interrupts, PCI and ISA. Partly for historical reasons, it has become conventional to use PCI interrupts for signaling card insertion and removal events, and for CardBus card interrupts; and ISA interrupts for 16-bit cards. Since version 3.1.9, this is the scheme that the Linux PCMCIA system will use by default. Most CardBus bridges support multiple methods for delivering interrupts to the host CPU. Methods include ``parallel'' interrupts, where each supported irq has a dedicated pin on the bridge; various serial interrupt protocols, where one or two pins are used to communicate with an interrupt controller; and hybrids, where PCI interrupts might be signalled using dedicated pins, while ISA interrupts are delivered via a serial controller. In general, it is the responsibility of the BIOS to program a bridge
for the appropriate interrupt delivery method. However, there are
systems that do this incorrectly, and in some cases, there is no way
for software to safely detect the correct delivery method. The
Most PCMCIA card readers that fit in a PCI bus slot only provide PCI
interrupt routing. The Linux drivers assume that all bridges have ISA
interrupt capability, since that is generally correct on laptops.
With a card reader, it will generally be necessary to use the
Check the system log and verify that the CardBus bridge has a PCI
interrupt assignment. If it does not, then resolve that problem
first, then return here if the symptoms persist. Next, experiment
with different values for the
No PCI interrupt assignment; valid routing table
Symptoms:
When a routing table is present, the Moving the card to another slot sometimes offers a quick solution. If that slot shares its interrupt with an already-configured device, then the PCMCIA drivers will have no trouble figuring out the assignment.
No PCI interrupt assignment; unknown interrupt router
Symptoms:
Adding support for a new interrupt router is tricky but not a big
job. First determine, from a datasheet, how your interrupt router
steers PCI interrupts. Then, see if you can guess the meaning of the
link values from the output of
No PCI interrupt assignment; no routing table
Symptoms:
Without an interrupt routing table, we cannot tell how interrupts from
the CardBus bridge are directed to CPU irq numbers. All hope is not
lost: you may be able to guess the PCI interrupt assignment and use
the `` You may also want to experiment with putting the adapter in different
PCI slots, for each
5.3 How can I have separate device setups for home and work?This is fairly easy using ``scheme'' support.
Use two configuration schemes, called ``home'' and ``work''. Here is
an example of a
The first part of a device address is always the configuration scheme. In this example, the second ``case'' clause will select for both the ``home'' and ``default'' schemes. So, if the scheme is unset for any reason, it will default to the ``home'' setup. Now, to select between the two sets of settings, run either:
or
The To find out the current scheme setting, run:
By default, the scheme setting is persistent across boots. This can
have undesirable effects if networking is initialized for the wrong
environment. Optionally, you can set the initial scheme value with
the To save even more keystrokes, schemes can be specified in
Typing ``home'' or ``work'' at the boot prompt would then boot into the appropriate scheme.
5.4 Booting from a PCMCIA device
Having the root filesystem on a PCMCIA device is tricky because the Linux PCMCIA system is not designed to be linked into the kernel. Its core components, the loadable kernel modules and the user mode cardmgr daemon, depend on an already running system. The kernel's ``initrd'' facility works around this requirement by allowing Linux to boot using a temporary ram disk as a minimal root image, load drivers, and then re-mount a different root filesystem. The temporary root can configure PCMCIA devices and then re-mount a PCMCIA device as root. The initrd image absolutely must reside on a bootable device: this generally cannot be put on a PCMCIA device. This is a BIOS limitation, not a kernel limitation. It is useful here to distinguish between ``boot-able'' devices (i.e., devices that can be booted), and ``root-able'' devices (i.e., devices that can be mounted as root). ``Boot-able'' devices are determined by the BIOS, and are generally limited to internal floppy and hard disk drives. ``Root-able'' devices are any block devices that the kernel supports once it has been loaded. The initrd facility makes more devices ``root-able'', not ``boot-able''. Some Linux distributions will allow installation to a device connected to a PCMCIA SCSI adapter, as an unintended side-effect of their support for installs from PCMCIA SCSI CD-ROM devices. However, at present, no Linux installation tools support configuring an appropriate ``initrd'' to boot Linux with a PCMCIA root filesystem. Setting up a system with a PCMCIA root thus requires that you use another Linux system to create the ``initrd'' image. If another Linux system is not available, another option would be to temporarily install a minimal Linux setup on a non-PCMCIA drive, create an initrd image, and then reinstall to the PCMCIA target. The Linux Bootdisk-HOWTO has some general information about setting up
boot disks but nothing specific to initrd. The main initrd document
is included with recent kernel source code distributions, in
This is an advanced configuration technique, and requires a high level of familiarity with Linux and the PCMCIA system. Be sure to read all the relevant documentation before starting. The following cookbook instructions should work, but deviations from the examples will quickly put you in uncharted and ``unsupported'' territory, and you will be on your own. This method absolutely requires that you use a PCMCIA driver release of 2.9.5 or later. Older PCMCIA packages or individual components will not work in the initrd context. Do not mix components from different releases.
The pcinitrd helper scriptThe As an example, say that your laptop uses an i82365-compatible host controller, and you want to boot Linux with the root filesystem on a hard drive attached to an Adaptec SlimSCSI adapter. You could create an appropriate initrd image with:
To customize the initrd startup sequence, you could mount the image using the ``loopback'' device with a command like:
and then edit the
Creating an initrd boot floppy
After creating an image with
Create
Finally, invoke lilo with:
When
Installing an initrd image on a non-Linux driveOne common use of the initrd facility would be on systems where the
internal hard drive is dedicated to another operating system. The
Linux kernel and initrd image can be placed in a non-Linux partition,
and Assuming that you have a kernel has been configured for the
appropriate root device, and an initrd image created on another
system, the easiest way to get started is to boot Linux using
Once you can boot Linux on your target machine, you could then
install
In this example, say that
The To install
Note that in this case, the
Next Previous Contents |