|
<< Click to Display Table of Contents >> Navigation: ASA-EMulatR Reference Guide > Introduction > Architecture Overview > Chapter 10 – Devices and Memory-Mapped I/O (MMIO) > 10.4 Device Registration and Catalog |
DeviceCatalog (mmio_DeviceCatalog.h, 130 lines) is the template database for all device types. It stores DeviceTemplate instances keyed by template ID (e.g., "qlogic_isp1020"), PCI vendor:device ID, or device class. Built-in templates are registered via initializeBuiltins(), which calls addBuiltinScsiTemplates(), addBuiltinNicTemplates(), addBuiltinUartTemplates(), addBuiltinIdeTemplates(), addBuiltinBridgeTemplates(), and addBuiltinClassDefaults().
Lookup methods: getTemplate(key), lookupByPciId(vendorId, deviceId), lookupByPciSubsystemId(...), lookupByClass(cls). Custom templates can be added via addTemplate().
DeviceTemplate (mmio_deviceTemplate.h, 208 lines) is the complete device specification structure. It contains identity and metadata (displayName, vendorName, templateId, mmio_DeviceClass, PCI vendorId/deviceId/revision/classCode), resource requirements (QVector<BarTemplate> for MMIO windows, QVector<IrqTemplate> for interrupt lines), DMA capabilities (dmaMask, support flags), and defaults (IPL, MSI support).
IrqTemplate specifies: IPL level, SCB vector index, trigger mode (Edge/Level), routing policy (FixedCPU), and affinity CPU.
Devices are created by specialized managers (SCSIDeviceManager, ConsoleManager, NetworkManager, FibreDeviceManager, IDEDeviceManager, etc.), registered with MMIOManager (assigned physical address ranges), registered with the interrupt subsystem (assigned IRQ vectors and IPL), and optionally bound to backing storage or network endpoints. Once registered, devices become visible to all CPUs via GuestMemory → MMIOManager routing.
See Also: mmioLib/mmio_DeviceCatalog.h; mmioLib/mmio_deviceTemplate.h.