Dynamic module loading technology in Embedded Systems

Source: Internet
Author: User
Module dynamic loading technology in embedded systems-general Linux technology-Linux programming and kernel information. For details, see the following. Summary

A module dynamic loading technology is proposed for embedded systems. The design and implementation are simple, the resource usage is small, the overhead is small, and it is successfully applied to DeltaOS. this improves system flexibility and scalability. introduce the Principles and Application of loading and Dynamic Links, explain related terms, and describe basic design ideas: Describe the core of the technology in detail. That is, the module declaration, the calling database, and the two-level relocation table. Finally, the conclusion is given.

   Introduction

With the rapid development of electronic technology, embedded devices become more and more widely used and more complex. As a result, the proportion of hardware and software design has greatly changed, and the proportion of software development is growing. However, in the traditional embedded development process, the application and operating system compilation links need to be integrated and then downloaded to the target machine for running. If a problem is found during the debugging process, you need to re-compile the link and repeat the download and running process. Such a development process is long and cumbersome, and is increasingly unable to meet the needs of rapid marketization.

In order to adapt to a variety of embedded applications and accelerate the development process of embedded systems, in addition to the support of reliable basic platform software, for example, RTOS with file systems and network protocol stacks and supporting integrated development environments, more importantly, a system platform that can be dynamically expanded is required. In recent years, a new generation of embedded operating systems have begun to use dynamic expansion technology: separating basic systems (including operating systems and other shared function call libraries) from application development, supports module update and dynamic loading. Many mainstream traditional embedded operating system manufacturers, such as windRiver, Green HilIs, and Lynxworks, have released high-reliability and high-performance RTOS versions for aerospace and basic communication devices, supports dynamic loading and updating of applications and system components. In the consumer electronics field, related operating system vendors, such as symbian, Palm, Microsoft, it has also launched an operating system with corresponding functions and has been widely applied to the next generation of mobile devices.

To become a dynamically scalable system platform, most embedded operating systems need dynamic loading technology. In general, dynamic loading means that an application or system needs to use services of a certain module during operation. Therefore, a specified module is loaded into the system through a series of predefined actions, let the caller continue to work smoothly. The key to its implementation is the loading and dynamic link technology. Since loading and dynamic links are mutually dependent and closely related, the two are put together for discussion.

   1. Load and Dynamic Link Mechanism

Loading is mainly responsible for moving module programs from a second-level storage device (such as a hard disk or Flash) to a specified memory space, and the module is handed over to the system loader for unified management.

Program links include static links, loading links, and runtime links. The static link links the program to all the libraries required for running it into an execution file. It can run independently and quickly, but the size of the code generated by its link is relatively large. The link during loading means that the program does not link the library it uses to the execution program during link compilation, but parses the execution file only when it is loaded by the loader, load the database to the system in sequence for running. Its advantage is that the amount of code in the program itself is reduced, but the memory occupied by the program during runtime is not reduced, and the workload of the loader is increased. Dynamic Link is a further development of the link during loading. It refers to the delay in the Library Loading Process to the execution of the program running. In this way, no additional code is introduced to the program, and the overhead of the loader is not increased. The Library is loaded only when the application actually uses a database, reducing unnecessary space usage. Its disadvantage is that there may be some running overhead.

Dynamic Loading in embedded systems is similar to the concept of common dynamic links, but the loading linker in embedded systems has its own characteristics: it is a cross-loading, and the host side does some work, for example, the program is relocated and the execution file is parsed. the target machine is relatively simple, mainly for module search and positioning and space allocation, as well as specifying physical addresses or ing virtual addresses for running. Some embedded systems do not support virtual memory, applications, and Kernel shared storage space. When the system loads multiple applications to the system, overlap technology is generally used to solve the problem of limited memory space, that is, when the running address space of multiple applications conflicts, the loader will freeze applications that are currently not running, so that the newly loaded applications can use the specified address space. PairnOS adopts this design. For embedded systems that support virtual memory, the workload of the loader is greatly simplified, and each application can run in the same virtual space, the loader does not need to be relocated for it or the overlap technology is used, thus improving the work efficiency. Vxworks6.O and WinCE both use this design. The two methods are widely used in different fields.

The module dynamic loading technology proposed in this paper is a 32-bit embedded operating system that supports MMU (Memory Management Unit) and uses the loading and dynamic link technology. The embedded system built using this technology is oriented to the high-end market, especially in the fields with high requirements on system reliability and security. In the R & D process of DeltaOS's next-generation High-reliability version HAR (High Available Reliable system), we have successfully implemented the load loader LambdaLoader based on this design, meeting the expected performance requirements.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.