QNX Developer Support
|This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.|
Automatically start drivers when PC Cards are inserted
|You must be root to run this utility.|
pccard-launch [-nv] 'type,command'...
- Don't lock the socket where the expected card is found.
- Display verbose messages on standard output.
- For this PC Card type, spawn command.
Types may be specified in decimal (nnnn) or hexadecimal
(0xnnn), and are followed by a comma (,)
and the command to execute.
pccard-launch '0x600,io-net -dne2000 ioport=0x$IOPORT,\ irq=$IRQ'
You can specify multiple type/command pairs on the command line by separating them with whitespace. If the command specified contains whitespace, the command must be enclosed in quotes (as shown).
The pccard-launch utility automatically starts drivers and sets environment variables describing the ports and IRQs used by a card, thus permitting a non-PC Card-aware driver to be started automatically when a card is inserted, and stopped when removed.
The environment variables may be named in the command lines for the drivers to be run, thus allowing the port and IRQ information to be passed on the command line to the drivers, most of which aren't aware of the environment variables set by pccard-launch.
This utility both starts driver when cards are plugged in and stops them via a SIGTERM signal when cards are removed.
When a card is plugged in, pccard-launch checks the card type against the list of card types/driver commands supplied to it on its command line. If it doesn't know about the card type, it does nothing. If it has been provided with a command for the card type, it does the following:
- Locks the card.
- Sets up environment variables detailing I/O port locations, IRQ used, etc.
- Spawns the associated command.
When the card is removed, pccard-launch unlocks the card and signals the previously spawned process with SIGTERM.
You can determine the card type by using the pin command. A pin con command displays configuration information for the PC Card. Look at the config line, which should look something like:
config = 0xNN, 0xTTTT..."
where NN is the configuration number and TTTT is the type of the card. For example, a modem card has a type of 0x200. This is the type that you must use on the command line for pccard-launch.
Automatically start the ne2000 driver with the appropriate I/O port and IRQ settings, for PC Card type 0x600:
pccard-launch '0x600,io-net -dne2000 ioport=0x$IOPORT,irq=$IRQ'
- This utility is located in the /usr/sbin/ directory.
The environment variables set by pccard-launch are:
- Hex address of the I/O port (e.g. 320).
- Size of the I/O port (e.g. 32).
- Hex address of the second I/O port, if assigned.
- Size of the second I/O port, if assigned.
- IRQ of the device.
- The socket where the card is inserted.