How cageduke/freertos-kernel works
Main Components
• Kernel Core: Represent the core of FreeRTOS that implements task scheduling, queues, and other kernel services. This includes files at the root (tasks.c, queue.c, list.c, timers.c, stream_buffer.c, croutine.c) plus the corresponding declarations and definitions in the “include” directory (e.g., FreeRTOS.h, task.h, queue.h, etc.).
• Portable Layer: Represent the abstraction layer that contains architecture-specific code. The “portable” directory is vast and subdivided by compiler and architecture (e.g., GCC, IAR, ARMClang, CodeWarrior, etc.). This layer ensures that the kernel core can operate seamlessly on various hardware platforms.
• Configuration & Build Tools: Although not part of the runtime system, note the existence of CI/CD workflows (under .github/workflows), code style (uncrustify configuration as mentioned in the README), and the spellcheck lexicon. These support the development process.
Relationships and Interactions
• That the Kernel Core “includes” header interfaces (from the “include” folder) which define the public API used in applications and demos.
• How external demo projects (which reside in a different repository as submodules) would integrate with the kernel core.
• That tasks, queues, semaphores, timers and other RTOS objects interact within the kernel core, while the portable layer provides context switching, interrupt handling, and low-level timing operations.
Architectural Patterns & Design Principles
• Layered Architecture: Emphasize the separation between the generic kernel functions and the platform-specific implementations.
• Modularity: Break the system into modules such as the scheduler, memory management, and communication (queues, event groups) showing independence and well-defined interfaces.
• Portability: Clearly denote that the portable layer is abstracted to support various hardware architectures using conditional inclusion or multi-directory structure.
Relevant Technologies/Frameworks
• Although no external libraries are directly included, mention the use of “uncrustify” for code formatting and the integration with CI/CD tools (GitHub workflows, shell and Python scripts under .github) that further support the development process.
• Role of build scripts or configuration files that help set up the environment for different demo applications (even though demos reside in another repository).
Final Detailed Architecture Elements
• Kernel Core Elements:
• Scheduler and Task Management: tasks.c and task.h.
• Queue/Event Manager: queue.c, event_groups.c, stream_buffer.c.
• Timer Management: timers.c.
• Optional Co-Routines: croutine.c.
• Interfaces and APIs: Provided in the “include” directory (FreeRTOS.h, etc.).
• Hardware Abstraction / Portability:
• That these modules provide low-level functions such as context switching, interrupt handling, and port-specific macros.
• Supporting Infrastructure:
• CI/CD Workflows (GitHub actions) and auxiliary scripts that maintain code quality.