Which of the following mechanisms makes VxWorks more real-time than Linux?

Source: Internet
Author: User

In the past, many embedded systems were not an operating system, a provider's proprietary core, or a DOS Operating System
Extension. Obviously, these methods cannot meet the requirements of embedded system development today! Existing real-time commercial operating systems
Although it provides a very small core and multi-task development environment, but the performance is not ideal, it does not meet the current real-time embedded Market
Field requirements.

Therefore, people are focusing on general operating systems (such as Windows, Solaris, and Linux), hoping to
Transformed to a real-time operating system. These operating systems are usually powerful, complex in structure, and easy to perform secondary development and implementation of software.
Highly usable and provides standard APIs that programmers are familiar. In addition, these operating systems also provide some real-time software
Development support. However, these operating systems are still insufficient for embedded system development. Embedded systems require high reliability to meet the requirements
Tailoring requirements and higher real-time requirements than general operating systems.

As a solution for embedded system development, Linux has unique advantages among many general operating systems.
First, the tailoring of private business operating systems such as windows and Solaris is strictly controlled by sellers. This greatly limits
The depth of the sender's cropping. Linux follows the GPL protocol and opens the source code of all systems, making it easy to crop.

Secondly, compared with other open-source general operating systems (such as FreeBSD), Linux supports multiple processors and development boards.
Strong advantages in supporting software development tools.
Linux was originally designed and developed as a general operating system, but provided some real-time processing support. This includes
Supports Real-Time Functions in Most POSIX standards, supports multi-task, multi-thread, and rich communication mechanisms.

Linux also provides POSIX-compliant scheduling policies, including FIFO Scheduling Policies, time slice rotation scheduling policies, and static
Preemptible priority scheduling policy. The default scheduling policy is the third. Linux also provides the Memory Lock function to avoid
Without changing the storage page in real-time processing, it also provides a POSIX-compliantStandard real-time signal mechanism.

A fatal problem is that Linux supports preemptible Scheduling Policies in user mode, but does not support preemptible Scheduling Policies in core mode.
. In this way, tasks (or system calls) Running in Linux core State cannot be preemptible by other tasks with higher priority.
This will cause priority reversal. In addition, the interrupt handling handle of the Linux operating system cannot be scheduled,
Cannot be based on priority

In addition, we also care about clock precision related to task response time and priority reversal caused by resource sharing.
Problem. In Linux, the default time interval for hardware clock interruption is 10 ms. All software clocks are triggered by hardware.
. However, the simple synchronization mechanism (mutex) does not support priority inheritance, which may result in priority reversal.

Independent Core Method

Linux, as the real-time system's independent core method, refers to the design of a completely independent real-time core, but its APIAnd Linux core
Compatible. The theoretical basis of this method is that an excellent real-time operating system must fully consider
Unified real-time requirements, and can provide standard-compliant APIs. This implementation method applies to many
Compatible proprietary real-time system providers are very attractive.

The limitation of this method is that a completely independent real-time core is designed without the original Linux core.
Some advantages of Linux are difficult to inherit, especially those related to Linux core. For example, Linux
The core supports a wide range of hardware, and the Linux core features superior reliability and stability. In addition, because of this method and
Failed to modify Linux
The core code is used to develop the Real-Time core, but a real-time core is re-designed on the Linux system.
Open source code is not required. Therefore, some advantages of Linux based on open source code are bound to be damaged. Last point, any
The development results based on the Linux core cannot be easily applied to the real-time core.

Of course, this implementation method also gets a lot of benefits from the Linux system. Thanks to the support of the Linux system, the real-time core is
It does not need to be implemented in a "real" way. In addition, developers familiar with Linux systems can quickly become familiar with this method.
Real-Time System. People will naturally think of Linux as a development platform for embedded systems. In addition, if
If the real-time system API is a subset of the Linux system API, we can simulate it only on the Linux host for application development and debugging, saving the trouble of remote debugging!
And LinuxAPI compatibility is an important indicator for evaluating such real-time systems. If a real-time system is compatibleWith Linux
To allow all Linux applications and libraries to run and use on them. Therefore, this will bring about a huge
All third-party software available on Linux can be used on it. Of course, developing such compatibility
With LinuxReal-time API systems are by no means easy, especially for individual developers.

Therefore, a large number of third-party software cannot be easily transplanted to real-time systems.
The trend is greatly compromised!

Dual-core method

This method uses two system cores that work together on the same hardware platform. One core provides accuracy.
The other core provides complex non-real-time universal functions.

This method is implemented by adding a Real-Time core layer at the bottom of the Linux operating system. Real-time Core
Manage parts and provide real-time task management. Real-time core also uses software to "simulate" the use of underlying hardware in conventional Linux systems
/Disable interrupt, rather than the true operation interrupt control register. Linux core is regarded as the lowest priority among the Real-Time Core
The Linux core is scheduled only when no real-time tasks can be run.

The key to this approach is that all non-real-time tasks running on the general Linux core must support preemptible
Scheduled. In this way, accurate real-time assurance of real-time core can be achieved without any impact. Because the real-time core is very small,
It does not increase the load of the entire system. All these real-time software with strict real-time development requirements provide a powerful guarantee.

The disadvantage of this method is that the development of real-time tasks is directly oriented to the small real-time core that provides precise real-time services, rather
Powerful general Linux core. Therefore, real-time tasks run on the system core layer, which means that these real-time tasks
Tasks can run on a level without memory protection. Therefore, a real-time task error may cause the entire system
Paralysis! Even worse

This development mode implies that we must perform static decomposition on the application. It is divided into real-time and non-real-time parts. In
In most cases, this is a good thing. It forces developers to break down application systems into real-time subsystems and non-real-time subsystems.
. But obviously, this development mode also limits the application type! Because this is viewed from a dual view.
The real-time system method is not suitable for all applications. In some applications, the boundaries between real-time and non-real-time parts are not very clear.
There may be different degrees of Soft Real-Time parts.

Another disadvantage of this method is that the development model combines two irrelevant dimensions of real-time applications-functional requirements and
Real-time requirement. It requires that the real-time requirements of applications be limited to the functional requirements provided by the real-time core. Real-time
The core provides very limited support for functions. Of course, we can also expand core real-time functions, such as adding real-time network functions.
Wait. However, the new part is likely to overlap the existing functions of the Linux core, resulting in unnecessary system expansion and loss.
The value of this method.

Core modification method

This method is based on the support of the existing Linux system for real-time software development, source code-level modifications to make Linux
Real-time Operating System. This method is also consistent with the Linux philosophy. Any repair Based on Linux core source code
The changed products must follow the GPL protocol and open source code to all software personnel. Once many people think it is useful, someone will maintain it,
It is either mixed in the general Linux core, or separately divided into a real-time Linux branch.

The central principle of this method is to carefully select some changes to meet a series of related real-time Linux development requirements. In addition,
Because these changes are relatively local, they will not fundamentally change the core of Linux. Some modifications can also be implemented through
The module loading mode is completed in conventional Linux. The system can dynamically load this function module as needed.
This module can be dynamically uninstalled. For example, one of the modifications is the core preemptible scheduling. Changing the core from a non-preemptible type to a preemptible type is a major change in the structure.
But many problems have been supported in Linux. Therefore, the core preemptive repair
You can simply use the SMP hook. Another modification point is the previously mentioned scheduling of the interrupt handling handle. Some modifications are global, such
Modify the system clock service to provide a higher-precision "Heartbeat" without adding unnecessary system load, or
The core implements the mutex mechanism to support priority inheritance.

Resource Core Method

This method is designed to address the limitations of preemptible scheduling policies with fixed priority in traditional real-time operating systems. Fixed
The priority preemptible scheduling algorithm has no temporary protection between tasks. Therefore, the foreseeable task response time depends on all
Prediction of the execution time of a higher-priority task. In such a system, predictability is global and may be
A bad task and
Affected. In addition, this kind of static view of real-time systems is also inappropriate. In many real-time applications
The system can dynamically adjust the task attributes based on the resources obtained by the application for optimal results.

The resource core method is a resource-centric method that guides the Real-Time core to provide a precise, guaranteed, and preemption acquisition system.
Resource method. As long as the resources required for real-time applications can be allocated by the core backend Resource Management Program
Real-time applications can be configured. Therefore, the core of real-time is to provide the basis for real-time application construction-from simple configuration
From real-time systems to complex real-time systems, you can dynamically change the real-time task attributes and their priority in the entire system.

The biggest advantage of this method is that the system is robust, accurate, and foreseeable in real time. Another advantage is that
The application dynamically adjusts its attributes according to the actual situation. In addition, this method is very suitable for embedded system development.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.