Share this

Design and Application of Embedded Linux Systems

2026-04-06 06:00:22 · · #1
I. Introduction Embedded systems are computer systems that integrate operating systems and functional software into computer hardware systems according to application requirements, thus achieving software-hardware integration. Emerging in the late 1960s, embedded systems were initially used to control electromechanical telephone exchanges and are now widely used in numerous fields such as industrial manufacturing, process control, communications, instrumentation, automobiles, ships, aviation, aerospace, military equipment, and consumer products. The number of embedded systems far exceeds that of general-purpose computer systems: the global production of a computer system's core CPU is approximately two billion units per year, with over 80% used in highly specialized embedded systems. Generally speaking, any dedicated hardware and software system with a microprocessor can be called an embedded system. Compared to general-purpose computing platforms, embedded systems often have characteristics such as single function, small size, low power consumption, high reliability, good customization, high hardware and software integration, and relatively low computing power. For many years, embedded devices lacked operating systems, primarily for two reasons: First, devices like washing machines, microwave ovens, and refrigerators only required a simple control program to manage a limited number of buttons and indicator lights, making an operating system unnecessary; second, they often had limited hardware resources insufficient to support an operating system. However, with hardware advancements, embedded systems became increasingly complex, and many functions were gradually added to the initial control programs, many of which could be provided by an operating system. Thus, embedded operating systems (ES) emerged in the late 1970s. Their appearance greatly simplified application design and effectively ensured software quality and shortened development cycles. Simple ES generally did not use an operating system, containing only some control flows. However, as embedded operating systems grew in complexity, simple flow control could no longer meet system requirements, necessitating the use of an operating system for system software. Therefore, embedded operating systems came into being. With the widespread adoption of EOS, the industry has launched several successful EOS products. In summary, EOS should possess the following characteristics: compact size, real-time performance, removability, fixed code, weak interactivity, strong stability, and a unified interface. Currently, the most widely used EOS products include: VxWorks, QNX, PalmOS, Windows CE, pSOS, and Hopen OS (independently developed by the domestic Kaisheng Group). Among them, VxWorks is the most widely used and has the highest market share. Its outstanding feature is its strong real-time performance (using mechanisms such as priority preemption and round-robin scheduling). In addition, its reliability and customizability are also quite good. QNX is a highly scalable system; its core, plus a real-time POSIX environment and a complete window system, is less than one megabyte. In contrast, Microsoft WinCE has a large kernel size and its real-time performance is less than satisfactory, but due to the user-friendly interface and familiar APIs of the Windows series, and its bundled applications such as IE and Office, it is gradually gaining a larger market share. Compared with these commercial operating systems, Linux is receiving increasing attention. II. Overview of Embedded Linux Linux is a mature and stable network operating system. Embedding Linux into embedded devices has many advantages. First, Linux's source code is open, and anyone can obtain and modify it to develop their own products. Second, Linux is customizable, and its system kernel is as small as about 134kB. A core program with a Chinese system and a graphical user interface can be kept under 1MB and remains equally stable. Furthermore, it is compatible with most Unix systems, making application development and porting relatively easy. Simultaneously, due to its excellent portability, Linux has been successfully run on hundreds of hardware platforms. However, Linux was not specifically designed for real-time applications. Therefore, to run Linux on embedded systems with high real-time requirements, real-time software modules must be added. These modules run in the kernel space, which is where the operating system implements process scheduling, interrupt handling, and program execution. Therefore, faulty code can corrupt the operating system, thus affecting the reliability and stability of the entire system. Despite these numerous advantages, Linux has gained widespread application in the embedded field, resulting in a considerable number of embedded Linux systems. Representative examples include uClinux, ETLinux, ThinLinux, and LOAF. ETLinux is commonly used in small industrial computers, especially PC/104 modules. ThinLinux is geared towards dedicated camera servers, X-10 controllers, MP3 players, and other similar embedded applications. LOAF, short for Linux On A Floppy, runs on the 386 platform. III. Advantages of Linux as an Embedded Operating System The main advantages of Linux as an embedded operating system are as follows: 1. Applicability to multiple hardware platforms. Linux has been ported to various hardware platforms, which is very attractive for research and development projects with limited funding and time. Prototypes can be developed on standard platforms and then ported to specific hardware, accelerating the software and hardware development process. Linux uses a unified framework to manage hardware, and changes from one hardware platform to another are independent of the upper-level application. Linux can be configured freely without any licenses or vendor partnerships, and the source code is freely available. This ensures that using Linux as the operating system will not encounter any copyright disputes. Undoubtedly, this will save a lot of development costs. It has built-in network support, and embedded systems now have increasingly higher requirements for network support. Linux's high modularity makes adding components very easy. 2. Linux is a general-purpose operating system similar to Unix, kernel-based, with complete memory access control, and supports a large number of hardware (including most existing chips such as x86, Alpha, ARM, and Motorola). Its source code is completely open, and anyone can modify it and distribute it under the GNU General Public License. This allows developers to customize the operating system to meet their specific needs. 3. Linux comes with comprehensive development tools familiar to Unix users; almost all Unix application software has been ported to Linux. Linux also provides powerful networking capabilities and offers multiple selectable window managers (X Windows). Its powerful language compilers, such as GCC and C++, are readily available, mature, and easy to use. IV. Establishing Embedded Linux A complete embedded Linux solution should include an 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 an embedded Linux solution differ significantly from standard Linux. The main challenge is how to achieve high-quality real-time task scheduling, graphical display, and network communication functions within limited FLASH, ROM, and memory. 1. Simplified Kernel The Linux kernel has its own structural system, with process management, memory management, and the file system being its three most basic subsystems. Figure 1 simply illustrates its framework. User processes can directly access kernel resources through system calls or function libraries. Because of this structure, the coordination between the various subsystems must be carefully considered when modifying the kernel. Embedded Linux kernels are generally derived from standard Linux kernels. Users can configure the system according to their needs, removing unnecessary services, file systems, and device drivers. After being trimmed and compressed, the system kernel is typically only around 300KB, making it ideal for embedded devices. Unlike standard Linux, embedded Linux must be able to boot from FLASH or ROM. Standard Linux boot code handles system initialization and booting the kernel from a floppy disk or hard disk O drive. Embedded Linux is usually stored in FLASH or ROM, and cannot be booted using standard LILO. In systems that support direct booting from FLASH devices, such as uClinux from Huahong, the bootloader primarily handles hardware initialization and the decompression and shifting of the operating system. In systems that do not support direct booting from FLASH, the FLASH device can only be used as a non-bootable disk. In this case, a small operating system, such as embedded DOS, can be loaded from the hard disk or floppy disk first, and then the "Loadlin" loader can be executed to boot the embedded Linux from FLASH. [align=center][img=283,350]http://www.e-works.net.cn/images/127892160591562500.GIF[/img] Figure 1: Structure of the Linux Kernel[/align] Modifications to standard Linux primarily involve changes to virtual memory and the scheduler. Standard Linux uses virtual memory management to allow multiple processes to run simultaneously, but this limits the CPU time slice allocated to each process, resulting in low resource utilization. For embedded systems with high real-time requirements, real-time tasks often demand high burst processing capabilities from the CPU, requiring extremely high processing efficiency in certain situations. Therefore, it's necessary to disable the kernel's virtual memory management mechanism. For embedded systems without hard disks, virtual memory management is unnecessary. Embedded applications with strong real-time requirements can achieve this by modifying the task scheduling module, mainly by adding numerous switching points to the kernel and device drivers. At these points, the system checks for unhandled urgent interrupts; if any are found, the kernel is deprived of its execution, and the interrupt is handled promptly. A good way to implement real-time services is to add a real-time kernel to the standard Linux kernel. The standard Linux kernel runs as a task on the real-time kernel, and highly real-time tasks, such as RT-Linux, also run directly on the real-time kernel. A file system is essential for an embedded Linux operating system. However, standard Linux supports a large number of file systems, so besides keeping one to meet the system's normal operation requirements, all others can be deleted using existing settings options. Embedded devices generally use RamDisk and network file system technologies. RamDisk can reside in Flash and be loaded into memory at runtime. 2. Streamline the runtime environment. The typical Linux runtime environment refers to the infrastructure for running any application, mainly including function libraries and basic command sets. The standard Linux system provides both static and dynamic function libraries. Static function libraries are directly linked into the user application when it is built. Dynamic libraries are linked only at runtime. Since embedded system applications are generally pre-generated on the development platform, the embedded system only needs to provide dynamic function libraries to the application. The function libraries required for Linux applications to run mainly include C libraries, math libraries, thread libraries, encryption libraries, and network communication libraries. The most basic of these is the C language runtime library glib. This library mainly performs basic input/output, memory access, and file processing. A standard glib library requires about 1200kB of storage space. Considering that embedded Linux kernels are often very small, such a runtime library is too large. We have done some simplification work in two ways: (1) using static linking, without using dynamic linking of the runtime library at all; (2) simplifying the functions of this library. On a desktop system, using dynamic linking can bring many benefits. Using dynamic linking libraries can separate the updates and upgrades of application programs from those of function libraries, making maintenance easier and allowing multiple programs running at the same time to share a piece of code. However, in embedded systems, it is rare for multiple programs to run in parallel, and program maintenance, especially the maintenance and updates of library functions, is uncommon. At this time, the advantages of using static linking are extremely obvious. Because static linking can link only the parts used in the library into the program. When there are few applications (less than 5), static linking can achieve better results. To facilitate future expansion, we also adopted the second method: simplifying the library functions to meet our needs, retaining only basic functionalities. Another approach is to use other C language runtime libraries. However, these libraries significantly impact compatibility. The basic command set is also fundamental for running user applications, mainly including the init process initialization, terminal acquisition (getty), shell access, and basic commands. The startup process of an embedded system may differ from standard Linux, for example, skipping the login process and directly launching the GUI. This requires modifications to init, getty, etc. The standard Linux command set also cannot be directly applied to embedded environments due to its size limitations. Currently, there are two main solutions for small command sets: integration and assembly. The integration method reduces the overall size of the command set by integrating common parts and implementing it in C, offering better platform portability. The assembly method reduces the size of each command using assembly programming, resulting in a very small size but poorer platform portability. 3. GUI under Embedded Linux The GUI is becoming increasingly important in embedded or real-time systems, such as PDAs, DVD players, and WAP phones, all of which require a complete and attractive graphical user interface. The basic requirements for GUIs in these systems include: (1) lightweight and low resource consumption; (2) high performance; (3) high reliability; and (4) configurability. These have also become important indicators for evaluating embedded systems. Currently, the main GUIs on embedded Linux are WinCE, Micro Window, compact X Window, and MiniGUI (one of the better free software in China). Standard Linux's Xfree86 is too large and has high requirements for the operating environment to run in an embedded environment. Embedded GUIs mainly achieve small size and low resource consumption by reducing functions and performance. Currently, there are two main types of GUI environments on embedded Linux: X-type and Win32-type. X-type GUIs are divided into server and client sides. The server side provides mouse, keyboard processing, and display functions, while the client side is the user application. The server and client sides communicate through the socket interface and the X protocol. This approach is very beneficial for remote network graphical services, and the client and server sides can implement the X protocol and graphical display through the network. Typical X-type GUIs include Micro Window and compact X Window. Win32-based GUIs do not have client and server sides; each task is self-contained, and any task switching and event distribution are handled by a dedicated management task. Examples include wiCE and MiniGUI. V. Several Popular Embedded Linux Systems Besides the field of intelligent digital terminals, Linux has broad application prospects in mobile computing platforms, intelligent industrial control, financial terminal systems, and even the military. These Linux distributions are collectively referred to as "embedded Linux." 1. RT-Linux This is an embedded Linux operating system developed by the Polytechnic University of Mexico. To date, RT-Linux has been successfully applied in a wide range of fields, including space shuttle data acquisition, scientific instrument measurement and control, and film special effects image processing. The RT-Linux developers did not rewrite the Linux kernel for the characteristics of a real-time operating system, as this would be extremely laborious and difficult to ensure compatibility. Therefore, RT-Linux proposed a sophisticated kernel and uses the standard Linux kernel as a process within the real-time kernel, scheduling it together with user real-time processes. This results in minimal changes to the Linux kernel and fully utilizes the rich software resources already available under Linux. 2. uClinux: uCLinux is Lineo's flagship product and a prime example of open-source embedded Linux. It is primarily designed for embedded systems whose target processors lack a Memory Management Unit (MMU). It has been successfully ported to many platforms. Due to the lack of an MMU, multitasking implementation requires certain skills. uCLinux is an excellent embedded Linux distribution, short for micro-Control-Linux. It inherits the excellent characteristics of standard Linux, and through various miniaturization modifications, it has become a highly optimized and compact embedded Linux distribution. Although its size is small, it still retains most of Linux's advantages: stability, good portability, excellent network functionality, complete support for various file systems, and a rich set of standard APIs. It has undergone significant miniaturization work specifically for embedded systems and currently supports multiple CPUs. Its compiled object files can be controlled to the hundreds of KB level and it has been successfully ported to many platforms. 3. Embedix: Embedix is ​​a Linux distribution launched by Luneo, one of the major vendors in the embedded Linux industry. It is a Linux distribution redesigned according to the characteristics of embedded application systems. Embedix offers over 25 Linux system services, including a web server. The system requires a minimum of 8MB of RAM and 3MB of ROM or fast flash memory. Embedix is ​​based on the Linux 2.2 kernel and has been successfully ported to Intel x86 and PowerPC processors. Like other Linux distributions, Embedix is ​​available free of charge. Luneo has also released another important software product that allows programs running on Windows CE to run on Embedix. Luneo also plans to release an Embedix development and debugging toolkit, a graphical browser, and more. In short, Embedix is ​​a complete embedded Linux solution. 4. Xlinux Xlinux was developed by NetTiger, primarily by Chen Yinghao. Within months of joining NetTiger, he developed Xlinux, touted as the world's smallest embedded Linux system, with a kernel of only 143KB, and this size continues to decrease. The Xlinux kernel utilizes a patented "supercharacter set" technology, allowing the Linux kernel to not only be compatible with standard character sets but also to cover character sets from 12 countries and regions. Therefore, XLinux has unique advantages in promoting the international application of Linux. 5. PoketLinux, adopted by Agenda as the embedded Linux operating system for its new product "VR3PDA," provides a unified, standardized, and open information communication infrastructure across operating systems, enabling a complete platform for end-to-end solutions. The PoketLinux resource framework is open, allowing common software architectures to provide consistent services to all users. The PoketLinux platform shifts the user's focus away from devices, platforms, and networks, thus ushering in a new era of information technology. In PoketLinux, this is called Customized Information Exchange (CIE), which provides and accesses "topic" information tailored to each user's needs, regardless of the device being used. 6. MidoriLinux, released by Transmeta under the GNU General Public License (GPL), is an open-source operating system available at http://midori.transmeta.com. The company has a project called "MidoriLinux Project." The name "MidoriLinux" comes from the Japanese word for "green"—Midori—reflecting the environmentally friendly appearance of its Linux operating system. 7. Red Flag Embedded Linux: Developed by Red Flag Software Co., Ltd. of the Chinese Academy of Sciences in Beijing, Red Flag Linux is one of the better-developed embedded operating systems in China. Currently, Easy Embedded OS (EEOS), an open-source embedded operating system independently developed by the Institute of Computing Technology of the Chinese Academy of Sciences, has also entered the practical application stage. This embedded operating system primarily supports p-Java. The system aims for miniaturization and the reuse of Linux drivers and other modules. Backed by the strong research capabilities of the Institute of Computing Technology of the Chinese Academy of Sciences, EEOS is expected to develop into a fully functional, stable, and reliable domestic embedded operating system platform. VI. Conclusion Because Linux is an operating system with an open-source kernel, a complete toolchain, strong network support, and low cost, embedded Linux has inherited these unique advantages since its inception, which has led to its increasing attention. According to Even Data, the percentage of users expecting to use embedded Linux increased from 11% in 2001 to 27% in 2002, while VxWorks only increased from 16% to 18% and Win CE from 9% to 14% during the same period. Furthermore, in the various application markets of embedded Linux, communications (voice and data) ranks first, with sales of $13 million in 2000 and an estimated $126 million in 2005. It is foreseeable that embedded Linux will occupy a strong position in the future embedded operating system for communications.
Read next

CATDOLL Q 88CM TPE Doll

Height: 88cm Weight: 11.5kg Shoulder Width: 25cm Bust/Waist/Hip: 49/45/51cm Oral Depth: 3-5cm Vaginal Depth: 3-13cm Ana...

Articles 2026-02-22