Rt-thread RTOs is an open source real-time operating system from China, developed and maintained by some professional developers. It is not only an efficient, stable real-time operating system kernel, but also a set of software platforms for embedded systems, covering:
- Full-preemption real-time operating system kernel
- Small file system that is not relevant to the underlying implementation
- A lightweight TCP/IP protocol stack
- command line for C language shell command
- Lightweight Multi-window multithreaded graphical user interface.
At present, Rt-thread RTOs in the domestic already has more than 10 enterprises in use, from data acquisition, monitoring to mechanical control, from the ARM7 chip to STM32, lm3s and other cortex-m3 chips, from the real-time kernel, file system, Shell command line to light tcp/ IP network protocol stack, the Rt-thread RTOs has proven to be an embedded real-time operating system that can be used for product and stable operation.
Rt-thread StructureReal-time Operating system core
Rt-thread Real-time operating system core is an efficient hard real-time core, it has very good real-time, stability, and can be cut. The minimum can be 3k ROM occupied, 1k ram occupied.
- Kernel Object System
- The real-time threading operating system is designed in an object-oriented manner, with built-in kernel object management system that can access/manage all kernel objects. Kernel objects contain most of the facilities in the kernel, which can be statically assigned static objects or dynamic objects that are allocated from the system memory heap. Through the kernel object system, Rt-thread can not depend on the specific memory allocation method, scalability is greatly enhanced.
- Task/thread scheduling
Supports multi-tasking systems with threads as the base dispatch unit. Scheduling algorithm is a priority-based full preemptive thread scheduling, support 256 thread priority (can also be configured to 32 thread priority), 0 priority represents the highest priority, 255 priority is left to idle threads, the same priority supports multiple threads, These threads of the same priority use a time slice rotation schedule that can set the length of time slices; the time at which the scheduler looks for the next highest-priority ready thread is constant (O (1)). The system does not limit the number of threads, only related to the physical platform's specific memory.
- Synchronization mechanism
The system supports inter-thread synchronization mechanism such as Semaphore,mutex. The mutex uses a priority relay mode to prevent priority rollover. The semaphore release action is safe for use in interrupt service routines. The synchronization mechanism enables threads to wait by priority or to obtain semaphores or mutexes in first-in, in-order manner.
- Communication mechanisms
The system supports Event,mailbox,message queue communication mechanism and so on. Event supports multi-event "or trigger" and "with Trigger", which is suitable for threads waiting for multiple event situations. The length of a mail in mailbox is fixed at 4 bytes, and the efficiency is higher than messagequeu. Send actions in communication facilities can be safely used in interrupt service routines. The communication mechanism enables threads to wait by priority or to be fetched in first-out mode.
- Clocks, Timers
The system uses the clock beat to complete the time slice rotation scheduling of the same priority task by default; the time sensitivity of thread to kernel object is realized by system timer, and the timer is divided into hard timer and soft timer, one time and periodic timing.
- Memory management
The system supports static memory pool management and dynamic memory heap management. Getting/freeing memory blocks from a static memory pool is constant, and when the memory pool is empty, the application thread can be suspended, returned immediately, or wait for a period of time to be returned, depending on the request thread. When other threads release a memory block into the memory pool, the suspended thread wakes up. For systems with tight system memory, Rt-thread also provides a small partner memory management algorithm. For embedded systems with larger memory, Rt-thread provides a very efficient slab memory management system.
- Diagnosis
The system-provided FINSH shell system enables you to view threads, semaphores, mutexes, events, mailboxes, Message Queuing operations, and stack usage for each thread.
|
Technical Index
Basic Kernel Configuration Resource Usage: 13344 bytes rom,1800 bytes Ram Simplified Resource usage: 2.5K rom,1k RAM Thread context switch time (measured with logic Analyzer on 72MHz STM32): Suspend operation causes thread context switch: 4.25μs semaphore causes thread context switch: 7.25μs mailbox causes thread context switch: 8.63μs |
RTT operating System