NAVX — developer guide
The repository is a pnpm/turbo monorepo. Libraries are isomorphic (Uint8Array, no Node APIs) so the web app uses the same code as the CLI.
| Package | Contents |
|---|---|
packages/os9 | OS-9000 module pools: parse, verify (parity, CRC), add, serialize-and-verify |
packages/colours, packages/images, packages/voice | colour tables, icons/bitmaps, .csf voice files (modern and old layouts, phrase editing, English phrase hints) |
packages/text | the UI text (Lng_*) and bitmap fonts: read, write, translation files (JSON / CSV), the Polish letters added to the fonts |
packages/emu | the MK4 emulator: MIPS CPU, OS-9000 kernel calls, devices (flash, NVR, video, I-Bus, disc), the car twins (GM, LCM, IKE, PDC) for testing modules, ISO 9660 reader and patcher |
apps/cli | the navx command — the only package that touches the filesystem |
apps/web | the Svelte 5 web app |
Rules the code keeps: no BMW data in the repository (tests on real files run only with NAVX_NAVBOOT or NAVX_VOICES set); every writer re-parses its output and checks parity and CRC before saving; a change that resizes a module says so.
Writing a module
Programs for the unit are built with the NavX SDK: C compiled with clang into an OS-9000/MIPS program module, a runtime that wraps the OS-9000 calls (paths, pipes, signals, data modules, memory, getstat/setstat) with a small C library, and a MIPS I hazard checker. The SDK has moved to its own repository and isn't public yet; its documentation is: sdk.navx.bimmerz.app (the toolchain, the app interfaces, the UI guidelines and the UI SDK). Modules built with it run in the emulator (navx run --cd V32.iso <module>) and on the unit with the bench firmware (navx serial <port> load <module>). The first big test is Doom (emdzej/navx-doom), which boots and plays its demo in the emulator; bring your own WAD.
The I-Bus over the serial port
With the navxd update that streams the I-Bus, a program on a computer can read the car's I-Bus through the unit's serial port (t1): over the plain cable, or through a NavX Link in its default unit mode. NavX Control's I-Bus tab uses exactly this. It only listens: nothing a host sends goes onto the I-Bus.
Lines. The host sends a line and navxd answers with NAVX … lines, next to its usual ones:
| Host | Unit |
|---|---|
ibus on [<addr>[,<addr>…]] [9600|57600] | NAVX ibus on <all|68,3b,…> <rate> tick=10, at 9600; then t1 runs at <rate> |
NAVX ibus <t ms> <src> <dst> <frame hex>[ s] per frame: the whole frame (src, length, dst, data, XOR); s when the unit sent it | |
NAVX ibus lost <n> when frames were dropped | |
ibus off | NAVX ibus off [idle|busy|stop|none] |
ibus | the state |
NAVX ibus failed usage|rate |
- Up to 8 addresses; a frame passes when its source or destination is one of them. No list: everything.
ibus on …again replaces the filter and keeps the stream alive. With no byte from the host for 30 s the stream ends (off idle).- An end the host didn't ask for goes out at the stream's rate, then again at 9600.
- Other commands are still answered while it streams. A transfer pauses it. Every boot starts with it off.
Raw, for I-Bus programs that expect the bus bytes themselves: ibus raw [<addrs>] answers NAVX ibus raw, then t1 runs at 9600 8E1 (the I-Bus framing) and carries only the frames' bytes. It listens only, and navxd sends nothing else. Any of these brings the line protocol back, each answered with NAVX ibus lines (in 8E1, then the line returns to 8N1):
- a BREAK: a
00after at least 1 s of quiet; - a guarded
+++: 1 s quiet,+++within 1 s, 1 s quiet (a frame in the guard starts it over); - the unit's Settings › Link › I-Bus on t1 row;
- an app on the unit taking t1;
- a restart: raw is never saved, so the unit always boots to lines.
If the unit restarts while a program is still writing to the port, those bytes land in its boot console: close the program first.
Reference
- docs/formats.md — file formats, each claim with how it was verified.
- docs/firmware.md — boot and update chain, system calls,
navx cd. - docs/emulator.md — emulator architecture and status.