-
-
No fork: nto → any(nto, qnx) in 10 crates, three real fixes, one reproducible 639-line diff
-
Official kuksa-client on Linux over gRPC: 50/50 set and get, subscription delivered
-
Reproducible patch set, a codelab, and known limits written down
-
With the CANSHIELD tap, Kuksa keeps the true value 4: no spoofed value reaches apps
-
Kuksa Databroker 0.7.2 running on QNX 8.0, plus the native CAN feeder connected to it
-
Monitor mode: the spoofed CAN value 255 reaches Kuksa and the apps that read it
-
Cross-built for x86_64-pc-qnx and aarch64-unknown-qnx; QNX libc, libm, libsocket only
Inspiration
Software-defined vehicles need a common way for applications to read vehicle signals. The Eclipse SDV ecosystem uses Kuksa Databroker for that: a gRPC server for COVESA VSS signals such as Vehicle.Speed. QNX runs much of the vehicle, but we could not find a public QNX 8.0 build of the Databroker.
What it does
databrokercross-compiled for x86_64-pc-qnx and aarch64-unknown-qnx and running natively on QNX 8.0 (x86_64, in QEMU).- The official Python client (
kuksa-client, unmodified) drives it from Linux over gRPC: 50 of 50 writes read back correctly, and a subscriber receives every update. - qnx-can-feeder, a native QNX program in Rust: reads a QNX CAN device with
devctl, or the accepted-frame tap of our CAN firewall (CANSHIELD), and publishes VSS values withkuksa.val.v2 PublishValue. With the tap, a spoofed CAN frame never becomes a value that applications read.
How we built it
QNX 8.0 Rust targets from Ferrocene report target_os = "qnx", while the crates under Kuksa (tokio, mio, socket2, rustix, getrandom and others) only know the older name target_os = "nto". Instead of forking anything:
- A script rewrites every
target_os = "nto"condition in a crate toany(target_os = "nto", target_os = "qnx"). - Three real fixes on top: the errno accessor symbol,
TCP_KEEPIDLEinstead of BSDTCP_KEEPALIVEon io-sock, and the random-source backend. qccas linker and C compiler, and[patch.crates-io]pointing at the patched crates.
The result is one reviewable diff (10 crates, 56 files, 639 lines, nearly all mechanical). A script downloads the original crates from crates.io and applies it; we checked that the output is byte-identical to the tree the binaries were built from. The aarch64 build needed no extra change.
Challenges we ran into
- The SDP 8.0 host tools need x86_64 Linux. On an Apple Silicon Mac everything runs in an amd64 container under Rosetta, and the QNX guest runs under QEMU emulation.
- Finding which crates broke, in what order, and keeping their versions pinned to the ones we patched.
- QNX CAN drivers keep an 11-bit identifier in bits 28..18 of
mid. The first feeder version missed that.
Accomplishments that we're proud of
A real Rust gRPC server, unchanged, running on QNX with a porting layer small enough to review in one sitting and to send upstream crate by crate.
What we learned
Most of a Rust port to a new OS name is mechanical. Writing the change as a reproducible diff, not a fork, makes it easy to check and to upstream.
What's next
Upstream the crate changes, run the aarch64 build on hardware, and add TLS and authorization builds.
Codelab
"A real CAN bus on QNX 8.0, on an Apple Silicon Mac, without hardware": QNX 8.0 in QEMU with an emulated dual-channel SJA1000 card, frames flowing both ways between Linux SocketCAN and QNX /dev/can0, and a QNX resource manager that classifies every frame. Every step was verified, including the gotchas: https://github.com/SRKRZ23/canshield/blob/main/docs/CODELAB.md