This article introduces embedded systems and embedded operating systems in terms of concepts, features, and types. 1. What is an embedded system? Embedded systems generally refer to non-PC systems, which have computer functions but are not called computer devices or equipment. It is a specialized computer system centered on applications, with software and hardware cut-off and adapted to the comprehensive and strict requirements of the application system on functions, reliability, cost, volume, power consumption, etc. To put it simply, the embedded system integrates the application software and hardware of the system, which is similar to the working mode of BIOS in the PC. It features low software code, high automation, and fast response speed, it is particularly suitable for systems that require real-time and multi-task processing. An embedded system consists of an embedded processor, related supporting hardware, an embedded operating system, and an application software system. It is a "device" that can work independently ". Embedded systems include almost all electrical equipment in life, such as PDAs, mobile computing devices, TV set-top boxes, mobile Internet access, digital TVs, multimedia, automobiles, microwave ovens, digital cameras, home automation systems, elevators, air conditioners, security systems, vending machines, cellular phones, consumer electronic devices, industrial automation instruments, and medical instruments. The hardware of the embedded system, including the processor/microprocessor, memory and peripheral devices, I/O ports, and graphic controllers. An embedded system is different from a general computer processing system. It does not have a storage medium as large as a hard disk. Most of them use EPROM, EEPROM, or flash memory as the storage media. The software section includes operating system software (requiring real-time and multi-task operations) and application programming. Applications control the operation and behavior of the system, while the operating system controls the interaction between application programming and hardware. Binary Embedded Processor The core of an embedded system is an embedded microprocessor. Embedded Microprocessor has four features: (1) strong support for real-time and multi-task processing, multi-task processing, and short interrupt response time, this minimizes the execution time of internal code and real-time operating systems. (2) it has a powerful storage zone protection function, because the software structure of the embedded system has been modularized, in order to avoid the crossover of errors between software modules, a strong storage zone protection function must be designed, which is also conducive to software diagnosis; (3) a scalable processor structure, in order to quickly expand to meet the application's high-performance embedded microprocessor; (4) embedded microprocessor power consumption must be low, this is especially true for battery-powered embedded systems in portable wireless and mobile computing and communication devices. The power consumption can only be MW or even μW. According to incomplete statistics, there are more than 1000 types of embedded processors in the world, and more than 30 series of popular architectures are available. Among them, 8051 of the systems account for the majority, and more than 20 Semiconductor manufacturers producing such single-chip microcomputer, a total of more than 350 derivative products, only Philips has nearly 100. Almost every semiconductor manufacturer now produces embedded processors, and more companies have their own processor design departments. The addressing space of the embedded processor ranges from 64 KB to 16 MB, and the processing speed is 0.1 ~ 2000 MIPS, commonly used encapsulation 8 ~ 144 pins. According to the current situation, embedded computers can be divided into the following categories. (1) embedded microprocessor (embedded microprocessor unit, Empu) Embedded microprocessor uses "enhanced" general-purpose microprocessor. Because embedded systems are usually used in harsh environments, embedded microprocessor requirements in terms of operating temperature, electromagnetic compatibility and reliability are higher than general standard microprocessor. However, the functions of the embedded microprocessor are basically the same as those of the standard microprocessor. According to the actual embedded application requirements, the embedded microprocessor is assembled on a specially designed motherboard, and only the motherboard functions related to the embedded application are retained, which can greatly reduce the system volume and power consumption. Compared with industrial control computers, a system composed of embedded microprocessor has the advantages of small size, light weight, low cost, and high reliability, however, the circuit board must contain Rom, Ram, bus interfaces, various peripherals, and other devices to reduce system reliability and poor technical confidentiality. The embedded microprocessor and its memory, bus, peripherals, etc. are installed on a circuit board to form a single board machine system. Currently, embedded processors mainly include am186/88, micron ex, SC-400, Power PC, 68000, MIPS, ARM Series, etc. (2) embedded microcontroller unit (MCU) An embedded microcontroller, also known as a single-chip microcomputer, integrates the entire computer system into a chip. Embedded Microcontroller generally takes a microprocessor kernel as the core. According to some typical applications, the chip is integrated with ROM/EPROM, Ram, bus, bus logic, timing/counter, watchdog, I/O, serial port, pulse width modulation output, A/D, D/, flash Ram, EEPROM and other necessary functional components and peripherals. To meet different application requirements, you must modify and customize the function settings and peripheral configurations so that a series of single-chip microcomputer has multiple derivative products, each derivative product has the same processor kernel. The difference is the configuration and function settings of memory and peripherals. In this way, the single-chip microcomputer can match the application requirements to the maximum extent, thus reducing the power consumption and cost of the entire system. Compared with the embedded microprocessor, the monolithic microcontroller greatly reduces the size of the application system, greatly reducing power consumption and cost and improving reliability. Currently, embedded microcontroller is the most popular among all types of embedded processors in terms of product variety and quantity, and many of the above advantages determine that microcontroller is the mainstream of embedded system applications. The on-chip peripheral resources of the microcontroller are generally rich and suitable for control. Therefore, it is called the microcontroller. Generally, embedded microprocessor can be divided into general and semi-General two categories, Representative General series including 8051, p51xa, MCS-251/196/296, c166/167, 68300 and so on. Representative semi-universal series, such as MCU 8xc930/24/60, c540, and c541 supporting USB interfaces, dedicated MCU and compatible series supporting I2C, CAN bus, LCD, etc. Currently, MCU accounts for about 70% of the market share of embedded systems. (3) Embedded DSP processor (embedded digital signal processor, EDSP) In digital signal processing applications, various digital signal processing algorithms are quite complex. The complexity of these algorithms may be O (NM), or even NP, generally, structured processors cannot perform these operations in real time. Because the DSP processor has specially designed the system structure and commands, it is suitable for real-time digital signal processing. In terms of digital filtering, FFT, and spectral analysis, DSP algorithms are entering the embedded field. DSP Applications are transitioning from using common commands to implementing DSP functions in general-purpose single-chip microcomputer to using Embedded DSP processors. There are two types of Embedded DSP processors: (1) the DSP processor has been monolithic, modified by EMC, added on-chip peripherals to become an Embedded DSP processor, and TI's tms320c2000/C5000 belongs to this category; (2) add a DSP co-processor to a common microcontroller or SOC, such as Intel's MCS-296 and infineon (Siemens) tricore. In addition, embedded DPS processors are also required for smart applications, such as various consumer products with intelligent logic, biological information identification terminals, and keyboards with encryption and decryption algorithms, ADSL Access, real-time voice pressure solution system, and virtual reality display. This kind of intelligent algorithms generally involve a large amount of computing, especially vector operations and pointer linear addressing. These are the advantages of DSP processors. The Representative Products of the Embedded DSP processor are ti's TMS320 series and Motorola's dsp56000 series. The TMS320 series Processors include the c2000 series for control, the C5000 series for mobile communication, and the C6000 and c8000 series with higher performance. Dsp56000 has developed into several different series of processors, such as dsp56000, dsp56100, dsp56200, and dsp56300. In addition, Philips recently launched r Based on the Embedded DSP structure that can be reset and manufactured with low-cost and low-power technologies. e. a. l DSP processor is characterized by dual Harvard structure and dual multiplication/accumulation unit. Its application target is a large number of consumer products. (4) system on chip (SOC) With the popularization of EDI, the popularization of large-scale design, and the rapid development of semiconductor technology, a more complex system can be implemented on a silicon wafer, which produces SOC Technology. The general-purpose processor kernels will serve as the standard libraries of SOC design companies. Like many other embedded system peripherals, they have become a standard device in the design of the large-scale program, it is described in standard hardware languages such as VHDL and verlog and stored in the device library. Users only need to define their entire application system. After the simulation is passed, the design drawing can be handed over to the semiconductor factory for sample production. In this way, except for some devices that cannot be integrated, most of the entire embedded system can be integrated into one or several chips, and the application system circuit board will become very simple, it is advantageous for reducing the volume and power consumption of the entire application system and improving reliability. SOC can be divided into two categories: general and dedicated. General SOC such as infineon (Siemens) tricore, Motorola M-core, and some arm series devices, such as the Neuron chip jointly developed by Echelon and Motorola. Dedicated SOC is generally used in a system or a certain type of system, such as Philips smart Xa, it makes XA Single-Chip kernel and CCU units that support over 2048 complex RSA Algorithms on one silicon chip to form a dedicated SOC that can load Java or C language for Internet security. 3. Embedded Operating System An embedded operating system is an operating system software that supports embedded system applications. It is an extremely important part of an embedded system (including hardware and software systems, it usually includes hardware-related underlying driver software, system kernel, Device Driver Interface, communication protocol, graphical interface, standardized browser, and other browsers. Embedded operating systems have the basic characteristics of general operating systems, such as the ability to effectively manage increasingly complex system resources; the ability to virtualize hardware, this frees developers from busy driver porting and maintenance; provides library functions, drivers, toolsets, and applications. Compared with general operating systems, embedded operating systems have outstanding features in real-time system efficiency, hardware dependence, software solid-state, and application specialization. 1. Types of Embedded Operating Systems Generally, embedded operating systems can be divided into two types: Real-time Operating Systems for control, communication, and other fields, for example, WinDriver's VxWorks, Isi's PSOs, QNX system software company's QNX, Ati's nucleus, and other non-real-time operating systems for consumer electronic products, such products include personal digital assistants (PDAs), mobile phones, set-top boxes, e-books, and webphone. A. Non-real-time operating system Early embedded systems do not have the concept of operating systems. Programmers usually write embedded programs directly to bare metal and bare devices. In this case, embedded programs are usually divided into two parts: foreground programs and background programs. The foreground program processes events through the middle section. Its structure is generally infinite loop. The background program is responsible for allocating, managing, and scheduling software and hardware resources of the entire embedded system, is a system management and scheduling program. This is what we usually call the frontend and backend systems. In general, background programs are also called task-level programs, and foreground programs are also called event-level programs. When the program is running, the background program checks whether each task meets the running conditions and uses a certain number of scheduling algorithms to complete the corresponding operations. Operations with extremely strict real-time requirements are usually completed by interruptions. They only mark the occurrence of events in the interrupt service program and exit the interrupted process without doing any work. After being scheduled by the background program, the event is handled by the foreground program, so that subsequent and other interruptions will not be affected by the time-consuming event processing in the interrupted service program. In fact, the real-time performance of the front and back-end systems is worse than expected. This is because the frontend and backend systems consider that all tasks have the same priority level, that is, equality, and the execution of tasks queues through FIFO queues. Therefore, tasks with high real-time requirements cannot be processed immediately. In addition, because the foreground program is an infinite loop structure, once the tasks being processed in this loop body crash, other tasks in the entire task queue cannot be processed, this causes the entire system to crash. These systems are widely used in simple embedded applications because they have a simple structure and almost no Additional RAM/ROM overhead. B. Real-time Operating System A real-time system is a computer system that can execute its functions and respond to external asynchronous events within a specified period of time. The correctness of the operations depends not only on the logic design, but also on the time of these operations. "Within a certain period of time" is the core of this definition. That is to say, the real-time system has strict requirements on the response time. Real-time systems have strict requirements on logic and timing. deviations between logic and time series may cause serious consequences. There are two types of real-time systems: Soft Real-Time Systems and hard real-time systems. A soft real-time system only requires that the event response be real-time, and does not require that a task be completed within a certain period of time. In a hard real-time system, not only does the task response need to be real-time, in addition, the event processing must be completed within the specified time. Generally, most real-time systems combine the two. Real-time application software design is generally more difficult than non-real-time application software design. The key to real-time system technology is how to ensure the real-time performance of the system. A real-time multi-task operating system is an operating system that supports real-time control of system operations. Its primary task is to schedule all available resources to complete real-time control tasks. Secondly, it focuses on improving the efficiency of computer systems. Its important feature is to meet the time restrictions and requirements. The real-time operating system has the following functions: Task Management (multi-task and priority-based task scheduling), synchronization and communication between tasks (semaphores and mailboxes), memory optimization management (including Rom Management) real-time clock service and interrupt management service. The real-time operating system has the following features: small scale, short interruption blocking time, short interrupt processing time, and fast task switching. Real-time Operating systems can be divided into preemptible and non-preemptible types. For a priority-based system, A preemptible real-time operating system means that the kernel can seize the CPU usage right of a running task and grant the permission to a ready-state task with a higher priority, the kernel grabs the CPU to run other tasks. After a non-preemptible real-time operating system uses an algorithm and decides to run a task, it gives control of the CPU to the task until it takes the initiative to return control of the CPU. Interruption is handled by the interrupt service program. A Sleep task can be activated to bring it into the ready state, and the task that enters the ready state cannot run yet, wait until the currently running task proactively gives control of the CPU. The real-time performance of a real-time operating system is better than that of a system without a real-time operating system. The real-time performance depends on the execution time of the longest task. The disadvantage of the non-preemptible real-time operating system is that, if the execution time of the longest task cannot be determined, the system's real-time performance cannot be determined. The real-time performance of a preemptible real-time operating system is good. A task with a higher priority can run immediately as long as it meets the running conditions or enters the ready state. That is to say, except for tasks with the highest priority, other tasks may be interrupted at any time during the running process by tasks with a higher priority, so that the latter can run. This method ensures the real-time performance of the system. However, if the process of preemptible CPU control among tasks is poor, system crashes, crashes, and other serious consequences may occur. 2. Development of Embedded Operating Systems With the development of embedded systems, the embedded operating system has gone through four significant stages. The first stage is the algorithm phase for embedding a non-operating system. It is a single-chip system in the form of a programmable controller and works with monitoring, servo, and indication devices. Most of these systems are used in some highly specialized industrial control systems. Generally, they are not supported by the operating system. The system is directly controlled through assembly language programming, and the memory is cleared after running. The main features of the system at this stage are: the system structure and functions are relatively simple, the processing efficiency is low, the storage capacity is small, and there is almost no user interface. This embedded system is easy to use and has low price. It has been widely used in the domestic industrial field, however, it is far from able to adapt to the needs of efficient modern industrial control and emerging information appliances that require large-capacity storage media. The second stage is an embedded system based on embedded CPU and centered on a simple operating system. The main features of the system at this stage are: a wide variety of CPUs with poor versatility; low system overhead and high efficiency; generally equipped with System Simulators, the operating system has certain compatibility and scalability; the application software is professional and the user interface is not friendly enough. The system is mainly used to control the system load and monitor the application running. The third stage is the general embedded real-time operating system, and is an embedded system with the embedded operating system as the core. The main features of the system at this stage are: the embedded operating system can run on different types of microprocessor with good compatibility; the operating system kernel is small and efficient, it is highly modular and scalable. It provides functions such as file and directory management, device support, multi-task, network support, graphical window, and user interface. It has a large number of application interfaces (APIS ), simple Application Development; rich embedded application software. The fourth stage is an Internet-based embedded system, which is developing rapidly. At present, most embedded systems are isolated from the Internet, but with the development of the Internet and the increasingly close combination of Internet technology and information appliances, industrial control technology, etc, the combination of embedded devices and the Internet represents the real future of embedded technology. 3. necessity of using a real-time operating system Embedded real-time operating systems are more and more widely used in embedded applications, especially in applications with complex functions and huge systems. First, the embedded real-time operating system improves the system reliability. In the control system, security considerations require that the system should not crash at least and have the ability to recover itself. It is not only required to improve the reliability and anti-interference of the system in the aspect of hardware design, but also to improve the anti-interference of the system in the aspect of software design, so as to minimize security vulnerabilities and unreliable hidden dangers. For a long time, the front-and-back-end system software design causes exceptions, errors, running, or even endless loops in the running program, resulting in system crash. In real-time operating system management systems, such interference may only cause one of several processes to be damaged, and can be repaired by the system monitoring process that runs the system. Generally, this system monitors processes to monitor the running status of each process. In case of exceptions, it takes some measures that are conducive to system stability and reliability, such as clearing problematic tasks. Secondly, it improves the development efficiency and shortens the development cycle. In an embedded real-time operating system environment, developing a complex application usually splits the entire program into multiple task modules according to the decoupling principle in software engineering. Debugging and modification of each task module hardly affect other modules. Commercial Software generally provides a good multi-task debugging environment. Thirdly, the embedded real-time operating system gives full play to the multi-task potential of 32-bit CPU. 32-bit CPUs are faster than 8 or 16-bit CPUs. In addition, they are designed to run multi-user and multi-task operating systems and are especially suitable for running multi-task real-time systems. The 32-bit CPU is designed to improve system reliability and stability, making it easier to avoid crashes. For example, the CPU running status is divided into system and user States. Separates the system Stack from the user stack, and provides the CPU running status in real time. This allows you to implement real-time kernel running protection from both hardware and software aspects in the system design. If you still use the front and back-end method, you cannot take advantage of the 32-bit CPU. In a sense, computers without operating systems (bare metal machines) are useless. In embedded applications, only the CPU is embedded into the system and the operating system is embedded in the system is the real embedded computer application. 4. Advantages and Disadvantages of Real-time Operating Systems Developing real-time applications in an embedded real-time operating system makes it easy to design and expand programs. New functions can be added without major changes. By dividing an application into several independent task modules, the design process of the application is greatly simplified, and events with demanding real-time performance have been processed quickly and reliably. Through effective system services, embedded real-time operating systems make better use of system resources. However, using an embedded real-time operating system requires additional ROM/Ram overhead, 2 ~ 5% additional CPU load and kernel cost. |