HAL and Tiers
The Hardware Abstraction Layer (HAL) is how the agent adapts to different companion computers. It reads the board identity at boot, loads the matching YAML profile, and configures the agent’s features based on the board’s capabilities.Board detection
The detection logic lives inados.hal.detect and runs at agent startup:
- Read
/proc/device-tree/model(the Linux device tree model string) - Compare against
model_patternsin each board YAML file - Pick the first profile whose pattern matches as a substring
- If no match, fall back to
generic-arm64.yaml
- Total RAM from
/proc/meminfo - CPU core count from
os.cpu_count() - Architecture from
platform.machine()
Board profile schema
Each profile is a YAML file atsrc/ados/hal/boards/<name>.yaml. Here is the full schema:
Tier mapping
The tier system determines which features are active. The agent picks a tier based on three inputs (in priority order):- Explicit config (
agent.tierin config.yaml) overrides everything - Board profile (
default_tierin the YAML file) is the fallback - RAM-based fallback if running on
generic-arm64with no explicit tier
Tier feature matrix
RAM guidelines
HAL modules
Beyond board detection, the HAL provides several hardware abstraction modules:Adding a new board
To add support for a board that is not in the built-in list:1
Identify the model string
SSH into the board and read the device tree model:This is the string you will match against.
2
Create the YAML file
Create
src/ados/hal/boards/your-board.yaml with at minimum:3
Add bus definitions
List the UART ports the FC might connect to, USB ports, I2C buses, and any other relevant hardware.
4
Set the right tier
Based on the board’s RAM and capabilities, pick an appropriate default tier. When in doubt, start lower and test.
5
Test
Install the agent on the board and verify detection:The board name, tier, and features should match your YAML file.
6
Submit a PR
Add the YAML file and submit a pull request to
altnautica/ADOSDroneAgent. Include the board model, where to buy it, and any quirks you discovered during testing.