• Stars
    star
    399
  • Rank 105,768 (Top 3 %)
  • Language
    Rust
  • License
    Mozilla Public Li...
  • Created about 13 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A wee async RTOS for Cortex-M

lilos: A minimal async RTOS

This is a wee operating system written to support the async style of programming in Rust on microcontrollers. It fits in about 2 kiB of Flash and uses about 20 bytes of RAM (before your tasks are added). In that space, you get a full async runtime with multiple tasks, support for complex concurrency via join and select, and a lot of convenient but simple APIs. (If you want to see what a lilos program looks like, look in the examples directory, or read the intro guide.)

lilos has been deployed in real embedded systems since 2019, running continuously. I've built about a dozen systems around it of varying complexity, on half a dozen varieties of microcontroller. It works pretty okay! Perhaps you will find it useful too.

Repo layout

This repo contains crates in subdirectories, but it is not a Cargo workspace. This means you will need to cd into subdirectories to build things. Here is a map:

  • os contains the operating system crate.
  • testsuite contains a test suite for the operating system, which can run on a Cortex-M0 or better. See its README for instructions.
  • examples contains example programs for various microcontrollers.

Building

These instructions are mostly for building the examples or working on the operating system itself. If you're trying to use lilos in a program, the usual way is to just cargo add lilos to your application.

To build in the repo, you will need a Rust toolchain installed through rustup, because we use a rustup-style rust-toolchain.toml file to pin the toolchain version to ensure that you get the right results. rustup will automatically ensure you've got the appropriate toolchain version available, including support for the right target architecture for whatever program you're building.

  1. Enter the directory you're interested in, for example, cd os.
  2. Build: cargo build (or, for smaller binaries, cargo build --release).
  3. To try an example on a microcontroller eval board, see the README in the individual example. (In most cases cargo run in the directory will suffice.)

To build everything in the repo, run ./build-all.sh.

Contact and License

If you have questions, or you use it for something, I'd love to find out! Send me an email.

All the code in this repo is MPL-2 licensed.

More Repositories

1

m4vga-rs

VGA-style video output for STM32F4 processors, in Rust
Rust
141
star
2

m4vgalib

VGA-style video generation for STM32F4 processors
C++
102
star
3

keybrain

Drop-in replacement controller for WASD CODE v2B keyboard
Rust
74
star
4

etl

Embedded Template Library
C++
56
star
5

rtiow-rust

Ray tracer from Peter Shirley's Ray Tracing In One Weekend / The Next Week, but in Rust.
Rust
49
star
6

ruckus

Procedural CAD for Weirdos
Racket
44
star
7

bare-metal-wasm-example

Full code from my "Tiny WebAssembly graphics demos" blog post. http://cliffle.com/blog/bare-metal-wasm/
HTML
44
star
8

catibo

Rust implementation of the CTB/CBDDLP/PHZ 3d printing file formats.
Rust
43
star
9

cfm

A 16-bit CPU and self-hosting Forth system for the Lattice ICE40 FPGA, written in Haskell.
Haskell
41
star
10

m4vgalib-demos

Assorted demos for m4vgalib
C++
40
star
11

rp2040-rustboot

RP2040 bootloader in Rust
Rust
36
star
12

swddude

A SWD programmer for ARM Cortex microcontrollers.
C++
36
star
13

minimal-embedded-rust

Example code and build environment for Rust on Cortex-M4.
Rust
24
star
14

brittle-kernel

A security-oriented microkernel for Cortex-M microcontrollers
C++
21
star
15

httpd2

A fast modern static file server, patterned after Publicfile, written in Rust.
Rust
19
star
16

lilosdbg

Prototype debugger for lilos
Rust
14
star
17

rp2040-usb-device-in-one-file

Shows how to implement USB device on RP2040 in Rust, in a single file, with no hidden parts.
Rust
11
star
18

rs80

A fairly speedy emulator for the Intel 8080, written in safe Rust
Rust
11
star
19

corncobs

Corny COBS encode/decode for Rust no_std targets
Rust
10
star
20

debugdb

DWARF program analysis crate
Rust
10
star
21

cobble-build

A simple build system for modular software.
Python
9
star
22

lilist

A Rust doubly-linked intrusive list with Miri tests
Rust
9
star
23

hubpack

Predictable serde format for embedded (or larger) systems
Rust
7
star
24

visit-diff

Efficiently discover and report differences between data structures (in Rust).
Rust
6
star
25

pushr-for-android

[obsolete] Simple, easy way to push photos to Flickr from your Android-powered phone. Based loosely on the iPhone program of the same name.
Java
5
star
26

lilos1

A tiny bare-bones OS for AVR.
C++
5
star
27

httpd1

A static HTTP server, in the style of Publicfile, written in Rust.
Rust
5
star
28

propasm

Assembler for the Parallax Propeller microcontroller
Java
5
star
29

gcc-arm-embedded

Mirror of ARM's GCC project on Launchpad
Shell
4
star
30

seff

Decent text rendering for resource-constrained devices.
Rust
3
star
31

uf2l

A tool (2l, get it?) for working with UF2 firmware images.
Rust
3
star
32

WatchMaestro

A Java library for controlling the MetaWatch
Java
3
star
33

runcible

eBook reader firmware based on Qt
C++
3
star
34

s3g-toolkit

Command-line tools for manipulating RepRap/MakerBot S3G files.
C++
3
star
35

rxbanish

Hide the X11 mouse pointer while you're typing.
Rust
3
star
36

xmonad-config

My configuration for the XMonad window manager.
Haskell
2
star
37

bsrv

Bluespec RISC-V tinkering
Bluespec
2
star
38

lasgrav

Simple raster image to laser engraver tool
Rust
1
star
39

flabbergast-hs

Variations on a theme in word game solving.
Haskell
1
star
40

docker-tensorflow

1
star
41

kallisti

The settings and software that I use to operate my MakerBot Cupcake.
1
star
42

Swamp-Thing

Laser-cut swamp cooler design.
1
star
43

wordier

Wordier names for standard library operations, for clarity.
Rust
1
star
44

stm32c0-metapac-example

Me figuring out how to use stm32-metapac on the stm32c0
Rust
1
star