KalangoRTOS

所属分类:处理器开发
开发工具:C
文件大小:43KB
下载次数:0
上传日期:2020-08-23 04:10:46
上 传 者sh-1993
说明:  始终是实验性的,仅用于娱乐和学习目的微控制器的实时内核
(Always experimental, just for fun and learning purposes real-time kernel for microcontrollers)

文件列表:
CMakeLists.txt (876, 2020-08-23)
LICENSE.md (1071, 2020-08-23)
archs (0, 2020-08-23)
archs\arch_arm6m_defs.h (2604, 2020-08-23)
archs\arch_arm7m_defs.h (5297, 2020-08-23)
archs\arch_armv6m.c (6263, 2020-08-23)
archs\arch_armv7m.c (7597, 2020-08-23)
confs (0, 2020-08-23)
confs\kalango_config.h (902, 2020-08-23)
confs\kalango_config_cortexm0.h (904, 2020-08-23)
confs\kalango_config_cortexm4_float.h (902, 2020-08-23)
include (0, 2020-08-23)
include\arch.h (503, 2020-08-23)
include\clock.h (524, 2020-08-23)
include\core.h (758, 2020-08-23)
include\kalango_api.h (19159, 2020-08-23)
include\kernel_objects.h (1431, 2020-08-23)
include\kernel_types.h (1956, 2020-08-23)
include\list.h (12633, 2020-08-23)
include\macros.h (227, 2020-08-23)
include\mutex.h (345, 2020-08-23)
include\object_pool.h (645, 2020-08-23)
include\platform.h (85, 2020-08-23)
include\queue.h (499, 2020-08-23)
include\sched.h (607, 2020-08-23)
include\semaphore.h (375, 2020-08-23)
include\task.h (423, 2020-08-23)
include\timer.h (439, 2020-08-23)
src (0, 2020-08-23)
src\clock.c (3787, 2020-08-23)
src\core.c (4892, 2020-08-23)
src\mutex.c (4513, 2020-08-23)
src\object_pool.c (2462, 2020-08-23)
src\queue.c (8149, 2020-08-23)
src\sched_fifo.c (2602, 2020-08-23)
src\sched_round_robin.c (851, 2020-08-23)
src\semaphore.c (2701, 2020-08-23)
... ...

# Kalango, a always experimental just for fun RTOS: Simple preemptive-cooperative, realtime, multitask kernel made just for fun and aims to be used to learn basics and the internals of multitasking programming on microcontrollers, the kernel is engineered to be simple and scalable allowing others to download, use, learn and scale it into more professional projects. It is under development status and all updates will figure here. # Main Features: - Real time preemptive scheduler; - Fast and predictable execution time context switching; - Supports up to 32 priority levels; - round-robin policy with same priority threads; - Soft timers; - Counting Semaphores; - Binary Semaphores; - Task management; - Recursive mutexes; - Message Queues; - Scalable, user can configure how much kernel objects application need; - Unlimited kernel objects and threads(limited by processor memory); - O(1) TLSF memory allocator,leave kernel to manage its memory; - Written in C with less possible assembly paths (just on context switching); # Limitations: - Please keep in mind this is an experimental project; - Intended to support popular 32bit microcontrollers, no plan to support 8-bit platforms; - Most of the code are written with GCC or CLang in mind; - No C++ support; - It was designed to take advantage of exisiting manufacturers microcontroller abstraction libraries such CMSIS and NRFx; - Timer callbacks are deffered from ISR; # Get the Code! To get this respository: ``` $ git clone https://github.com/uLipe/KalangoRTOS ``` # Getting started, using CMake: You can use the CMake build system to integrate the Kalango into your existing cmake project, to do so just copy this folder into your project folder and in your cmake project search by this directory as below: ``` add_subdirectory(KalangoRTOS) ``` After that, in your executable target, just link Kalango library using regular CMake option: ``` target_link_libraries( KalangoRTOS ) ``` The Kalango top-level include will placed in your project and you can invoke all the Kalango related functions. Additionally you need to supply a kalango_config.h header file, inside of confs folder, there are some samples, just copy to your project and rename it to kalango_config.h, after that when running your project cmake command just supply the location of this file: ``` cmake -DKALANGO_CONFIG_FILE_PATH=/path/to/kalango_config.h/file ``` # Getting started, stand-alone mode: - On your embedded project, add include folder to your include search path; - Add src, desired arch folder and lib folders to search source path; - from confs board, take a template config and put in your project, rename it to kalango_config.h - add to your compiling options: ``` -include ``` - include the kalango_api.h on your application code to use RTOS features; - Inside of your main function, initialize your target then run the scheduler by calling Kalango_CoreStart() function. See example below. ``` #include "kalango_api.h" static TaskId task_a; static TaskId task_b; static void DemoTask1(void *arg) { uint32_t noof_wakeups = 0; for(;;) { Kalango_Sleep(250); noof_wakeups++; } } static void DemoTask2(void *arg) { uint32_t noof_wakeups = 0; for(;;) { Kalango_Sleep(25); noof_wakeups++; } } int main (void) { TaskSettings settings; settings.arg = NULL; settings.function = DemoTask1; settings.priority = 8; settings.stack_size = 512; task_a = Kalango_TaskCreate(&settings); settings.arg = NULL; settings.function = DemoTask2; settings.priority = 4; settings.stack_size = 512; task_b = Kalango_TaskCreate(&settings); (void)task_a; (void)task_b; //Start scheduling! Kalango_CoreStart(); return 0; } ``` # Support: - If you want some help with this work give a star and contact me: ryukokki.felipe@gmail.com

近期下载者

相关文件


收藏者