In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Most people do not understand the knowledge points of this article "what are the differences between linux and rtos", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "what are the differences between linux and rtos" article.
The difference between linux and rtos: rtos is a real-time operating system with multi-task, thread priority and multiple interrupt levels, which can respond quickly within a specified time, while linux is a time-sharing operating system that can have multiple users, and linux can also be modified into a real-time system by configuring the kernel.
The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
What's the difference between linux and rtos?
RTOS is a real-time operating system; Linux is a time-sharing system, but it can be changed to a real-time system by configuring the kernel.
Real-time operating system
It is called Real Time Operating System in English, or RTOS for short.
1. Real-time operating system definition
Real-time operating system (RTOS) is an operating system in which external events or data can be accepted and processed at a fast enough speed, and the results of its processing can control the production process or respond quickly to the processing system within a specified period of time, and control the coordinated operation of all real-time tasks. Therefore, providing timely response and high reliability is its main feature. Real-time operating system can be divided into hard real-time and soft real-time, hard real-time requires that the operation must be completed within a specified time, which is guaranteed when the operating system is designed, while soft real-time can complete the operation as soon as possible according to the priority of the task. The operating system we usually use can become a real-time operating system after a certain change.
Real-time operating system is an operating system that guarantees to complete specific functions within a certain time limit. For example, an operating system can be designed to ensure that robots on the production line can acquire something. In a "hard" real-time operating system, if the computation that makes the object reachable cannot be completed within the allowed time, the operating system will end up with an error. In the "soft" real-time operating system, the production line can still work, but the output of the product will slow down because the product can not arrive within the allowable time, which makes the robot have a temporary non-production phenomenon. Some real-time operating systems are designed for specific applications, while others are generic. Some general purpose operating systems call themselves real-time operating systems. But to some extent, most general purpose operating systems, such as Microsoft's Windows NT or IBM's OS/390, have the characteristics of real-time systems. That is to say, even if an operating system is not a strict real-time system, they can solve some real-time application problems.
2. Characteristics of real-time operating system
1) multitasking
2) have thread priority
3) multiple interrupt levels
Small embedded operating systems often need real-time operating systems, and the kernel should meet the requirements of real-time operating systems.
3. Related concepts of real-time operating system.
(1) basic concepts
Code critical section: refers to the code that is indivisible when processing. Once this part of the code starts to execute, interrupts are not allowed.
Resources: any entity occupied by the task
Shared resources: resources that can be used by more than one task
Task: also known as a thread, is a simple program. Each task is given a certain priority, with its own set of CPU registers and its own stack space. Typically, each task is an infinite loop, and each task is in the following five states: dormant state, ready state, running state, suspended state, interrupted state
Task switching: save the current state of the running task (all the contents of the CPU register) in the task's own stack area, then reload the current state of the next task to be run into the CPU register from the task's stack and start the next task
Kernel: responsible for managing tasks, allocating CPU time for each task, and responsible for communication between tasks. It is divided into non-stripping kernel and stripping kernel.
Scheduling: one of the main responsibilities of the kernel to determine which task to run. Generally based on priority scheduling method
(2) the question of priority
Task priority: static priority with unchangeable priority and dynamic priority with changeable priority
Priority inversion: priority inversion is the most common problem in real-time systems. The allocation of shared resources can cause low-priority tasks to run first and high-priority tasks to run later. The solution is to use the priority inheritance algorithm to change the task priority temporarily to contain the priority inversion.
(3) Mutual exclusion
Although the shared data area simplifies the exchange of information between tasks, it is important to ensure that each task is exclusive when dealing with shared data. The general methods to make it meet the mutually exclusive conditions are: turn off interrupt, use test and set instruction (TAS), disable task switching, and use semaphores.
Because the significance of using real-time operating system is to be able to deal with all kinds of unexpected events in time, that is, to deal with all kinds of interrupts, therefore, the most important and representative performance parameter of embedded real-time operating system should be interrupt response time. Interrupt response time is usually defined as:
Interrupt response time = interrupt delay time + time to save CPU state + execution time of the kernel's ISR entry function [2].
Interrupt delay time = MAX (maximum time of off interrupt, maximum instruction time) + time to start execution of the first instruction of ISR [2].
Time-sharing operating system
English: Time-sharing Operating System
Interpretation: an operating system that enables a computer to serve several, dozens, or even hundreds of users at the same time. The computer is connected with many end-users, and the time-sharing operating system switches the system processor time and memory space to the programs of each end-user in turn. Because of the short time interval, each user feels as if he has a monopoly on the computer. The characteristic of time-sharing operating system is that it can effectively increase the utilization rate of resources. For example, UNIX system adopts CPU scheduling with dynamic priority, which strongly supports time-sharing operation.
The generation of time-sharing system is a new type of OS formed to meet the needs of users. There is a completely different performance difference between it and multi-channel batch processing system. The needs of users are embodied in the following aspects: the sharing host of human-computer interaction is convenient for users to get on the computer.
The basic idea of time-sharing system
Time slice: it divides the system resources of the computer (especially the CPU time) into time slices. Each time period is called a time slice, and each user takes turns to use the time slice.
Time-sharing technology: divide the running time of the processor into very short time slices, and distribute the processor to each online job in turn according to the time slice.
Time-sharing operating system: an online, multi-user interactive operating system. Time slice rotation is generally used to make a computer serve multiple terminals. Fast enough response time can be guaranteed for each user, and interactive conversation ability can be provided.
Design goal: respond to users' requests in a timely manner, and improve the utilization of system resources as much as possible.
Mode of work:
A host is connected to several terminals; each terminal has a user in use; a command request is made to the system interactively; the system accepts commands from each user; and the time slice rotation method is used to process the service request; and the result is displayed to the user in an interactive way; the user issues the next command according to the result of the previous step.
The key problem in the implementation of time-sharing system: timely reception. Deal with it in time.
Characteristics:
Interactivity: the user has a man-machine dialogue with the system.
Multipath: multiple users use the same CPU on their respective terminals at the same time.
Independence: users can operate independently, do not interfere with each other, and do not confuse each other.
Timeliness: users can get timely answers from the system in a short period of time.
The factors that affect the response time: the number of terminals, the size of time slices, the amount of information exchange, the speed of information exchange.
The above is about the content of this article on "what are the differences between linux and rtos". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.