Skip to content
elekloaderPublic

About

telos, the elekloader OS: flash once, then keep your mods on the unit. Mods sent over USB, switched on and off from the unit's SETTINGS, linked at every boot. For every elekloader device; Digitone mk1 first.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

telos, the elekloader os

telos

The elekloader OS. Flash once, then keep your mods on the unit itself. A build flashed once with telos links more mods at every boot from a store on the unit, with no new firmware: you send .elemod files over USB, and a page in the unit's SETTINGS switches them on and off.

telos is part of elekloader, the mod loader for Elektron firmware, and is meant for every device elekloader supports.

Device telos Status
Digitone mk1 and Digitone Keys (OS 1.43, 1.44) 0.4 runs on a unit (OS 1.44); OS 1.43 in digiemu's emulator only
Octatrack MKI and MKII (OS 1.40C) 0.4 runs in octabam's emulator only; in octatrack/
Digitakt mk1 (OS 1.53, 1.54) 0.4 runs in digiemu's emulator only; needs elekloader core 4.5 or newer; in digitakt/
Digitakt II (OS 1.17) 0.4 runs in ElekLabs digikit's emulator; digitakt2/README.md
Digitone II (OS 1.12) 0.4 runs in ElekLabs digikit's emulator; digitone2/README.md
Analog Four MKII (OS 1.56) 0.3 built against stock 1.56 only; the A4 Drive Loader under TELOS's name, in a4mk2/
Analog Rytm MKII (OS 1.74) 0.1 built against stock 1.74 only; the Rytm Drive Loader under TELOS's name, in ar2/
Model:Cycles, Model:Samples (OS 1.13) 0.4 runs in digiemu's emulator only; needs elekloader core-mc / core-ms 0.4 or newer; models/README.md
Analog Rytm MKI, Analog Four MKI planned

The rest of this page is the Digitone mk1's: OS 1.43 and 1.44, on elekloader's core-dn1 5.4 or newer. TELOS builds with core-dn1 5.0 to 5.3, but those don't list the OS's tasks (core_tasks), so TELOS finds no safe moment to write sites and refuses every mod (E26). Version 0.2 has run on a Digitone mk1 with OS 1.44: three mods sent over USB (19 KB in 0.6 s), restarted into, run, and switched off and on again from the unit.

Install

  1. Build your OS with TELOS in elekloader, as any mod: TELOS and core-dn1 with your stock OS file. It needs an elekloader whose Digitone mk1 profile gives +Drive mods their area (drive_align); with an older one, the build has no room for them and every mod shows E17.

  2. Flash it, as any OS update. Back up your projects first; the stock OS file puts the unit back.

  3. Send mods with the unit on USB (close Elektron Transfer and Overbridge first: they hold the port), with the sender (Install the sender):

    telos unit add MOD.elemod ...
    telos unit restart

    They load after the restart. add formats the store the first time and replaces a file of the same name; --off sends a mod switched off. list, on NAME, off NAME, remove NAME, clear, info and format do the rest, and --port picks a MIDI port by part of its name (default Digitone). The files go as published: the unit links them against its own OS. The same commands with a card image in place of unit (an emulator's plusdrive.img) write the store into the image.

    Analog Rytm MKII (coming in 0.5): telos unit --device analog-rytm-mk2 ... (port Rytm by default) drives the Rytm's Drive Loader 0.13 or newer, which answers the same SysEx on the +Drive's /mods (elekloader's mods/drive-loader-ar2/TELOS.md). The list is every .elemod below /mods, flat; add puts a new file in /mods/transfers and a re-sent one over the old where it is, so nothing is removed first, and a file must fit the unit's upload stage (info). The unit refuses on when the build would not load with it (status 12, with the refusal code, e.g. E33 payloads 64), remove for a file in the build or running (13), and format while +Drive mods run (14). clear switches everything off, then removes what it can. No card image.

    Analog Four MKII (coming in 0.5): telos unit --device analog-four-mk2 ... (port Analog Four by default) drives the A4's Drive Loader 0.3 or newer the same way (elekloader's mods/drive-loader-a4mk2/TELOS.md), over the loader's own store on the +Drive: info gives that store's free space and largest free run, and a file must fit the largest run. A re-sent file is written next to the old one, which is freed only once the new one is in, so a replacement needs that room too; when the unit has none, add stops and says so and never removes anything to make room. USB only. No card image.

Install the sender

The sender is tools/telos.py, one file that needs no elekloader. Any of these:

  • pip (Python 3.8 or newer): pip install git+https://github.com/elekloader/telos gives the telos command. On Windows it installs nothing else (it talks to the Windows MIDI API itself). On macOS and Linux it also installs mido and python-rtmidi; where python-rtmidi has no wheel for your Python, pip builds it, which needs a C++ compiler and the Python and ALSA headers. Without them, pip install --no-deps git+https://github.com/elekloader/telos installs the card commands, and telos unit says what it needs. (The two packages stay required, not an extra, so that telos unit works straight after pip install wherever a wheel exists.)
  • The file: python telos.py unit ..., with the same packages as pip's on macOS and Linux.
  • A Windows exe (no Python on the computer that runs it), built with PyInstaller: pyinstaller --onefile --name telos tools/telos.py makes dist/telos.exe.

On the unit

SETTINGS (the GLOBAL key), then MODS (TELOS), the last row, with a gear: a page with one row per mod in the store, its state on the right, the store's use in the title bar, and APPLY & RESTART last (RESTART when nothing changed). UP, DOWN or any knob move; YES switches a mod on or off for the next boot (RIGHT on, LEFT off), written to the store at once; YES on APPLY & RESTART reboots, and the boot links the new set; NO goes back to SETTINGS. PLAY, STOP and TEMPO stay the Digitone's.

state means
ON on, running
+ON on from the next boot
OFF off
-OFF off from the next boot, running until then
E<n> on, but the boot refused it: n is the refusal code (elekloader's docs/FORMAT.md, "+Drive refusal codes"). E15: the mod adds to a table or event the flashed build does not have: flash the companion mod that adds it (or a newer core) with TELOS

A mod that crashes. A boot that links mods sets a crash guard in the store, and 10 s of ticks later clears it. A crash before then restarts the unit at once, and a boot that finds the guard links nothing and clears it: one safe boot, then the set again.

Projects and their mods. Each project saved under TELOS keeps the list of mods that were running (a hash of each mod's id and version, in the project's mod data). Loading one (the Digitone asks to save the current project first, as stock does):

  • After the load, when the project's mods are not the ones running, LOAD PROJECT MODS? lists what YES would do: + turn on, - turn off, ~ switch to the project's version (both in the store), and what it cannot: ? a mod not on the unit, ! another version than the project's, or one the boot refused (E<n>). YES writes the store and restarts; NO keeps the mods. With only ? and ! it says so (YES OK).
  • After that restart the unit says only what is still not as the project had it.

The boot's own load of the last project says nothing, nor does a project saved without the list (before this, or with the project's mod data full: the list goes last, after the pedals' settings). Saving a project records what runs then.

What a TELOS mod may be

A +Drive mod (elekloader's docs/FORMAT.md, "+Drive mods"): .run and .bss only, no sites, entries only in tables that take more. core-dn1's tables get 16 spare entries each in a TELOS build. A table core reads once at boot (core_params) takes the entry but core never reads it, so a mod's parameter slots do not show yet. examples/hello is the smallest one.

The store

2 MB of the +Drive's raw sectors, from sector 0x380000 (telos.h, and STORE in tools/telos.py). No stock code reads or writes there: every stock card access is below sector 0x180000, FORMAT +DRIVE erases only below that, and the smallest eMMC part the firmware accepts ends at 0x3A4000. It is not a project slot, so it never shows in Transfer. It holds up to 63 files.

The directory has two copies, each with a sequence number and a CRC-32. The newer valid copy counts, and a write goes to the other one, so a write cut short by a power loss leaves the older copy standing. Sectors +17 to +31 hold TELOS's index of the mods it has met (id, version, title), which names a mod a project needs after the mod is gone. The layout is in telos.h and projset.c.

How it works

  • When. At core-dn1's ev_card_ready, in the init task: the card is up, and the project, the UI task, the views and the MIDI task do not exist yet.
  • The link is elekloader's +Drive boot linker (vendor/drive-loader, see its README) against the build descriptor core_desc. TELOS writes the chosen files as an /mods/active text (name and CRC-32 per line) and reads each file from the store by name. A file whose CRC is not the directory's is dropped (code 2).
  • Memory. The mods run from what the flashed build leaves of core's 1.25 MB (about 1.1 MB with core and TELOS alone). The link's staging buffer (512 KB, one file at a time) and its heap (1 MB) are scratch at the start of the bulk area, used only during the link, before any mod runs. The bulk area's contract is that a mod clears what it reads before writing it, so a pedal that owns that piece finds what it would at power-on. The status the page shows is copied out of the scratch heap first.
  • The page. row.s adds the SETTINGS row (core's ev_settings, core_additem; its label needs the firmware's std::string constructor, and its gear icon, a 9 x 9 bitmap object its draw callback blits as the stock rows' do, the bitmap class's vtable: defsyms in mod.json, 1.44's in its port). page.c draws over SETTINGS on ev_draw and takes the keys on ev_key and ev_enc while it is open, NO's release too, so SETTINGS stays open under it.
  • The transfer (upload.c): SysEx F0 7D 54 4C <cmd> <seq> <7-bit body> F7 (0x7D is MIDI's non-commercial id), at core-dn1's ev_sysex. The MIDI task carries each request out and answers it, which the host waits for: a file goes as 512-byte DATA requests into the first free run of sectors that holds it, and END reads it back and checks its CRC-32 before the directory gets its entry. The MIDI task is above the UI task, so the page never runs in the middle of a request; the page's own writes set telos_dir_busy, and a request meanwhile is answered BUSY. Other MIDI input waits while a sector is written. The commands are at the top of upload.c; tools/telos.py's Unit is the host's side.
  • The cache. After the link, flush.s pushes the data cache and invalidates the instruction cache, as the Rytm's loader does.

Build and test

python -m elekloader.sdk.build . --stock Digitone_and_Digitone_Keys_OS1.44.syx --out out

Every TELOS mod.json has "exports": []: TELOS's globals, memcpy among them, stay its own, so a mod that defines the same names links beside it. An elekloader SDK that predates "exports" ignores the key and exports them all.

python tests/test_telos.py

The tests need no firmware and no elekloader: they check the store's layout against telos.h and run tools/telos.py against a fake unit. In digiemu's emulator (over its DIN MIDI) a fresh unit took three mods in 1.9 emulated seconds on 1.43 and 1.44, and the next boot loaded them; digiemu's UI task stops after any MIDI input, so the emulator can't show the page after a transfer, nor RESTART.

Not yet

  • The largest SysEx the unit takes: 600-byte DATA requests work on a unit, larger ones are untried.
  • On a unit: the crash guard, a refused mod's E<n>, a transfer while a pattern plays, OS 1.43.
  • Sending mods from elekloader's web page.
  • A skip key at power-on.
  • core_params at run time (a core-dn1 core_param_install).
  • A check before switching on: the page shows a refusal only after the restart.

Licence

GPL-2.0-or-later (LICENSE), as elekloader. vendor/drive-loader is elekloader's, under the same licence.

About

telos, the elekloader OS: flash once, then keep your mods on the unit. Mods sent over USB, switched on and off from the unit's SETTINGS, linked at every boot. For every elekloader device; Digitone mk1 first.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages