I. Real-time Embedded Operating System
1.1 Overview
A real-time embedded operating system is a real-time operating system specifically designed for embedded systems. An embedded system is a special type of computer system, typically used to control, monitor, or perform specific tasks.
Compared to traditional desktop operating systems, real-time embedded operating systems place greater emphasis on responding to and precisely controlling real-time tasks.
They impose stricter requirements and mechanisms on resource utilization, reliability, predictability, task scheduling, and interruption handling.
Real-time embedded operating systems typically have the following characteristics:
Rapid response: Real-time embedded operating systems can quickly respond to external events or task requests to meet the time requirements of real-time tasks.
Stability and reliability: Real-time embedded operating systems require the system to operate stably and reliably under various environmental conditions and to provide appropriate error handling mechanisms in the event of unavoidable failures.
Hard Real-Time and Soft Real-Time Support: Real-time embedded operating systems typically provide support for both hard real-time (HRT) and soft real-time (Soft Real-Time) tasks. Hard real-time tasks must be completed within strict time constraints, while soft real-time tasks offer greater flexibility in terms of time constraints.
Task scheduling and prioritization: Real-time embedded operating systems manage and allocate tasks through a task scheduler, typically using a priority scheduling algorithm to ensure that high-priority real-time tasks are processed in a timely manner.
Interrupt handling: Real-time embedded operating systems have efficient interrupt handling mechanisms that can quickly respond to and process system interrupt events.
Resource Management: Real-time embedded operating systems provide effective resource management mechanisms, including memory management, device drivers, file systems, and network protocols, to support the functional requirements of embedded systems.
Low power consumption and small size: Real-time embedded operating systems typically require low resource consumption during runtime to accommodate the power consumption and size constraints of embedded systems.
Common real-time embedded operating systems include FreeRTOS, ThreadX, Micrium μC/OS-II, VxWorks, and QNX Neutrino, which are widely used in embedded systems in fields such as automotive electronics, industrial automation, medical devices, consumer electronics, and the Internet of Things.
1.2 What does "real-time" mean?
The term "real-time" is used to describe a system or process that has the characteristic of responding immediately or almost immediately. It refers to the ability to provide real-time performance and feedback within the required time frame.
In different fields, real-time can have different definitions and requirements.
In computer science, real-time generally refers to a computer system's ability to guarantee the response and execution of tasks within a specific time frame. Real-time systems categorize tasks into hard real-time and soft real-time. Hard real-time tasks must be completed strictly according to a predetermined time, while soft real-time tasks have more flexibility in terms of time constraints.
In the field of communications, real-time usually refers to the real-time performance of data transmission and processing, such as the transmission and playback of real-time video streams.
In industrial automation, real-time refers to a control system's ability to respond promptly to external events and take corresponding actions, such as real-time monitoring and adjustment of parameters like temperature, pressure, and speed.
In the financial field, "real-time" can refer to the instant processing and updating of market data, transactions, and quotes.
In general, real-time refers to the ability of a system to process, respond, and interact in a timely, accurate, and reliable manner under specific time requirements. The stringency of real-time requirements depends on the specific application and domain.
I. Embedded Real-Time Operating System (RTOS)
1.1 Characteristics of Embedded Real-Time Operating Systems
Real-time operating systems (RTOS) offer fast response times, accurately and efficiently executing control commands and responding as expected. Embedded ROS are designed to serve real-time applications that process incoming data with minimal buffering latency, offering the advantage of real-time performance—a crucial metric for designers and users.
Real-time operating systems are divided into hard real-time and soft real-time systems. Soft real-time systems are comparable to human reaction speed and can react within hundreds of milliseconds, while hard real-time systems can respond within tens of milliseconds or even less.
Hard real-time and soft real-time
However, RTOS has the following drawbacks: it generally lacks a graphical interface, lacks features such as a web browser, requires specific drivers to respond quickly to interrupt signals, and low-priority tasks may take a long time to complete.
1.2 Real-time Operating Systems and General-Purpose Operating Systems
General-purpose operating systems (such as Windows) for running laptops contain a wealth of applications and features to meet dynamically changing user needs. However, they cannot meet the precise requirements, extremely low latency, persistent uptime, and intervention-free performance demanded by small-sized embedded systems, thus necessitating the support of real-time operating systems. Compared to larger general-purpose operating systems, real-time operating systems are faster and require less space.
Comparison of GPOS and RTOS
Open-source general-purpose operating systems (GPOS) are known for their rich functionality and flexibility, and are typically used on non-critical systems, offering time flexibility. However, for safety-critical systems such as robots and flight controllers, real-time operating systems (RTOSs) are usually chosen for development, which is a key factor for success. At the same time, RTOSs also have some drawbacks: high resource consumption makes the system expensive; and complex algorithms are difficult to understand. Therefore, when choosing an RTOS, it is necessary not only to use an internal real-time operating system, but also to utilize open-source or community-based operating systems.
1.3 Embedded Real-Time Operating System Scheduling Algorithm
Scheduling is a method to ensure that jobs are executed at specific times; it refers to the process of allocating available CPU resources to processes. For real-time systems, scheduling strategies are crucial, with scheduling algorithms being a key factor. Therefore, an important area of research in real-time systems is how to employ appropriate algorithms to ensure that each task can be completed within its time constraints.
The μC/OS-II scheduling algorithm primarily employs event-triggered priority-based preemptive scheduling. Its characteristic is that the system assigns a priority to each task, and once the highest-priority task is ready, it can acquire CPU control. Based on the μC/OS-II real-time operating system kernel, a time-triggered scheduling algorithm based on dynamic priority is proposed to support multiprocessor multitasking. Corresponding functions are designed to implement dynamic priority adjustment, meeting the needs of dynamically changing tasks in real-time systems. This algorithm avoids priority inversion, ensuring real-time performance; it solves the scheduling problem of tasks with the same priority while effectively improving task scheduling efficiency.
Overall Normalized Real-Time Response Time Graph
Finally, by analyzing the performance of the dynamic priority scheduling algorithm, it can be seen that, under the same processor utilization, the normalized real-time response time using the improved dynamic priority scheduling algorithm is faster. Of course, before this algorithm is deployed on an airborne computing platform, extensive experiments are needed to verify its other performance characteristics and further refine the platform.
II. Applications of Embedded Real-Time Operating Systems
From smart homes to traffic management, from industrial control to military applications, countless products worldwide are equipped with real-time operating systems (RTOS). To a large extent, the RTOS industry is influenced by the development of the computer hardware industry, resulting in a range of application cases that place higher demands on the operating system.
Smart home system
In a smart home, different devices can communicate with each other, and multiple devices can be linked through smart sensors, remote control, and voice recognition. Smart homes help users manage home devices in a more convenient way, providing an efficient and comfortable living and working environment.
Traffic Management
Embedding real-time operating systems that effectively integrate with IoT technology into traffic management applications facilitates intelligent traffic management. Real-time analysis and efficient transmission of urban road traffic information, along with rational route planning, effectively alleviates traffic congestion. For example, Advanced Driver Assistance Systems (ADAS) can improve driver control of the vehicle by providing real-time enhanced visualization and interaction with the surrounding environment.
Industrial Control
Many intelligent robots today rely on built-in real-time operating systems. Industrial control often has high requirements, necessitating complex device interfaces and real-time display of device status and sensor information on screens. Leveraging its unique advantages, the built-in real-time operating system enables unattended monitoring in many harsh environments and areas with complex ground conditions.
Military Operations Command
Real-time operating systems (RTOS) are becoming increasingly important in today's high-tech warfare. They integrate functions such as satellite positioning, wireless communication, and image acquisition and transmission. These technologies, with their diverse functional requirements, are being developed and deployed in specific combat scenarios. For example, various electronic devices used by the army, navy, and air force, military radar countermeasures and communication equipment, and various field command and control equipment are all equipped with real-time operating systems.
The aforementioned real-time operating systems are designed for specific use cases, and their drawbacks include high cost and time consumption. Customizing an operating system will inevitably consume significant time and resources, requiring substantial investment in hardware with no guarantee of performance. Furthermore, problems during the implementation of open-source systems can lead to tight deadlines and even cost overruns. In contrast, commercial systems are easy to use, fast, and have professional and experienced technical teams.
III. Foreign Embedded Real-Time Operating Systems
As embedded real-time operating systems continue to evolve and upgrade, the advantages and disadvantages of three foreign real-time operating systems—VxWorks, Linux, and WinCE—are summarized below.
Comparison of VxWorks, Linux, and WinCE
3.1 VxWorks
VxWorks is widely used in various high-tech industries, such as satellite communications and military exercises, due to its excellent reliability and real-time performance. VxWorks' biggest drawback is its high price; software development and maintenance costs are very high, it typically only provides binary code, not source code, and it supports a limited number of hardware devices.
3.2 Linux
The Linux open-source operating system is free to use and freely modifiable. It is powerful, well-designed, and provides accurate and effective communication methods for running on different computer platforms. It is highly competitive in price and is currently the most popular operating system. The drawback of Linux is that providing real-time performance requires adding real-time software modules to implement scheduling strategies, hardware interrupt exceptions, and program execution. Therefore, code errors can corrupt the operating system and affect the reliability of the entire system.
3.3 Windows CE
Windows CE (WinCE) is relatively easy to develop, has a short development cycle, a mature kernel, flexible communication support, a rich GUI, and comprehensive development functions, allowing for greater control over the scheduling mechanism. However, WinCE's licensing fees are inevitably high, it doesn't consider real-time applications, has difficulty supporting multiple hardware platforms, lacks customizability, has higher resource requirements, and has limited network functionality.
IV. Domestic Embedded Real-Time Operating Systems
With the rapid development of the Internet of Things (IoT), there is a strong demand for domestically produced and controllable equipment, and the development of domestically produced embedded real-time operating systems is gradually getting on track. Intewell operating system is a microkernel-based, flexible, easily expandable, highly secure, and highly reliable real-time operating system.
Intewell Operating System Architecture Diagram
Kodon Software's independently developed Intewell industrial operating system boasts over 30 years of R&D history and application experience. Featuring a microkernel, high real-time performance, and virtualization capabilities, it enables the generalization of the underlying industrial control system and the integration of artificial intelligence and control. Providing enterprise clients with domestically developed industry solutions, it has been successfully applied in high-end CNC systems, industrial robots, medical robots, motion control systems, rail transit control systems, power distribution automation, and automotive control domains.
RT-Thread is a domestically developed, open-source embedded real-time operating system that is feature-rich, easily extensible, low-power, and highly secure. RT-Thread kernel objects are linked to linked lists allocated by object containers.
RT-Thread kernel object containers and linked lists
RT-Thread does not rely on a specific memory allocation method. By combining dynamic and static methods using kernel objects in object containers, it greatly improves system flexibility. With its stable and rich system functionality, it is widely used in fields such as new energy, aerospace, and medicine, and its highly reliable real-time performance has been proven.
Wingtech's SylixOS, an independent real-time operating system, incorporates many beneficial designs in terms of real-time performance. SylixOS's dynamic application loading function allows for the separation of business logic from the system platform for independent development and upgrades. Only the relevant components need to be updated to change related algorithms, add or remove application functions, etc., which facilitates more convenient and efficient project development and maintenance.
Dynamic loading of SylixOS
SylixOS's real-time processing and dynamic loading mechanism supports the integration of various application software onto the operating system, meeting the needs of distributed software development. In short, SylixOS has become one of the best representatives of domestic real-time operating systems, and its performance has reached or surpassed that of many other real-time operating systems, because its design philosophy draws on the design concepts of numerous real-time operating systems.
V. Development Prospects of Embedded Real-Time Operating Systems
With the widespread application of RTOS, its functions and requirements are becoming increasingly diverse, and its structure and development are becoming increasingly complex. Real-time operating systems must respond to innovation, adopt state-of-the-art development technologies, adapt to the frameworks, languages, and methodologies used by the next generation of embedded system developers, and provide information and functionality security, high performance, and reliability. Therefore, operating systems support user-friendly, systematic, networked, and sophisticated development environments.
(1) Everyday Life: Devices, home appliances, and tools using embedded real-time operating systems have entered the lives of countless households. They can meet people's needs in information, communication, travel, and entertainment, effectively improving people's quality of work and life.
(2) Systematization: To better meet the development needs of real-time operating systems, their development tools will continue to evolve towards systematization. With the popularization of embedded devices, the need for global processing will inevitably arise, such as comprehensively organizing, analyzing, and processing data from various embedded devices.
(3) Networking: The development of networking will further promote the deep coupling between embedded real-time operating systems and Internet technology. It will enable Internet technology to help people complete many things quickly and efficiently in life and work, and solve the difficulties they encounter. Therefore, people now rely on it greatly and have high requirements for it.
(4) Refinement: The inherent characteristics of embedded systems based on user needs dictate that they will inevitably develop towards functional segmentation and specialization, which also depends on the scientific development in various fields. This will enable the integration of more functions of the embedded real-time operating system onto a smaller chip, thereby reducing production costs.
Although the development of embedded real-time operating systems started relatively late in China, small and medium-sized research institutions and manufacturers have long faced challenges such as funding shortages and insufficient research funding. They have also long been subject to foreign technological monopolies, resulting in high RTOS royalties and service fees, significantly increasing embedded production costs and limiting product market share and competitiveness. However, with the rapid development of my country's information technology and the steady improvement of system design capabilities, RTOS is constantly evolving and becoming increasingly powerful, leading to a more mature RTOS market.
VI. Conclusion
Only by developing systems with independent intellectual property rights can we break free from dependence on foreign embedded real-time operating system products. Linux's open-source nature, extensive technical support, and price advantage are all conducive to the development of domestically produced embedded operating systems. Therefore, my country's domestic operating systems still have the opportunity to capture a larger market share and compete with foreign products.
In fact, designing a real-time operating system independently is extremely complex. From the perspective of existing system operation, the entire system's processing capabilities are constrained by software and hardware, and are based on network requirements. Therefore, it is necessary to leverage the advantages of information networks, gradually decompose and update the system's inherent directional functions, and achieve independent operation while ensuring the system's associated operational functions; at the same time, it is essential to fully utilize existing open-source code to expand and upgrade the basic functions, thereby developing an independently developed embedded real-time operating system product with independent intellectual property rights.
What is embedded systems?
An embedded system is a computer system specifically designed to perform a particular task, typically embedded within a combination of hardware and software in other devices or systems.
Embedded systems typically have the following characteristics:
Specialization: Embedded systems are designed for specific application areas or specific tasks, and their functions and performance are optimized for specific needs.
Real-time performance: Embedded systems typically need to respond to external events or data in a timely manner to meet the time requirements of specific applications.
Reliability: Embedded systems are typically used in various extreme environments and require stable and reliable operation.
Resource constraints: Embedded systems typically have limited computing and storage resources because their design needs to be adapted to specific devices and cost budgets.
Real-time constraints: Embedded systems typically have a series of hardware and software constraints, such as power consumption limits, size limits, and resource limits.
Common embedded systems include, but are not limited to, the following areas:
Automotive electronics: such as engine control, in-vehicle entertainment systems, and driver assistance systems.
Home appliances and consumer electronics: such as smartphones, televisions, home appliances and smart home devices.
Industrial automation: such as industrial control systems, robots, and sensor networks.
Medical devices: such as heart monitors, blood pressure monitors, and prostheses.
Communication equipment: such as mobile phone base stations, network routers, and modems.
Internet of Things (IoT) devices: such as smart sensors, smart wearable devices, and smart city systems.
The design and development of embedded systems typically require embedded development techniques for hardware, software, and firmware to ensure that the system's stability, reliability, and performance meet specific application requirements.