An Introduction to A Chinese RT-Thread IoT OS
March 25, 2020
RT-Thread, short for Real Time-Thread, as its name implies, is an embedded real-time multi-threaded operating system.
Alan Kay said: "Simple things should be simple, complex things should be possible". This sentence was the inspiration for the founder of RT-Thread to stick to his beliefs. RT-Thread is an open source embedded real-time operating system, and this project started in 2006. I know you have no idea what RT-Thread is, but you are using an IoT OS system now, that's where this article may be of interest. Let's take a quick tour of RT-Thread.
RT-Thread, short for Real Time-Thread, as its name implies, is an embedded real-time multi-threaded operating system. One of its basic properties is to support multi-tasking. Allowing multiple tasks to run at the same time does not mean that the processor actually performed multiple tasks at the same time. In fact, a processor core can only run one task at a time. Every task is executed quickly, and through the task scheduler (the scheduler determines the sequence according to priority), the tasks are switched rapidly which gives the illusion that multiple tasks are running at the same time. In the RT-Thread system, the task is implemented by threads. The thread scheduler in RT-Thread is the task scheduler mentioned above.
RT-Thread is mainly written in C language, easy to understand and easy to port. It applies object-oriented programming methods to real-time system design, making the code elegant, structured, modular, and very tailorable.
For resource-constrained Microcontroller Unit (MCU) systems, NANO version (RT-Thread Nano version is tailored from RT-Thread standard version) that requires only 3KB of Flash and 1.2KB of RAM memory resources can be tailored with easy-to-use tools; For resource-rich IoT devices, RT-Thread can use the on-line software package management tool, together with system configuration tools, to achieve intuitive and rapid modular cutting, seamlessly import rich Software feature packs, thus achieving complex functions like Android's graphical interface and touch sliding effects, smart voice interaction effects, and so on.
RT-Thread is not only a real-time kernel, but also has a rich middle-tier component, as shown in the figure.
- Kernel layer: RT-Thread kernel, the core part of RT-Thread, includes the implementation of objects in the kernel system, such as multi-threading and its scheduling, semaphore, mailbox, message queue, memory management, timer, etc.; libcpu/BSP (Chip Migration Related Files/Board Support Package) is closely related to hardware and consists of peripheral drivers and CPU transport.
- Components and Service Layer: Components are based on upper-level software on top of the RT-Thread kernel, such as virtual file systems, FinSH command-line interfaces, network frameworks, device frameworks, and more. Its modular design allows for high internal cohesion within the assembly and low coupling between components.
- RT-Thread software package: A general-purpose software component running on the RT-Thread IoT operating system platform for different application areas, consisting of description information, source code or library files. RT-Thread provides an open package platform with officially available or developer-supplied packages that provide developers with a choice of reusable packages that are an important part of the RT-Thread ecosystem. The package ecosystem is critical to the choice of an operating system because these packages are highly reusable and modular, making it easy for application developers to build the system they want in the shortest amount of time. RT-Thread supports more than 180 software packages.
RT-Thread global website is now live, the website includes the introduction of RT-Thread, RT-Thread's roadmap, resources & documentation, and a wide range of development tools of RT-Thread, etc, making it easier for the global developers to catch the project updates and the technical documentation. For more information about RT-Thread, please visit: www.rt-thread.io/