Research on Dynamic Extension Technology of Embedded Linux
2026-04-06 02:05:53··#1
Abstract: Embedded systems are next-generation products resulting from the integration of advanced technologies such as computer technology, communication technology, semiconductor technology, microelectronics technology, and voice and image data transmission technology with specific applications. These systems have no redundant software or hardware memory, offering high reliability, low cost, small size, and low power consumption; they can be applied in home appliances, industry, communications, defense, and other fields. Their product forms are diverse, and their market potential is enormous. The emergence of embedded Linux has brought boundless vitality to the entire embedded world. Linux boasts advantages such as a customizable kernel, high efficiency, good stability, good portability, and open source code. It also includes a complete TCP/IP network protocol stack, making it well-suited for embedded applications. Compared to traditional real-time operating systems (RTOS), another advantage of using an open-source operating system like embedded Linux is that the Linux development community appears to support new IP protocols and other protocols faster than RTOS vendors. For example, there are more device drivers for Linux than for commercial operating systems. Therefore, more and more companies and individuals are choosing Linux as their preferred embedded operating system. Embedded systems face significant challenges and high costs in upgrading and modifying due to their working environment, location distribution, and integration with application systems. Currently, most embedded system kernels can only be statically extended to a certain extent, meaning that modifying certain kernel attribute values requires recompiling the kernel, which is difficult for ordinary users. Advances in communication have made dynamic extension of embedded operating systems possible, increasing the flexibility and extending the lifespan of embedded systems based on remote control. Furthermore, with the increasingly widespread application of embedded Linux, research on dynamic extension of embedded Linux is of great significance. Dynamic extension refers to upgrading and maintaining the system while it is running. Dynamic extension technology is currently widely used in various fields of software system development. Components, scalable database systems, active networks, and other technologies are all concrete manifestations of dynamic extension technology in various fields. In the field of embedded operating systems, the main goal of dynamic extension technology research is to achieve extensions of kernel abstraction. Achieving dynamic extensions of the operating system kernel abstraction can improve the system's flexibility and adaptability, enabling the system to provide specific services according to application needs. However, due to the limited hardware resources of embedded systems, researching the dynamic scalability of the embedded Linux system kernel is a significant challenge. This paper mainly discusses dynamic extension technology of kernel abstraction in embedded Linux systems. 1 Analysis of several major dynamic kernel extension technologies Currently, there are four main types of dynamic extension technologies applied to operating systems: microkernel technology, extensible kernel technology, interpreter technology/JOS technology, and kernel download technology/LKM technology [1,2]. These three technologies have been fully applied in different environments of desktop operating systems. Embedded operating systems and their usage environments have different characteristics from desktop operating systems. Their characteristics in terms of performance, address space, required storage space, and low-level access frequency make it necessary to weigh the options when choosing extension technologies. (1) Microkernel technology In a microkernel operating system, the kernel includes some basic kernel functions (such as creating and deleting tasks, task scheduling, memory management, and interrupt handling), and some operating system abstractions and key services (such as file systems and network protocol stacks) run in user space. This greatly reduces the size of the kernel and also greatly facilitates the upgrading, maintenance, and porting of the entire system. The system provides services to applications by calling services from the kernel to the user layer. Since the services exist in the user layer, users can obtain different behaviors by modifying the services, hence it is also called user layer extension technology. Since all applications need to use the APIs or system calls provided by the operating system to complete memory management, process management, I/O, device management, etc., the functions of the Linux operating system can be extended by monitoring and intercepting the system calls of a process in user space and then inserting the extended function code into the system calls. Compared with kernel space function extension, user space extension is more secure and more transparent to the Linux operating system and applications. The disadvantage of user-level extension technology is that raising services to the user level increases the number of switches and traps between kernel mode and user mode during program execution, resulting in increased system load and decreased system performance. In addition, microkernels are structurally completely different from traditional embedded Linux kernels. In embedded Linux, if this technology is used to increase the dynamic extension performance of the system, the kernel structure needs to be redesigned [2]. (2) Extensible kernel technology Extensible kernel technology allows user applications to inject code into the kernel to extend its functions. Since the injected code runs in kernel mode, the problem of system performance degradation in microkernel technology is avoided. The injected code runs in kernel mode and requires a real-time checking mechanism to verify the security of the code and ensure that the injected code does not cause the system to crash. Cheng Buqi et al. [1] used software fault isolation technology to achieve fault isolation of extension modules, ensuring that the system is not damaged by extension modules. Bershad et al. [3] also used software fault isolation technology to limit the range of memory addresses accessible by the implanted code. Code security checks undoubtedly increase the burden on the system. The root cause of the problem is that the implanted extension code is not trustworthy to the kernel. In order to reduce the burden on the system, it is necessary to assume that the implanted code is safe and trustworthy. (3) Interpreter technology/JOS technology is the same as the JOS (Java Operating System) technology mentioned in the literature [2]. This technology allows developers to write system modules in Java, such as TCP/IP protocol stacks or file systems. These modules are compiled into class files and dynamically loaded by the JVM (Java Virtual Machine) at system runtime. Liao et al. [4] proposed in 1996 to insert the JVM into the microkernel, so that users can write Java programs to extend kernel functions. Interpreter technology executes program code in an interpreted manner, which is more suitable for interactive systems. Compared with compilers, interpreters/JVMs are relatively simple to port. Interpreters use intermediate code representation, and when the code length is less than 500 KB, the executable intermediate code is usually smaller than the binary code generated by compilation, which is very suitable for embedded systems with very limited storage space. Finally, Java code is easy to maintain and write, has good portability, and can be reused. The disadvantage of using interpreter technology is that the execution speed of intermediate executable code is slow. In embedded Linux systems, a large part of the kernel is shared by applications, and even the application itself is a thread of the kernel with a high execution frequency. Using interpreter technology will greatly reduce the efficiency of the system. Some Java platforms use just-in-time (JIT) compilation technology to improve the execution speed of code [2]. This technology uses space to trade for time, so it is difficult to implement on embedded systems with very limited hardware resources. In addition, the large size of the Java language class library also hinders its development in resource-limited embedded systems to some extent. (4) Kernel Loading Technology / LKM Technology Many desktop operating systems, such as Linux, provide LKM (Loadable Kernel Module) to dynamically extend their kernels. Once the module is installed into the kernel, it becomes part of the kernel and runs at full speed without real-time security checks. In embedded Linux systems, the main problems with LKM are: the storage module requires additional space and the security of the loaded module. The security of the module can be solved by software protection technology [1]. In 1996, Oikawa et al. proposed a dynamic kernel module (DKMs) technology similar to LKM [5]. Like LKM, DKMs are stored in the form of files and can be dynamically loaded and unloaded during system operation. DKMs are managed by a user-level DKM server, not by the kernel. When the kernel needs a module, the DKM server is responsible for loading the corresponding DKM; when the kernel's memory resources are scarce, the DKM server is responsible for unloading an unused DKM. The disadvantage is that all DKMs are stored on the local system, occupying a lot of valuable storage space. Unlike Oikawa's method, Chang DaWei et al. proposed the Operating System Portal framework (OSP) method in 2003 [2]. This method stores the core module on a resource-rich remote server and manages the stored modules by the server-side tool OS Portal. It is also responsible for handling the requests issued by the client (embedded system kernel), dynamically selecting and connecting modules according to the requests, and then transmitting them to the client via the network. Since the management and connection of the modules are all on the server side, a lot of resource space can be saved for the client. The structure of OS Portal is shown in Figure 1. The structure of OS Portal is usually that when the kernel dynamically loads the module, the module connection work is completed by the kernel. The unique feature of Chang DaWei's method is that it hands over the module connection work to the server side, which not only reduces the demand for memory space, but also reduces the burden on the kernel. 2 Other related research (1) FPGA-based dynamically configurable system-on-a-chip FPGA (Field Programmable Gate Array) is one of the most dynamic and promising technologies in the field of electronic design. FPGA can perform the functions of any digital device, from high-performance CPUs to simple 74 circuits. FPGA is increasingly widely used in embedded systems. John Williams and Neil Bergmann[6] used uCLinux as the operating system platform to design a dynamically configurable system-on-a-chip (rSoC). uCLinux downloads FPGA program code from a remote server and then uses shell script tools to write the code into the FPGA chip to realize the dynamic expansion of system functions. (2) Method of dynamically updating Linux kernel variables When developing Linux kernel embedded systems, the method of reading the contents of static configuration files during kernel startup is often used to initialize certain kernel variables. When the static configuration file is modified, only restarting the kernel can make the new configuration take effect. Tian Yufeng et al. of Beijing University of Science and Technology[7] modified the file ./include/linux/proc_fs.h, recompiled and installed the new kernel, and used the /proc file system to dynamically change Linux kernel variables. (3) Method of extending Linux operating system functions in user space Compared with kernel space function extension, extending in user space is more secure and more transparent to Linux operating system and applications. Wei Donglin, Lu Zhengding et al. extended the operating system functions by tracking and intercepting system calls in user space and changing the behavior of system calls[8]. Essentially, this method is the same as the scalable kernel technology mentioned in Part 1 of this paper. 3 Challenges and development trends of dynamic expansion technology (1) High real-time performance is a basic requirement of embedded systems. Since Linux is a general-purpose operating system, not a true real-time operating system, the kernel does not support event priority and preemptive real-time features (the Linux 2.6 kernel, released at the end of 2003, implemented a certain degree of preemption). Therefore, when conducting research and development on the dynamic expansion of embedded Linux systems, the primary issue is to expand the real-time performance of Linux. If the expansion process takes too long, it will definitely affect the real-time response of the system. Therefore, the expansion process is required to be completed quickly, such as the kernel expansion mechanism based on LKM. If the module loading or replacement takes too long and cannot be completed within the specified time, this is unacceptable for some applications of embedded Linux. (2) Limited resources are a basic characteristic of embedded systems. Embedded systems have no redundant software or hardware memory. Increasing storage space means an increase in cost. Achieving rapid dynamic kernel expansion in a very limited storage space is a great challenge for researchers. In the desktop PC world, although there are many methods for dynamically expanding system functions, it is difficult to achieve in the embedded world. For example, the LKM mechanism of the Linux system cannot be used in the embedded Linux system if the module loading process is not modified. (3) Expectation of a perfect integrated development environment A complete integrated development environment for an embedded system generally requires a compiler/linker, a kernel debugger/tracer and an integrated graphical interface development platform. The integrated graphical interface development platform includes an editor, a debugger, a software simulator and a monitor. In the Linux system, there is a powerful gcc compiler toolchain, and the remote debugging function of the GNU-based debugger gdb is used. Generally, a client machine runs the debugging program to debug the operating system kernel running on the host machine. When using remote development, a cross-platform approach can also be used, such as debugging the Linux host system using a debugger tracer on the Windows platform. However, Linux still lags behind the Windows operating system in the research of specific system customization platforms based on graphical interfaces. Therefore, in order to make the research on dynamic expansion of embedded Linux more convenient and faster, the overall integrated development environment still needs to be improved and perfected. Desktop Linux has successfully implemented the dynamic expansion of system functions using LKM technology. Embedded Linux inherits most of the functions and features of desktop Linux. The inherent LKM mechanism of desktop Linux brings an innate advantage to the research on dynamic extension of embedded Linux, which can greatly save researchers' time and energy. There has also been great development in dynamic module replacement. Chris Walton et al. [9] improved the two-space copy garbage collection algorithm and proposed an abstract machine model for dynamic module replacement in 2000. Dynamic extension technology based on JOS is a major development direction. Java code is highly portable and easy to maintain, and has great potential for development in embedded systems. Another advantage of using Java technology is that it can achieve code reuse, so that you don't have to start from scratch every time you develop an embedded system. Many research results have also promoted the application of Java in embedded systems. Derek Rayside et al. proposed a class library subset selection method in 2002 [10]. This method allows Java programs in embedded systems to select only the required subset from remote Java class libraries at runtime and then download it to the local system, thereby reducing the storage space requirements of the embedded system and solving the problem that the large size of the Java language class library hinders its application in embedded systems. Conclusion With the rapid development of embedded Linux and the widespread adoption of embedded Linux devices, the demand for dynamically expandable embedded Linux is becoming increasingly urgent. Currently, several major technologies for dynamically expanding system functionality, such as microkernel technology, JOS technology, and LKM technology, are insufficient when applied to embedded Linux systems due to the limited storage space and high real-time requirements of embedded systems. Among these, the inherent LKM mechanism of desktop Linux provides a natural advantage for research on dynamic expansion of embedded Linux. Furthermore, Java code's strong portability and ease of maintenance make it very promising for embedded systems; therefore, dynamic expansion technology based on JOS is another major development direction. Finally, a complete embedded Linux integrated development environment is what every developer desires.