Skip to content
/ JOCKTOS Public

RTOS Scheduler written in C intended for use with ARM Cortex-M4 Chipsets

License

Notifications You must be signed in to change notification settings

JGoard/JOCKTOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JOCKTOS: A ground-up RTOS for ARM-CortexM4 Chipsets

Welcome to JOCKTOS! This project was created for "fun" by Joshua Goard and Nicholas Schneider, both former colleagues from the Joint NC State University - UNC Asheville Mechatronics Program. JOCKTOS is a fully functional, custom-built RTOS designed for ARM Cortex-M4 chipsets. Whether you're curious about the internals of a real-time operating system, want to make modifications, or need a solid foundation for your embedded project, JOCKTOS is here for you.

Our end-goal has two objectives...

  1. By creating a simpler RTOS, this may help any end-user who would like to learn more about the intricacies of what a basic tasking system should look like.
  2. Allow users to either build the source code, or to use a pre-built library with binaries for them to use as an API within their own projects.

How it's Made

Tech Used: C, ARM Assm., Dockerfiles, VSCode, openOCD, GDB, QEMU

Building JOCKTOS from scratch was both a challenge and a passion project. We aimed to create a minimalist, efficient, and robust RTOS tailored to the ARM Cortex-M4 architecture. Starting with the core kernel, we wrote everything in C with critical sections in ARM Assembly for optimal performance. We used QEMU for initial testing and debugging, with openOCD and GDB to deploy and debug on actual hardware. Dockerfiles were included to standardize the development environment, ensuring that anyone can replicate our setup with ease.

We wanted JOCKTOS to be more than just a learning tool—it's a practical RTOS ready for deployment in real-world embedded systems. The project embodies our dedication to low-level programming and system design, reflecting countless hours of debugging, optimizing, and refining.

Optimizations

Throughout the development of JOCKTOS, we've made several key optimizations to enhance both the performance of the RTOS and the efficiency of our workflow:

  • Context Switching: Optimized the context-switching mechanism to reduce overhead, ensuring that task switching is as fast as possible.
  • Memory Management: Implemented a custom memory allocator that balances speed and memory usage, minimizing fragmentation.
  • Interrupt Handling: Streamlined interrupt handling routines to reduce latency and prioritize critical tasks effectively.
  • Development Environment: Dockerized the entire development environment, allowing for consistent builds and easy collaboration across different systems.
  • I/O Handler: Custom built hardware for ease of creating a list of I/O and using as needed.

Lessons Learned:

Creating JOCKTOS was a deep dive into the intricacies of real-time systems. Here are some of the lessons we learned along the way:

  • Timing is Everything: Understanding and controlling timing at the microsecond level is crucial in RTOS development.
  • Debugging Low-Level Code: Low-level debugging requires patience and precision; the smallest errors can have significant impacts.
  • Modularity: Designing the RTOS with modularity in mind made it easier to optimize and expand the system.

Examples:

To get started with JOCKTOS, check out the 'c_based_scheduler branch' and clone it to your local pc. With Docker, running a basic emulation of the board we are using should be seamless.

Installation & Setup

To get started with JOCKTOS, follow these steps:

  1. Clone the Repository:
    git clone https://github.com/JGoard/jocktos.git
    cd jocktos
    docker build -t jocktos:latest .
    

License

JOCKTOS is licensed under the MIT License. See the LICENSE for more information

Credits & Acknowledgments

We would like to thank the ARM developer community, as well as the contributors to open-source tools like QEMU, GDB, and openOCD, for their invaluable resources and support.

About

RTOS Scheduler written in C intended for use with ARM Cortex-M4 Chipsets

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages