Skip to main content

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 in ados.hal.detect and runs at agent startup:
  1. Read /proc/device-tree/model (the Linux device tree model string)
  2. Compare against model_patterns in each board YAML file
  3. Pick the first profile whose pattern matches as a substring
  4. If no match, fall back to generic-arm64.yaml
The detection also reads system information:
  • 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 at src/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):
  1. Explicit config (agent.tier in config.yaml) overrides everything
  2. Board profile (default_tier in the YAML file) is the fallback
  3. RAM-based fallback if running on generic-arm64 with 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.
The generic-arm64 fallback profile works on any 64-bit ARM board. You can use the agent without a custom profile. Adding a board profile just improves auto-detection accuracy and enables board-specific features (like the right UART path or GPIO buttons).