Now that Hubris has gotten some attention, people sometimes ask me if my personal projects are powered by Hubris.
The answer is: no, in general, they are not. My personal projects use my other
lilos, which predates Hubris and takes a fundamentally
different approach. It has dramatically lower resource requirements and allows
more styles of concurrency.
A brief summary
lilos is an embedded operating system written in Rust and designed to power
lilos is focused on applications that need to do many
things independently and concurrently – managing many streams of data, say, or
processing events from lots of hardware interfaces. Instead of conventional
lilos uses the Rust
async fn feature to transform code into state
machines that can be executed from a shared stack.
lilos supports ARM Cortex-M-series microcontrollers, though I
intend to port it to RISC-V as soon as I find a good dev board.
lilos deployed in applications since mid-2019, running continuously.
A typical application of mine has between 4 and 16 separate tasks, running in
around 8 kiB of RAM on an inexpensive microcontroller, and processing hardware
events with tight and predictable response times (typically in the tens of
microseconds). To do that with a conventional operating system, you’d either
need more RAM, or you’d have to unroll your concurrent program into a great big
state machine by hand.
lilos and Rust work together to build that great big
state machine for you, making the code easier to write, read, and maintain.
lilos has been used for:
- Large-scale distributed LED animation control with sub-millisecond time sync across the network,
- Battery management and solar charge control,
- A smartwatch (alternate PineTime firmware),
- Driver user interface for a home-brew electric vehicle,
- Myriad little widgets I’ve built for things like scanning key matrices or managing lights.
Where to learn more
I’ve already written a lot about
lilos, so for now I won’t try and repeat it
all here. Instead, here’s a curated set of links if you want to learn more about
the system or try it out yourself.
lilosintro guide provides a more detailed overview of the system, discussion of the APIs, and a cookbook for approaching some common tasks.
- You can drop
lilosinto any existing Rust firmware project by running
cargo add lilos, because it’s on crates.io. (Actually using it requires writing some code; see the intro guide.)
- The documentation for the operating system APIs is pretty comprehensive.
- The repo on github contains worked examples for various microcontrollers, in addition to the OS source code.
- I’ve written several blog posts that use
lilos, such as: