introduction
With the rapid development of embedded devices, the functions and flexibility requirements of embedded devices are getting higher and higher, and operating systems are beginning to be used in many embedded devices. Due to the special work, many embedded devices require that the system's interrupt response to external events must be completed within a predetermined time limit to make the system predictable, while the general desktop operating system is mostly non-real-time or soft real-time. , can not meet the demand, so you must use the real-time operating system (Real-TIme OperATIng System, RTOS).
Real-time operating system (RTOS) means that when external events or data are generated, it can be accepted and processed at a fast enough speed. The result of the processing can control the production process or respond quickly to the processing system within a specified time. And control the operating system for all real-time tasks to run in concert. Therefore, providing timely response and high reliability is its main feature. The real-time operating system has hard real-time and soft real-time. Hard real-time requirements must be completed within the specified time. This is guaranteed during the design of the operating system; soft real-time is as fast as possible according to the priority of the task. Just fine. The operating system we usually use can be turned into a real-time operating system after some changes.
The real-time system has a soft real-time system and a hard real-time sySTem. Soft real-time systems are those that allow for the occurrence of a deadline when the system is heavily loaded, and do not cause too much harm, such as video conferencing systems; and hard real-time systems are those that schedule each task. Systems with very strict time requirements, if they do not meet the time limit requirements, will have devastating consequences for the system. The correctness of the Real-time operating system (RTOS) depends not only on the logical results of the system calculations, but also on the time at which this result is produced. A system in which a real-time system can complete system functions and respond to external or internal, synchronous, or asynchronous time within a specified or determined time. Therefore, the real-time system should be able to identify and process discrete events within a previously defined time range; the system can process and store the large amount of data required by the control system.
In the field of embedded systems, the core of real-time systems is the real-time operating system. There are many commercial real-time operating systems, notably VxWorks of WindRiver, and others such as QNX and pSOS+. They have the advantage of being very stable, reliable and real-time, but are generally expensive and incompatible with each other, and the source code is not disclosed as a trade secret.
Embedded real-time system features
First, the task of a time-constrained real-time system has a certain time constraint (cut-off time). According to the deadline, the real-time performance of real-time systems is divided into "hard real-time" and "soft real-time". Hard real-time means that the application's time requirements can be fully met, otherwise it will cause major security incidents and even cause major loss of life and property and ecology. Destruction, as applied in some key areas such as aerospace, military, and nuclear industries. Soft real-time refers to the fact that some applications require time requirements, but occasional violations of such requirements by real-time tasks will not have a serious impact on system operation and environment, such as monitoring systems and information collection systems.
Second, predictability Predictability means that the system can judge the execution time of real-time tasks and determine whether the time limit of the task can be met. Because of the rigor of time constraints imposed by real-time systems, predictability is called an important performance requirement for real-time systems. In addition to the predictability of hardware latency, the predictability of software systems, including the response time of applications, is predictable, that is, the required work is done in a limited amount of time; and the predictability of the operating system, ie The running overhead of real-time primitives, scheduling functions, etc. should be bounded to ensure boundedness of application execution time.
1 Real-time analysis of Linux 2.6 kernel
Compared with the old kernel, the kernel structure of Linux 2.6 has been greatly changed. The developers have rewritten the code of many functional modules. The most notable improvement is in the process scheduling that affects the real-time nature of the system, including the use of a preemptible kernel and the new 0(1) scheduler.
However, Linux was originally designed as an operating system for personal PCs or small servers. Due to the pertinence of design requirements, Linux could not provide a hard real-time environment, which directly affected its hard real-time performance. This is mainly manifested in two aspects:
(1) Process scheduling mode
Linux process scheduling uses a time slice rotation scheduling strategy. Regardless of the priority of the process, Linux will allocate a time slice to the process for a certain period of time, which means that its design pays more attention to the fairness of task scheduling. In this case, there is a phenomenon that a high-priority process is forced to abandon the processor due to the exhaustion of its time slice, and the processor is occupied by a low-priority process that does not run out of time slices.
(2) Rough clock granularity
In the Linux 2.6 kernel, the clock interrupt occurs in the frequency range of 50~1 200Hz, and the period is not less than 0.8ms, while many industrial interrupt cycles are within tens of μs.
For the above mentioned problems affecting the real-time nature of Linux, there are two main solutions:
1 Real-time transformation of the internal Linux kernel, that is, directly modify the data structure, scheduling mode and interrupt mode (mainly clock interrupt) of the Linux kernel.
With this method, the real-time transformed system has better real-time performance, but the workload is large and may cause system instability. The biggest drawback is that device drivers and applications that were originally running on Linux cannot run directly on the improved kernel. Typical representatives are Kurt-Linux.
2 external real-time extension of the Linux kernel, this method is usually a dual-core approach. Specifically, a hardware abstraction layer (HAL) is added between the Linux kernel and the hardware, and all hardware interrupts of the system are controlled by this abstraction layer. A new kernel is created specifically to schedule real-time processes, while normal processes are scheduled through the original Linux kernel.
2 Xenomai Principles and Applications
2.1 Introduction to Xenomai and its Adeos implementation
Xenomai is a free software project that provides a real-time solution based on Linux. It provides the performance of an industrial RTOS and is fully compliant with the GNU/Linux Free Software Agreement. The latest stable version is 2.4.5.
The Xenomai project began in 2001. Since the summer of 2003, Xenomai and RTAI have had a two-year collaboration during which the well-known RTAI/fusiON project branch was developed. By 2005, the Xenomai project had re-independent. Since version 2.0.0, Xenomai's migration to the hardware platform has been based on the Adeos architecture.
KNL6,KNL8 Residual Current Circuit Breaker
KNL6,KNL8 Moulded Case Circuit Breaker is MCCB , How to select good Molded Case Circuit Breaker suppliers? Korlen electric is your first choice. All moulded Case Circuit Breakers pass the CE.CB.SEMKO.SIRIM etc. Certificates.
Moulded Case Circuit Breaker /MCCB can be used to distribute electric power and protect power equipment against overload and short-current, and can change the circuit and start motor infrequently. The application of Moulded Case Circuit Breaker /MCCB is industrial.
Korlen electric also provide Miniature Circuit Breaker /MCB. Residual Current Circuit Breaker /RCCB. RCBO. Led light and so on .
KNL6,KNL8 Molded Case Circuit Breaker,Small Size Molded Case Circuit Breaker,Electrical Molded Case Circuit Breaker,Automatic Molded Case Circuit Breaker
Wenzhou Korlen Electric Appliances Co., Ltd. , https://www.zjmotorstarter.com