Bare Metal RTOS

Photo of rtos

Details

This project is a lightweight Real-Time Operating System (RTOS) developed from scratch for the TM4C123GH6PM microcontroller. It supports cooperative multitasking, allowing multiple threads to run concurrently by explicitly yielding control to one another. The system was designed and implemented entirely at the bare-metal level, with direct control over hardware resources and no reliance on external frameworks or prebuilt libraries.
The RTOS manages thread creation, context switching, and scheduling through manual stack management and ARM Cortex-M exception handling. A system timer provides basic timing functionality, enabling features like sleep and delay.
Key features include:

  • Cooperative scheduling between multiple user-defined threads
  • Manual stack initialization and context preservation
  • Round-robin or static-priority thread selection
  • Configurable MPU regions for isolating thread stack and code access
  • Custom fault handling
Through building this RTOS from scratch, I gained a deep understanding of how embedded systems manage CPU execution, schedule tasks, and enforce memory safety without relying on external libraries. I learned how to implement context switching at the register level, use exceptions like PendSV for task scheduling, and configure the MPU to isolate memory regions. This project sharpened my low-level debugging skills and gave me practical insight into the inner workings of real-time systems.

Project information

  • Project date December 2023
  • Project URL github