Machine Learning / Embedded OS
Chestnut OS
A micro-controller OS for the machine learning age. Chestnut builds tensor math and a Lisp REPL (Read Evaluate Print Loop) into the kernel, supporting custom model inference and runtime control by frontier models via Lisp.
=== Chestnut OS === cpu: 240 MHz apb: 80000000 Hz sd: SDHC card, 960 MB (1966080 sectors) sd: mount ok Type 'help' for commands. chestnut> lisp lisp> (define A [[1 2][3 4]]) A lisp> (@ A A) [[7 10] [15 22]]
What is Chestnut?
From the boot loader to the OS, Chestnut is designed for small devices doing machine learning workloads. Tensor and matrix operations are a primitive in the kernel, and can - not only be used by your own custom models - they can also be used at runtime via Lisp.
Chestnut targets Xtensa LX7, ARM, and RISC-V processor architectures (found in ESP32, ESP32-S3 and the Raspberry Pi) and has drivers for SD cards, cameras (the Ov3660 for example), UART, I2C and basic USB devices. Chestnut gives your models direct access to the hardware without trying to be overly generic.
Chestnut gets the OS out of the way for your model. The whole OS can fit on an old 8-inch floppy disk with room to spare... but where you store your model weights is up to you.
How small is small?
| Runtime configuration | Approx. code size |
|---|---|
| Boot and scheduler (most minimal system) | 1.9 KB |
| Kernel, scheduler, shell, Lisp, tensors, file system, UART & i2c drivers | 48 KB |
| Small embedded CNN or ML runtime | 50 KB – 150 KB |
| Inference runtime, with weights, SD Card driver and FatFs | 175 KB – 4 MB++ |
(Sizes are given using the size of the binary's .text section)
What is inside the box?
| Component | Size (.text) | Share |
|---|---|---|
| FAT filesystem | 21,071 B | 43% |
| Lisp interpreter + tensor ops | 5,225 B | 11% |
| SD card driver | 3,029 B | 6% |
| Shell, command dispatch, terminal | 2,055 B | 4% |
| Software double-precision float library | 1,749 B | 4% |
printf engine | 1,426 B | 3% |
| Clock / UART / boot code | 1,100 B | 2% |
| Scheduler | 132 B | 0.3% |
| Everything else | 6,848 B | 14% |
Patch it while it's running
Most of Chestnut is compiled code, but sitting on top of that is a Lisp REPL, and that layer can stay live and reachable while the device is running. This allows one to not only extend and overwrite parts of the system at run time, it allows frontier models (LLMs) to manipulate and change embedded devices.
Anything written as Lisp (control logic, the glue between a sensor and a model's output, small decision rules) can be redefined over the wire without re-flashing or rebooting. Connect over serial, send a new function definition, and the system behaves differently on the next call.
Where it runs
| Architecture | Example Platform |
|---|---|
| Xtensa LX6 | ESP32 |
| Xtensa LX7 | ESP32-S3 |
| RISC-V (RV64) | ESP32-C* |
| ARMv7 | Raspberry Pi Zero 2 W |
| ARMv6 | Raspberry Pi 1 / Zero |
| RISC-V (RV32) | Browser |
Not for sale, but we'd love to talk
Chestnut OS is not for sale or available open source.
It is one of several commercial products by The Rohans Limited and
Beluga Navigation Systems.
Contact us if you are interested in licensing.