14.2. Software

14.2.1. Base Modules

The required kernel modules are located in the kernel packages. Additionally, the pcmcia and hotplug packages are needed. When PCMCIA is started, the modules pcmcia_core, yenta_socket, and ds are loaded. In very rare cases, the module tcic is needed instead of yenta_socket. These modules initialize the existing PCMCIA controllers and provide the base functionality.

14.2.2. Card Manager

Because PCMCIA cards can be changed while the system is running, the activities in the slots must be monitored. This task is handled by the card services implemented in the base module. The initialization of an inserted card is handled by the card manager (for PC cards) or by the kernel's hotplug system (for CardBus cards). The card manager is started by the PCMCIA start script after the base modules are loaded. Hotplug is activated automatically.

If a card is inserted, the card manager or hotplug determines its type and function and loads the respective modules. After the modules have been loaded successfully, the card manager or hotplug launches certain initialization scripts, depending on the function of the card. The initialization scripts establish the network connection, mount partitions of external SCSI hard disks, or perform other hardware-specific actions. The scripts of the card manager are located in the directory /etc/pcmcia. The scripts for hotplug are located in /etc/hotplug. When the card is removed, the card manager or hotplug terminates all card activities with the same scripts. Subsequently, the modules that are no longer needed are unloaded.

These actions are referred to as hotplug events. Whenever hard disks or partitions are added (block events), the hotplug scripts use subfs to make the new media available for immediate use in /media. To mount media by means of the older PCMCIA scripts, subfs should be disabled in hotplug.

Both the start-up of PCMCIA and the card events are logged in the system log file (/var/log/messages). The modules that are loaded and the scripts that are executed are recorded in this log file.

Theoretically, a PCMCIA card can be removed without any additional actions. This works perfectly for network, modem, and ISDN cards, provided there are no more active network connections. However, this does not work for mounted partitions of an external hard disk or NFS directories. Such units must be synchronized and unmounted properly. Of course, this is not possible after the card has been taken out. If you are not sure, use the command cardctl eject to deactivate all cards that are still inserted in the laptop. To deactivate only one of the cards, specify the slot number, for example, cardctl eject 0.