Tock Logo

Talking Tock

Talking Tock 17

Rust + Lua userlands, Hail shipped and an upcoming tutorial

This is the 17th post in a series tracking the development of Tock, a safe multi-tasking operating system for microcontrollers.

Has it really been over a month since our last update? Yes… it has. And it’s been an eventful one! Between the contributors we submitted papers to SenSys and SOSP (some related to Tock, some less so). We also submitted a proposal for a Tock tutorial at SenSys which was accepted! It will take place in Delft, The Netherlands in early November. Details forthcoming.

Meanwhile, the first batch of Hail development boards shipped to people who pre-ordered them. There is still enough in stock to dip into this first batch so go ahead and buy one (or 10) here. Just before Hail shipped, attendees of RustFest in Kiev got a preview of the board and operating system thanks to Florian (@skade) and Andrew (@HoverBear). The feedback from RustFest as well as some initial feedback from people who pre-ordered has been really useful. Keep it coming!

There has also been some external development that we are really excited about. LLVM 4.0 was merged into Rust, openning the door for using ROPI/RWPI relocations in Rust, which has been a barrier to Rust userland support. Following a small patch turning on support in Rust, this feature is now available, and we’ve begun initial support for Rust userland in Tock. The remaining known barrier is a linker that supports all these relocations, but that too is getting resolved upstream in LLVM’s LLD linker.

Non-C Userland

We’ve begin working on two non-C userland runtimes for Tock: one for Rust and one for Lua.

The Lua userland turned out to be reasonably straightforward to embed in a Tock process, although it has so far proven to have fairly large memory and code overhead, so there is still some work to be done tweaking and optimizing that.

The Rust runtime is being hosted in a separate repository. Thanks to the LLVM upgrade in Rust, we’re able to compile Rust source to object code with relocations that support our userland memory model, however, the only available linker that supports, specifically, the data segment relocation (called RWPI–Read-Write Position Independence) is the ARM proprietary linker, which we don’t want to rely on. Fortunately, this only means we can use global variables just yet, so we’ve been able to make some progress none-the-less. Moreover, support for RWPI relocations should be landing in LLD (LLVM’s linker) soon.

Pull Requests