Skip to content

CardBus

Levente Santha edited this page May 11, 2026 · 1 revision

CardBus

PCMCIA CardBus support for 32-bit PCMCIA cards, bridging PCI and the PCMCIA bus.

Overview

CardBus is a 32-bit parallel bus standard (PC Card-16 was 16-bit) that provides PCMCIA support for modern 32-bit devices in laptops and embedded systems. In JNode, CardBus devices are discovered through PCI enumeration — a CardBus controller is itself a PCI device (a PCI-to-CardBus bridge). Once the bridge is started, it manages the CardBus bus and the cards inserted into its sockets.

Key Components

Class / File Role
core/src/driver/org/jnode/driver/bus/pcmcia/CardBusDriver.java Driver for the CardBus controller (PCI-to-CardBus bridge)
core/src/driver/org/jnode/driver/bus/pcmcia/CardBusDevice.java A CardBus device discovered on the bus
core/src/driver/org/jnode/driver/bus/pcmcia/CardBusBus.java The CardBus bus implementation
core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType2.java PCI configuration header type 2 (CardBus bridge)

How It Works

Controller Startup

CardBusDriver is bound to a PCI device identified as a CardBus bridge. On startDevice(), it extracts the PCIHeaderType2 configuration header and creates a CardBusBus:

protected void startDevice() throws DriverException {
    final DeviceManager dm = InitialNaming.lookup(DeviceManager.NAME);
    dm.rename(device, getDevicePrefix(), true);
    PCIHeaderType2 header = ((PCIDevice) device).getConfig().asHeaderType2();
    this.bus = new CardBusBus(this, header.getCardBus());
}

Device Discovery

CardBusBus manages one or more CardBus sockets. It can probe each socket for a card and enumerate card functions as CardBusDevice instances. Cards inserted into a socket appear as child devices on the bus.

Integration with Bus-Drivers

CardBus bridges are enumerated via PCI depth-first traversal. The PCI layer calls CardBusDriver for devices matching the bridge class code, which then manages the CardBus bus. This is described in Bus-Drivers.

Gotchas & Non-Obvious Behavior

  • CardBus controllers vary between manufacturers; the current driver is based on the TI PCI4451
  • The stopDevice() method is not yet implemented — stopping a CardBus controller requires socket shutdown and card eject handling
  • Cards can be hot-plugged; device discovery may occur at runtime rather than only at boot

Related Pages

Clone this wiki locally