Real-time multi-task operating system (RTOS) enters single-chip development field
Belocity 1. Real-time Multiking Operating System (RTOS) (1) More hardware systems, rather than operator embedded system processors generally work independently, no person's direct participation; even if you participate, there is no large number of words Information output, this is different from the desktop computer. Therefore, RTO is focused on hardware instead of having a complete human interface. (2) Monitoring, control, communication and other work of real-time single-chip microcomputer system require real-time performance, once related circumstances, the CPU can respond in time, and it is not going to slow. To this end, a practical RTOS should have a perfect interrupt response mechanism to ensure that the interrupt response latency is short enough. (3) The growth of multi-task semiconductor technology has increased the growth of CPUs to have become higher and higher, today's 16-bit or 32-bit single-chip microcomputer, can be equivalent to 8 single-chip microcomputer in terms of operational speed, addressing capabilities. Dozens of tablets. Running applications on such a powerful processor is inevitable, but is divided into several tasks based on several functions to be implemented, which is conducive to the development and maintenance of software. Therefore, the RTOS used in the single-chip microcomputer system is inevitably supports multitasking, and can allocate the CPU and various resource occupancy times between them according to the weight of each task. (4) Different typical peripherals drive support the typical sheets of the single chip microcontroller, set to timers, A / D, PWM, D / A, serial port, LCD / LED interface, CAN-Bus, IC-Bus, etc. Depending on the processor type, RTOS generally comes with a number of drivers of the above hardware interface, while the driver of the microcontrol, and other advanced driving functions, such as compatible DOS file system, TCP / IP protocol, etc. If you need another purchase. Based on RTOS and interface standards, a large number of library function driver modules can be designed, and select or crop according to actual needs. (5) High reliability general computer operating system problems, such as crash, except for data loss, etc., there is no problem, and single-chip system is generally close to industrial control, transportation, medical equipment and other electromechanical systems. Related, inappropriate output or even timely outputs may bring property losses and security issues. Therefore, the RTOS in the embedded system requires high reliability and must be strictly tested before issuance. This is a time-consuming process, and the RTOS prices are generally higher than one of the general operating systems. 2. RTOS is a typical microcontroller program for a kernel after the program pointer reset, first, interface settings such as stack, interrupt, interrupt vector, timer, serial port, initialize the data storage area, and display content, and then come to a monitoring, Wait or empty cycle, in this loop, the CPU can monitor peripherals, respond to interrupts or user input. This main program can be seen as a kernel, the kernel is responsible for the initialization and opening of the system, scheduling other tasks, equivalent to the main function in the C language. RTOS is a standard core, including formatting of various on-chip peripheral initialization and data structure, does not require users to direct hardware devices and resources, all hardware settings, and resource access must pass RTOS. core. After the hardware is shielded, the user does not have to clear every detail of the hardware system, which reduces the amount of learning before the development. In general, the less direct access to hardware, the higher the reliability of the system. RTOS is a test-tested kernel that is more standardized, efficient, and reliability compared to the main program kernel prepared by the general user. For a "older", "older" for mastering single-chip hardware systems and programming, it is better to manage the system through RTOS to be more intuitive and freedom, but through RTOS management can eliminate human negligence factors, improve software reliability. In addition, high-efficiency multi-tasking support is RTOS design from the starting main line, using the RTOS management system to unify each task, optimize the allocation of CPU time and system resources, so that it is not idle, not congest.
For some specific application, the finely scrutiny application does not use RTOS to achieve higher efficiency than using RTOS; however, for most general users and newcomers, RTOS can improve resource utilization, especially on the film Today, which is growing, product reliability and getting the market time. 3. RTOS is a platform RTOS built on a single-chip hardware system, and all the development of the user is on, so it can be called a platform. Users with RTOS do not have to spend a lot of time learning hardware, and more starting with direct development. RTOS is also a standardized platform that defines the interface of each application task and kernel, which has also promoted the standardization of the application. After the application is standardized, it makes it easy for software archiving, communication, modification, and expansion to create conditions for engineering development of embedded software and reduce development management efforts. After the standardization of embedded software is promoted to society, it can promote the division of labor development, reduce duplicate labor, and the recent file and communication protocol library function products, which have recently established on RTOS, etc. are examples. RTOS is also an improvement in developers and developers. The development unit of RTOS is equivalent to introducing a widely used embedded system application development standard in a set of industries, making development management easier and effective. Based on the development of RTOS and C language, there is a good inheritance. When applications, processor upgrades, and replace the processor type, most existing software can be transplanted without modification. For developers, it is equivalent to adopting a standardized way of thinking in programming, improving the efficiency of knowledge creation; because of similar ideas, you can understand the results of other personnel of the peers. 4. RTOS generates and develops rapidly developing the improvement of microcontroller processor capabilities and complicated application functions, accurate, forcing applications to divide multiple tasks different from importance, optimize CPU time between each task room and System resources, but also to ensure real time. Replacing a kernel that implements the above functions by users is generally unrealistic, and this requirement is common. Under this situation, the high-performance RTOS kernel that is prepared by the professionals is a inevitable result. The improvement of the real-time and reliability requirements of the program is also a reason for RTOS development. In addition, the software development of single-chip system has become increasingly engineered, and the product has been shortened, and the management personnel are forced to find a way to develop in handling, standardization, and multiplayer development. In a long history, RTOS promotion can bring more effective, more professional division of work, reducing social duplication, and improving labor productivity. 5. Basic Features of ROS (1) Task Tasks (Task) is the most important operational object in RTOS, each executed by the CPU under the call of RTOS. Activated or current task is the task being executed by the CPU. The sleeping task is to keep the context background whose execution it is executed, and once it is switched to the current task, you can continue the execution of the task from the end of the last execution. The scheduling of the task is currently mainly a time sliver, Round-Robin and a priority pre-preemptive, which may support one or several of them, which prioritizes Real-time support is best. (2) Task Switching the system CPU and system resources under RTOS management are allocated to different tasks, which looks like many tasks executes simultaneously, but in fact, there is only one task in every time in execution, that is, the current task. There are two reasons for switching between tasks. When an task ends the operation normally, it handed the CPU control to the RTOS. RTOS checks all the tasks in the task queue, and determines the highest priority of the task under the following tasks, you need to execute. Another situation is when an task is executed, a higher priority task has interrupted, and the RTOS is saved to the interrupt task.
RTOS regularly organizes task queues, deletes ended tasks, add new to perform tasks and arranges them from large to small order, which can allocate system resources between each task. (3) Messages and Mailbox Messages (Mailbox) are carriers and channels of data transfer between tasks in RTOS, and one task can have multiple mailboxes. Through the mailbox, the information can be delivered asynchronously between each task, and there is no query and waiting for the CPU time. When the RTOS contains the on-board bus interface drive function, communication between each microcontroller is also performed by the mailbox, and the user does not need to know more about the content of the hardware. (4) Semaphore is equivalent to a flag (FLAG), by preset, an event can change the flag. A task can determine its actions by monitoring the change of the flag, and does not consume the CPU time when monitoring the changing changes, the font of the task is done by RTOS. By using the brancy, a task can not be queried when waiting for the event to change, and give the CPU time to other tasks. (5) The storage area allocates RTOS to allocate a unified allocation of the system storage area. The assignment can be dynamic or static, and each task is required to apply to the RTOS kernel when the storage area is required. RTOS can prevent zerosage of the storage area when dynamically assigned by using the storage allocated class core object management data memory. (6) Interrupt and Resource Management RTOS provides a common design for interrupt management, efficient and flexible, so that minimal interrupt latency and maximum interrupt response. The resource object class in the RTOS core implements exclusive access to system entity resources or virtual resources, one task can get unique access to resources, and other tasks cannot be accessed before resource release, which avoids resource conflicts. The well-designed RTOS has a resource call design that may lead to system deadlock. The above is the basic characteristics of RTOS. According to the different products, it may also contain many other functions. 6. Does your processor need a real-time multitasking operating system? RTOS is one of the hotspots in the field of embedded systems, is a popular development platform, but it is still expensive for many users, will be large Change the development method of user habits, so it is still sensible to introduce the necessity before introducing RTOS. You can think about the following questions: (1) Does your processor control The time and way of doing the same as you expected? (2) Do you find that you spend a lot of time how to make a code when the code is executed? (3) Do you spend too much time on interrupt subroutine, know that the main program is not possible to handle interrupt events sequentially, try to compile all code to handle interrupt events? (4) Do you discover yourself testing a subroutine that is constantly testing the logo or calls the test mark, to determine if a subroutine should be performed? If you answer the above question, there is more than one, then it is to get a real-time multitasking operating system to free you from the triviality of programming. 8. What kind of RTOS is currently? When you look for RTOS in e-magazine, you may find more companies to develop RTOS products in the world, but you will find that after reading it carefully, their products may only cover several processors, and you are not familiar. Current product comparison companies include CMXcompany and EmbeddedsystemProducts (ESPs), INC. They have a single-chip microcontroller in China's single-chip industry, such as 8051, 251, 196/296, p51xa, 68xxx, etc. have RTOS and their related interfaces. Library function products, provide source code, no binary tax for each product. Among them, CMX's product prices are slightly lower, it is suitable for the Chinese market; and ESP's products have rich library function support.