HardwareAPI is a low-level, capability-gated C11 ABI with C++17 adapters. It provides a deterministic simulator plus read-only hosted discovery backends for Windows and Linux.
cmake -S . -B build -G Ninja
cmake --build build
ctest --test-dir build --output-on-failureThe simulator exposes one PCI-like device with a 4096-byte BAR. MMIO access is checked for nonzero bounded ranges, alignment, permissions, and live mapping/device state. Context close returns HW_ERROR_BUSY while child resources remain open.
Hosted privileged operations require the matching driver endpoint. Without it, operations return an explicit unavailable/unsupported result; the library never silently falls back to simulation.
| Module | Current backend | Evidence |
|---|---|---|
| Core and simulator | deterministic simulator | automated CTest coverage |
| Windows system/PCI/USB discovery | SetupAPI read-only backend | windows_discovery test |
| Linux system/PCI/USB/storage discovery | /proc, /sys, and read-only device files |
linux_discovery test |
| Linux PCI config reads and read-only BAR mappings | privileged boundary plus guarded hosted path | transport and lifecycle tests; target driver required for config IOCTL |
| DMA, USB transfers, interrupts, storage writes/flush, power/reset | simulator or explicit unsupported result | lifecycle and policy tests |
| Windows/Linux transport | native exchange client | endpoint probe and error translation tests |
| Windows driver boundary | source in drivers/windows |
WDK, signing, and target-machine validation required; hardware operations remain explicit STATUS_NOT_SUPPORTED |
| Linux kernel boundary | source in drivers/linux |
kbuild; read-only system/PCI discovery handlers; target-kernel and device-node validation required |
| ARM64/RISC-V HAL | descriptor contract only | validation test; no board hardware claimed |
Successful simulator tests prove API behavior only. They do not prove a physical MMIO transaction, DMA mapping, interrupt delivery, storage persistence, or driver installation.
All public records are caller-sized, C-compatible, and versioned where evolution is expected. Resources are opaque handles and return hw_result_t. The C++ layer in hardwareapi/cpp.hpp owns handles with move-only RAII and performs no automatic retries.