← All posts

Ambiorix (AMX) architecture: container, bus abstraction and data model

Grow through practice

No need to finish reading — test now

Based on reading the open-source Ambiorix project. APIs are defined by the actual source.

Short answer

AMX is not another bus. It is a C framework that sits above ubus/D-Bus/private buses and gives components a common way to register, expose objects, and exchange data.

Three layers: container → bus abstraction (libamxb) → data model (libamxd/ODL). If you know Java/Spring, "C Spring" is a useful hook, but AMX also owns the object tree and bus abstraction.

One line

Ambiorix (AMX) is the core framework of prplOS: a component container + bus abstraction + data model, in C.

If you come from Java, the closest analogy is a C version of the Spring container: it manages components, lifecycles and dependencies. But it is more than DI — it also owns the bus and the object tree.

Why it exists

Embedded systems have many buses:

  • ubus (OpenWrt)
  • D-Bus (RDK-B / desktop)
  • plus proprietary buses

The result: the same business component must be rewritten for every platform.

AMX's goal:

Provide a common C API over all these buses, so components can be reused across platforms.

It is not another bus — it is an abstraction layer over buses.

Layers

        Clients / apps (amx-cli, ba-cli, web)
                        │
                  ┌─────▼─────┐
                  │  libamxb  │  bus abstraction (ubus / D-Bus / private)
                  └─────┬─────┘
                        │
        ┌───────────────▼───────────────┐
        │  libamxd  data model (tree)   │◄── libamxo  ODL assembly/parsing
        │  Object / Parameter / Function│
        └───────────────┬───────────────┘
                        │
                  ┌─────▼─────┐
                  │  libamxc  │  containers (list / hash / variant)
                  └───────────┘

        libamxrt = runtime container: init → start → stop

The four pieces

  1. libamxc — containers: linked lists, hash tables, dynamic arrays, variants. The building blocks.
  1. libamxd — data model: objects/parameters/functions form an addressable tree. The "beans and properties."
  1. libamxb — bus abstraction: hides ubus/D-Bus behind one API. Dependency lookup and calls.
  1. libamxo — assembly (ODL): Object Definition Language describes and loads the tree. Configuration/assembly.
  1. libamxrt — runtime: component loading and lifecycle (init/start/stop).

Compared with Spring

SpringAMXRole
Bean container / IoClibamxrt + libamxdcomponent and object lifecycle
Bean / propertiesObject / Parameter (libamxd)data model
@Autowired / lookuplibamxbdecoupling, bus lookup
XML / annotationslibamxo ODLdescribe and load the object tree
Collectionslibamxccontainers in C

But be clear about the difference: Spring is a dependency-injection framework; AMX is a bus abstraction + data model + component framework. "Container" is a useful hook, not a precise equivalence.

A minimal chain

ODL describes the object tree
  → libamxo parses and loads it into libamxd
  → components register on libamxb
  → clients query/call objects over the bus

When you query a node with ba-cli, you are using the last mile of this chain.

Boundaries

  • AMX manages components and interfaces, not business logic.
  • Its value: swap the bus without touching business code.
  • It is not magic: the quality of the data model still depends on the person designing the components.

Next: Ambiorix Explained (2): the data model — objects, parameters, paths.

More: wait_for example · prplOS vs OpenWrt · Working UCI mapping demo

Practice

Found this useful?

I write about AI agents × embedded / edge AI. Subscribe, or email me a concrete problem.

Guestbook →Subscribe (RSS)Support

Comments 0

No comments yet — be the first!

No login required; name is optional.