How can I do a context switch with rust?

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • cortexm-threads

    Simple context switching library for ARM Cortex-M MCUs in Rust

  • I'm trying to first target the ARM Cortex-M so I've been looking at crates like cortexm-threads but I can't seem to get them to run without a hard fault. Is this maybe the compiler over optimizing?

  • os.h

    A simple context switcher for Cortex-M0 processors

  • I've checked out C implementations like os h and (MirOS)[https://github.com/QuantumLeaps/MiROS] but when I port them to rust (even with C2Rust) they cause hard faults too.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • MiROS

    MiROS (Minimal Real-Time Operating System) for ARM Cortex-M

  • I've checked out C implementations like os h and (MirOS)[https://github.com/QuantumLeaps/MiROS] but when I port them to rust (even with C2Rust) they cause hard faults too.

  • ChaOS

    Simple RTOS for cortex-m processors (by ghglavan)

  • I wanted to do the same thing some time ago and ended up writing a little rtos to learn about the subject. maybe it will help you. the part that does the context switch is here.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts