Section 21.15

ConceptOS: component updates and state continuity

Full name: ConceptOS, a name coined by the authors; OS is the usual short form of operating system.

What it is

ConceptOS is a research system for updating the firmware, the software stored in a device, of small always-on devices one component at a time, while the device keeps running and the updated component keeps its live data. Andrea Aspesi and Vittorio Zaccaria published it in 2024 in the IEEE Internet of Things Journal. It builds on Hubris, an operating system for microcontrollers §6.1 that divides the firmware into separately compiled tasks, and replaces one component at a time instead of the whole firmware image.

Basis of this account

This account rests only on the abstract, keywords and bibliographic record of the paper “ConceptOS: A Micro-Kernel Approach to Firmware Updates of Always-On Resource-Constrained Hubris-Based IoT Systems” by Andrea Aspesi and Vittorio Zaccaria, IEEE Internet of Things Journal, volume 11, issue 8, pages 14472 to 14482, 15 April 2024 (https://doi.org/10.1109/JIOT.2023.3343459); IoT stands for Internet of Things. The abstract and keywords were read in the record of the Politecnico di Milano repository (https://re.public.polimi.it/handle/11311/1276084), where the accepted manuscript is restricted. Volume, issue and pages come from the record that the publisher registered with Crossref, the agency that registers the identifiers of scholarly publications. The paper’s text was not read.

The description of Hubris comes from Sections 1 and 2 of the Hubris reference manual [451] (https://hubris.oxide.computer/reference/), in its current version, not necessarily the version the paper used. Nothing was run.

What the paper claims

The abstract makes these claims; quotation marks mark the authors’ words.

The keywords include micro-kernel, buddy system and relocation §12.50.

How it works

ConceptOS builds on Hubris, so Hubris comes first. Hubris is a small operating system for 32-bit microcontrollers with region-based memory protection, written in the Rust programming language and published by Oxide Computer Company. Its reference manual describes these properties.

These properties make a task a natural unit of replacement, although Hubris itself does not replace tasks; the reasoning in this paragraph is this account’s, not the abstract’s. Tasks are compiled separately and reach each other only through kernel messages, so no task’s code holds an address inside another task, and replacing one task’s code forces no other task to be rebuilt. The MPU confines each task to its own regions, so new code placed in a region cannot reach the others’ memory. And the kernel already restarts one task while the others run, and tells waiting tasks that their partner restarted, so the rest of the system already copes with a component that disappears and comes back. A single-image firmware without such boundaries is combined by the linker §12.4 into one program: functions call each other at addresses fixed when the image is linked, and data sits at fixed addresses. Changing one function can move others, every caller of a moved function must then change, and in practice the whole image is replaced and the device restarts.

The abstract names the parts of ConceptOS, a memory organization, a compile-time representation of components and a delivery protocol, but does not describe them. Two keywords point to ingredients without saying how ConceptOS uses them. A buddy system is a memory allocator that splits memory into blocks whose sizes are powers of two, and merges a freed block with its equal-sized neighbor, its buddy. Relocation is the adjustment of addresses inside compiled code so that the code can run at an address chosen after compilation. Both fit the problem of placing a new component, possibly of a different size, into free flash memory and RAM; this account cannot confirm how ConceptOS applies them.

Live state transfer is what separates such an update from a restart. A Hubris restart gives the task fresh data. An update with live state transfer §19.5.2 must instead give the new version the old version’s data, converted to the new version’s layout and meaning, at a moment when the old version is not in the middle of work. The abstract does not say how ConceptOS converts state or chooses that moment.

Worked example

This example is invented to show why replacing code atomically does not by itself transfer state correctly; nothing in it comes from the paper. A sensor-hub component keeps a running average of temperature readings. Version 1 stores two values in RAM: the sum of all readings, in hundredths of a degree Celsius, and the number of readings. After 400 readings with an average of 21.50 degrees, it holds a sum of 400×2150=860,000400 \times 2150 = 860{,}000 and a count of 400. Version 2 stores the average itself, in thousandths of a degree, and the count.

What this account does not establish

Only the abstract and keywords were read. This account cannot say how ConceptOS places components, how it converts state, when it switches, what happens if power fails during an update, or how a device checks who sent a component.

The abstract does not define its baselines. The 21% less space and the 53.8% less unavailability are relative to a conventional update whose design, device and measurement method this account has not seen, and the abstract does not say which space is meant: flash memory, transfer size or RAM.

The statements about Hubris come from its current reference manual, not from the version the paper used.

Atomic code replacement and correct state transfer are different properties, as the worked example shows. A system that offers both still needs a correct transfer function for each pair of versions.

Replacing one component while others run also assumes, in general, that the messages between components stay compatible. If version 2 of a component expects different messages, the components that send to it must change too.

Questions answered

Why does atomic code replacement not prove correct state transfer?

Atomic code replacement does not prove correct state transfer because it guarantees only when the switch happens, while state transfer concerns what data the new code receives, and that is computed by a separate step that the switch does not check. Atomic replacement means that every execution runs either the old code or the new code, never a mixture, from one chosen instant on. State transfer must turn the old version’s data into data that meets the new version’s representation invariant: the conditions that the new code assumes about stored values, including their units, layout and meaning. A perfect switch leaves these failures untouched:

Correctness must therefore be shown for the transfer function itself: for every state the old version can be in at the switch, the converted state must be one from which the new version continues correctly. The switch must also happen at a quiescent point §14.34 for the component, a moment when no operation of the old version is in progress.

Related entries: Live state transfer and representation invariants (§19.5.2), Quiescent state for a live update (§19.5.1), Microkernel, monolithic kernel, and service isolation (§19.5.4), Interprocess communication and authority transfer (§19.5.5), Memory protection unit (MPU) (§6.8), Flash memory (§6.6), Dynamic patching and hot update (§14.33), Quiescent point (§14.34), Relocation: turning a symbolic reference into exact encoded bits (§12.50), FLEX: indirection tables and publication of a new execution view (§21.16). Further reading: [219, 451].