A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service
Embedded Systems integrates the operating system and functional software into the computer hardware system according to application requirements, so as to realize the integration of software and hardware. The embedded system appeared in the late 1960s s and was initially used to control the electromechanical telephone switch, nowadays, it has been widely used in many fields such as industrial manufacturing, process control, communication, instruments, instruments, automobiles, ships, aviation, aerospace, military equipment, and consumer products. The number of embedded systems far exceeds that of various general-purpose computer systems: the core CPU of computer systems, with an annual output of about 2 billion around the world, more than 80% of these applications are applied to various specialized embedded systems.
Generally, any dedicated software and hardware system with a microprocessor can be called an embedded system. Compared with general computing platforms, embedded systems often have characteristics such as single function, small size, low power consumption, high reliability, good tailoring, high software and hardware integration, and relatively low computing power. Over the years, there have been no operating systems in embedded devices, mainly due to two reasons: first, devices such as washing machines, microwave ovens, and refrigerators only need a simple control program, to manage a limited number of buttons and indicators, there is no need to use the operating system; secondly, it often only has limited hardware resources, not enough to support an operating system.
However, with the development of hardware, embedded systems become more and more complex, and many functions are gradually added to the initial control program, many of which can be provided by the operating system. As a result, the emergence of Embedded Operating Systems (Embedded Operating Systems) in the late 1970s S has greatly simplified the application design, and can effectively ensure the quality of software and shorten the development cycle. Simple Elasticsearch generally does not use an operating system and only contains some control processes. However, as the complexity of embedded operating systems increases, simple process control cannot meet the requirements of the system, therefore, you must consider using the operating system for system software. Therefore, embedded operating systems have emerged.
With the wide application of EOS, the industry has launched some well-applied EOS products. To sum up, the EOS should have the following features: small, real-time, loading/unloading, solidified code, weak interaction, strong stability, and unified interface. Currently, the most widely used EOS products include Vxwork, QNX, PalmOS, WindowsCE, pSOS, and Hopen OS (independently developed by Kais group in China. Among them, Vxwork is the most widely used and has the highest market share. It is characterized by strong real-time performance (using priority preemption and rotation scheduling mechanisms). In addition, its reliability and scalability are also quite good. QNX is a highly scalable system with a real-time POSIX environment at its core and a complete window system less than 1 MB. In contrast, Microsoft WinCE has a huge core volume and poor real-time performance. However, due to the friendly user interfaces of Windows and APIs familiar to programmers, it also binds applications such as IE and Office, is gaining more market share. Compared with these commercial operating systems, Linux has received more and more attention.
II. Overview of embedded Linux
Linux is a mature and stable network operating system. Embedded Linux has many advantages. First, the source code of Linux is open. anyone can obtain and modify it and use it to develop their own products. Secondly, Lirmx can be customized, and its system kernel is only about KB at the minimum. A core program with a Chinese system and graphic user interface can also be less than 1 MB, and it is also stable. In addition, it is compatible with most Unix systems and is quite easy to develop and transplant applications. At the same time, due to its good portability, Linux has been successfully run on hundreds of hardware platforms.
However, Linux is not designed for real-time applications. Therefore, if you want to run Linux in an embedded system with high real-time requirements, you must add real-time software modules. The kernel space run by these modules is part of the process scheduling, interrupt processing, and program execution of the operating system. Therefore, incorrect code may damage the operating system and affect the reliability and stability of the entire system. Many advantages of Linux are that it has been widely used in the embedded field, and a considerable number of embedded Linux systems have emerged. Typical examples include uClinux, ETLinux, ThinLinux, and LOAF. ETLinux is usually used in small industrial computers, especially PC/104 modules. ThinLinux targets dedicated camera servers, X-10 controllers, MP3 players, and other similar embedded applications. LOAF is short for Linux On A Floppy and runs On the 386 platform.
III. Advantages of Linux as an embedded operating system
Linux as an embedded operating system has the following advantages:
1. it can be applied to multiple hardware platforms. Linux has been transplanted to multiple hardware platforms, which is attractive for research and development projects with limited funds and time. The prototype can be developed on the standard platform and then transplanted to the specific hardware to accelerate the software and hardware development process. Linux uses a unified framework to manage hardware. changes made from one hardware platform to another are irrelevant to upper-layer applications. Linux can be configured at will, without any license or business partnership, the source code can be obtained for free. This makes it possible to avoid any copyright disputes when using Linux as the operating system. Undoubtedly, this will save a lot of development costs. Built-in network support, while embedded systems require more and more network support. Highly modular Linux makes it easy to add components.
2. Linux is a Unix-like, kernel-based, with full memory access control and supports a large number of hardware (including X86, Alpha, ARM, Motorola, and other existing chips) is a common operating system. The program source code is publicly available. anyone can modify it and issue it under the GNU General Public License. In this way, developers can customize the operating system to meet their special needs.
3. Linux has comprehensive development tools familiar to Unix users, and almost all Unix system application software has been transplanted to Linux. Linux also provides powerful network functions, including multiple window managers (X Windows ). Its powerful language compiler GCC, C ++, and so on can also be easily obtained, not only mature and complete, but also easy to use.
IV. establishment of embedded Linux
The complete embedded Linux solution should include the embedded Linux operating system kernel, runtime environment, graphical interface and application software. Due to the special requirements of embedded devices, the kernel, environment, and GUI in the embedded Linux solution are very different from those in standard Linux, the main challenge is how to implement high-quality real-time task scheduling, graphical display, network communication, and other functions in small FLASH, ROM, and memory.
1. streamline the kernel
The Linux kernel has its own structure system. process management, memory management, and file system are the three most basic subsystems. A simple representation of its framework. User processes can directly access kernel resources through system calls or function libraries. Because the Linux kernel has such a structure, you must pay attention to the coordination between subsystems when modifying the kernel.
The embedded Linux kernel is usually cropped from the standard Linux kernel. You can configure the system as needed to remove unnecessary service functions, file systems, and device drivers. The kernel size after cropping and compression is generally about KB, which is suitable for embedded devices. Different from standard Linux, embedded Linux must be started from FLASH or ROM. The standard Linux startup code initializes the system and directs the kernel from the floppy disk and hard disk O disk. Embedded Linux is generally stored in FLASH or ROM, and the standard LILO cannot be booted. In systems that support direct guidance from FLASH devices, such as Huaheng's uClinux, the boot program mainly initializes the hardware system and decompress and shift the operating system. In systems that do not support direct FLASH boot, FLASH devices can only be used as non-boot disks. In this case, you can first load a small operating system from the hard disk or floppy disk, such as Embedded DOS, and then execute the "Loadlin" loader program to boot embedded Linux from FLASH.
Modifications to the standard Linux mainly involve changes to the virtual memory and scheduler. Because the standard Linux system uses virtual memory management to run multiple processes at the same time, the CPU time slice that can be allocated by each process to be run is limited, resource usage efficiency is low. In this way, for embedded systems with high real-time requirements, real-time tasks often require high CPU burst processing capabilities, that is, in some cases, extremely high processing efficiency, therefore, we need to shield the virtual memory management mechanism of the kernel. For embedded systems without hard disk devices, virtual storage management is not required. Embedded applications with high real-time requirements can be implemented by modifying the Task Scheduling module. many switching points are added to the kernel and device drivers. At this point, the system checks whether there is an unhandled emergency interrupt. If yes, the kernel is deprived of running and the interruption is handled in a timely manner. A better way to implement real-time services is to add a real-time kernel to the standard Linux kernel, which runs as a task on the real-time kernel, real-time tasks are also directly run on the real-time kernel, such as RT-Linux.
File systems are essential for embedded Linux operating systems. However, standard Linux supports a large number of file systems. Therefore, in addition to meeting the normal operating needs of the system, all other files can be deleted and can be removed using the original setting options. Generally, the file system of embedded devices mainly uses RamDisk technology and network file system technology. RamDisk can reside in Flash and be loaded into memory during runtime.
Start building with 50+ products and up to 12 months usage for Elastic Compute Service