11876 views|0 replies

661

Posts

18

Resources
The OP
 

Talking about ucOS, why do we need an operating system? [Copy link]

1. The operating system can significantly reduce the difficulty of development. The operating system helps us coordinate the coupling relationship between multiple programs. For example, we need to display the data received by the serial port on an LCD. The traditional approach is as shown in Figure 1:
[color=rgb(51, Figure 1. Flow without operating system In this flow, when the serial port receives data, the LCD display program is called to display the data. Figure 2 shows a method based on an operating system. In this method, the serial port receiving data and the LCD display program think that they have exclusive CPU, and each only performs their own related work. The coordination work of when to display on the LCD screen and when to continue receiving serial port data will be completed by the operating system.
Figure 2 Operating system process
[color=rgb(51, 51, From the above comparison, we can see that the operating system coordinates different functional programs to complete the same task together. At the same time, the operating system isolates each functional program to reduce their coupling. This makes it easier for designers to write each functional module, and the structure of the entire system is clearer. This advantage of the operating system is more obvious when the system logic structure is complex and there are many functional modules.
2. The operating system makes each task think that it has exclusive CPU, which is convenient for code writing. Using the above example, without an operating system, we need to call the serial port data receiving program and the LCD display program at the appropriate time, while with an operating system, we only need to complete the two functional module codes and then add them to the operating system. Both functional codes are executed in an infinite loop, and the structure appears to be very simple. 3. The operating system increases the portability of the code. I think this is not obvious in the ucOS system, but it can be said for other systems such as Android, Linux, etc., because they are basically considered to be medium-complex systems, while ucOS is a simple embedded system. For a medium-complex system, its underlying hardware devices have certain requirements. For example, Android devices need GPS support, display support, electronic compass support, and camera support according to system characteristics. These supports are all included in the Android device system, and they exist in the form of drivers. The upper-level applications implement complex functions by calling the underlying support. I think ucOS is just a scheduler, and its job is to coordinate multiple applications to run "simultaneously" on a single MCU. It almost has no concept of driver.

This post is from Embedded System

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list