|
<< Click to Display Table of Contents >> Navigation: ASA-EMulatR Reference Guide > Introduction > Architecture Overview > Chapter 16 – Device Model & DMA > 16.1 Device Differentiation and Class Hierarchy |
EMulatR distinguishes devices by function, bus attachment, and I/O characteristics. The mmio_DeviceClass enumeration in coreLib/mmio_core.h provides the primary classification:
enum class mmio_DeviceClass : quint8 {
INVALID = 0, UNKNOWN,
// Controllers (bus-facing HBAs)
SCSI_HBA, IDE_CONTROLLER, NIC,
// Child devices (protocol-level)
SCSI_DISK, SCSI_TAPE, SCSI_CDROM, SCSI_CONTROLLER,
IDE_DISK, IDE_CDROM,
UART_CONSOLE, UART,
// Infrastructure
HOST_BRIDGE_NODE, BRIDGE
};
This enumeration drives template selection in DeviceCatalog, MMIO window attribute assignment, interrupt routing policy defaults, and diagnostic identification. The two-tier structure — controllers versus child devices — reflects the physical Alpha bus topology: a SCSI HBA controller sits on the PCI bus with its own MMIO BAR, while individual SCSI disks and tapes are protocol-level entities behind that controller.
Each device category has a dedicated manager responsible for device lifecycle, resource allocation, and bus-specific protocol handling:
Manager |
Device Classes |
Responsibility |
|---|---|---|
SCSIDeviceManager |
SCSI_HBA, SCSI_DISK, SCSI_TAPE, SCSI_CDROM |
SCSI bus topology, LUN enumeration, command routing |
IDEDeviceManager |
IDE_CONTROLLER, IDE_DISK, IDE_CDROM |
IDE channel/master-slave pairing, PIO/DMA mode |
NetworkManager |
NIC |
Network adapter lifecycle, packet I/O, MAC addressing |
FibreDeviceManager |
Fibre Channel / FG storage |
FC fabric topology, port login, FCP command dispatch |
ConsoleManager |
UART_CONSOLE, UART |
Serial console (OPA0), terminal I/O, SRM console integration |
FirmwareDeviceManager |
ROM, firmware regions |
SRM firmware loading, DMA coordination (~540 lines) |
Each manager is independently instantiable and registers its devices with the shared MMIOManager and IRQ system. This independence means device categories can be developed and validated in isolation — a fully functional SCSI subsystem does not require a working network stack, and vice versa.
Storage devices in EMulatR support multiple backing strategies, selectable per device instance:
Direct RAW Partition Access — The device emulator maps a host-side raw disk partition (or raw disk image file) directly as the guest storage medium. Reads and writes translate 1:1 to host-side block I/O. This mode provides the highest fidelity to real hardware behavior and is the preferred mode for production guest OS installations. RAW access implies no metadata overhead and no container format translation.
File System Container — The guest disk is stored as a container file on the host file system (e.g., a flat image file or a structured container with embedded metadata). This mode supports snapshot-friendly workflows, easier backup, and host-side inspection. The container format includes a header describing geometry, sector size, and optional compression. Access goes through the host file system, which adds latency but enables portability across host platforms.
Fibre Channel / FG Storage — Fibre Channel devices present storage via the FCP (Fibre Channel Protocol) command set. The FibreDeviceManager emulates FC port login, fabric topology, and FCP command routing. Backing storage may be either RAW or container, but the guest sees an FC-attached LUN with FC-specific inquiry data and error recovery semantics. This path is structurally complete at the manager level but requires further FCP command coverage.
All three modes present the same SCSI or IDE command interface to the guest — the backing strategy is transparent to guest software. The device manager selects the appropriate host-side I/O path based on configuration in EMulatR.ini.
See Also: mmioLib/IDeviceEmulator.h (~266 lines) – Device interface contract; coreLib/mmio_core.h (~405 lines) – mmio_DeviceClass enumeration, MMIOWindow attributes; mmioLib/mmio_DeviceCatalog.h (~130 lines) – Template database.