Real-time system with CTSS

Source: Internet
Author: User
Tags time interval time limit

Real-time Operating systemReal-time operating system
English called Real time Operating System, referred to as RTOS.
   1. Real-time operating system definition
Real-time Operating system (RTOS) refers to when external events or data generated, can be accepted and processed quickly enough, the results of its processing can be within a specified time to control the production process or to respond quickly to the processing system, and control all real-time tasks coordinated operation of the operating system. Thus, providing timely response and high reliability are its main features. Real-time operating system has hard real-time and soft real-time points, solid requirements in the time required to complete the operation, which is guaranteed during the design of the operating system, soft real-time as long as the task priority, as soon as possible to complete the operation. The operating system we typically use can become a real-time operating system after a certain change.
A real-time operating system is an operating system that ensures that certain functions are completed within a certain time limit. For example, an operating system can be designed to ensure that a robot on a production line can acquire an object. In a "hard" real-time operating system, the operating system will end up with an error if it is not possible to complete the calculation of the object within the allowed time. In the "soft" real-time operating system, the production line can still continue to work, but the output of the product can not be reached within the allowable time to slow down, which makes the robot has a short period of non-production phenomenon. Some real-time operating systems are designed for specific applications and others are generic. Some general purpose operating systems call themselves a real-time operating system. But to some extent, most of the general purpose operating systems, such as Microsoft's Windows NT or IBM's os/390, have real-time system features. This means that even if an operating system is not a strict real-time system, they can solve some real-time application problems.
   2. Features of the real-time operating system
1) multi-tasking;
2) Thread Priority
3) Multiple interrupt levels
The small embedded operating system often requires a real-time operating system, the kernel to meet the real-time operating system requirements.
   3. Real-time operating system relatedConcept
(1) Basic concepts
Code critical segment: refers to an inseparable code when processing. Once this part of the code is executed, interrupts are not allowed;
Resource: Any entity that is 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, each of which is in the following five states: Dormant state, ready state, running state, suspended state, interrupted state;
Task switching: Saves the current state of the running task (everything in the CPU register) in the task's own stack, then re-loads the current state of the next running task from the stack of the task to the CPU register and starts the next task;
Kernel: Manages individual tasks, allocates CPU time for each task, and is responsible for communication between tasks. It is divided into an inalienable kernel in the form of a stripped kernel;
Dispatch: One of the main functions of the kernel, which determines which task is to run. General priority-based scheduling method;
(2) Questions about priorities
Task priority: The static priority and the dynamic priority that can be changed by priority;
Priority reversal: Priority reversal is the most problematic problem in real-time systems. The allocation of shared resources can cause tasks with low priority to run first, and then to run after high-priority tasks. The workaround is to use the priority inheritance algorithm to temporarily change the priority of the task to curb the priority reversal.
(3) Mutual exclusion
Although shared data areas simplify the exchange of information between tasks, you must ensure that each task is exclusive when it processes shared shared data. The general method that satisfies the mutex condition is: off interrupt, using test-and-set command (TAS), disable task switching, and use semaphore.
Because the use of real-time operating system is to be able to deal with a variety of sudden events in a timely manner, that is, to deal with various interruptions, so the measurement of embedded real-time operating system of the main and most representative performance parameters should undoubtedly be interrupted response time. Interrupt response time is typically defined as:
Interrupt response time = Interrupt delay time + time to save CPU State + Execution time of the ISR of the kernel into function [2].
Interrupt delay Time =max (maximum time to shut down, maximum instruction time) + time to start executing the first instruction of the ISR [2].

--------------------------------------------------------------------------------------------------------------- -----------

Time-sharing operating system "words": time-sharing operating system
"Phonetic notation": fēn shícāo Zuòxìtǒng
"English": time-sharing Operating System
"Interpretation": an operating system that enables a computer to serve several, dozens of, or even hundreds of users at the same time. To connect the computer with many end users, the time-sharing operating system will change the system processor and memory space at a certain time interval, and switch to the application of each end user in turn. Because of the short time interval, each user feels like he is an exclusive computer. The feature of time-sharing operating system is that it can effectively increase the utilization rate of resources. For example, the UNIX system uses the deprivation dynamic first CPU scheduling, which strongly supports the time-sharing operation.
The generation of time-sharing system is a new type of OS which is formed to satisfy the user's demand. It has distinct performance differences from multi-channel batch processing systems. The needs of users are manifested in the following aspects: human-machine interactive sharing host for user-friendly machine
The basic idea of time-sharing system
Time slice: Is the computer system resources (especially CPU time) in the time division, each time period is called a time slice, each user turns to use the time slice in turn.
Time-sharing technology: the operation of the processor is divided into a very short time slices, according to the time slice turns the processor into the use of the online operation.
Time-sharing operating system: is an online multi-user interactive operating system. In general, the use of time-slice rotation to make a computer for multiple Terminal Services. The response time is guaranteed to be fast enough for each user and provides an interactive session capability.
Design goal: To respond to the user's request in a timely manner, and to maximize the utilization of system resources under possible conditions.
Suitable for office automation, teaching and transaction processing, etc. to ask for opportunities to talk about the occasion.
Working mode:
A host connected to a number of terminals, each terminal has a user in use, interactive to the system to make command requests, the system accepts each user's command, the use of time-slice rotation to process the service request, and interactive way to display the results to the user on the terminal;
Time-sharing system implementation of the key issues: timely reception. Timely processing.
Characteristics:
Interactivity: The user interacts with the system.
Multiplexing: Multiple users use the same CPU on their terminals at the same time.
Independence: Users can operate independently of each other, not interfere with each other, not confused.
Timeliness: Users in a short period of time can get a timely response to the system.
Factors affecting response time: The number of terminals, the size of time slices, the amount of information exchanged, the speed of information exchange.

------------------------------------------------------------------------------------------------------------

Example:

Time-sharing-now popular PC, the server is the use of this mode of operation, that is, the CPU is divided into a number of times to separate the operation of processing requests
Real-time-generally used in single-chip microcomputer, such as the elevator up and down control, for the button and other action requirements for real-time processing

Linux is a time-sharing system, but it can be changed to live, such as: Ucos is the Linux modified real-time system, as for their differences, under the reference Baidu similar answer, personal feeling simple and clear: "Time-sharing system is a system can be two or more than two account services."
A real-time system is an operating system that responds to instructions immediately. Microsoft's common system is not. And it's freezing. A fighter's operating system is a real-time system, think of if the fighter in the war when the computer reaction is the pilot on a command or the crash, who dares to open the plane? ”

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.