An introduction to the RT-Thread IoT OS

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: background

RT-Thread, short for Real Time-Thread, is, as its name implies, an embedded real-time multi-threaded operating system. One of its basic properties is to support multitasking. Allowing multiple tasks to run at the same time does not mean that the processor actually performs 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, making it 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 tailorable.

For resource-constrained Microcontroller Unit (MCU) systems, the NANO version of RT-Thread (tailored from the standard version of RT-Thread), which requires only 3KB of flash and 1.2KB of RAM, can be tailored with easy-to-use tools. For resource-rich IoT devices, RT-Thread can use the online 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’s architecture

RT-Thread is not only a real-time kernel, but also has a rich middle-tier component, as shown in the following figure.

It includes:

The 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.

The 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.

The 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 174 software packages.

RT-Thread has launched more than a decade ago, and this is the first time we make an official self-introduction to the world, especially at the beginning of 2020, it feels great! We welcome suggestions for RT-Thread, and you can feel free to contact us on Twitter or send us an e-mail. And if you have any great ideas, you are very welcome to contribute to our Github.

7 Comments

  1. 2020-02-07 10:15 am
  2. 2020-02-08 3:33 am