CN112328319A - Satellite-borne APP dynamic loading method supporting RAM file system - Google Patents

Satellite-borne APP dynamic loading method supporting RAM file system Download PDF

Info

Publication number
CN112328319A
CN112328319A CN202011063640.9A CN202011063640A CN112328319A CN 112328319 A CN112328319 A CN 112328319A CN 202011063640 A CN202011063640 A CN 202011063640A CN 112328319 A CN112328319 A CN 112328319A
Authority
CN
China
Prior art keywords
satellite
elf file
file
elf
borne
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011063640.9A
Other languages
Chinese (zh)
Inventor
詹盼盼
郭坚
齐征
何熊文
刘欣
张红军
汪路元
徐勇
佟玲
曹雅婷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Institute of Spacecraft System Engineering
Original Assignee
Beijing Institute of Spacecraft System Engineering
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Institute of Spacecraft System Engineering filed Critical Beijing Institute of Spacecraft System Engineering
Priority to CN202011063640.9A priority Critical patent/CN112328319A/en
Publication of CN112328319A publication Critical patent/CN112328319A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Abstract

The invention relates to a satellite-borne APP dynamic loading method supporting an RAM file system, which comprises the following steps: the method comprises the following steps: compiling and linking the satellite-borne APP to generate an executable file in an ELF format; step two: injecting the ELF file generated in the step one into a satellite borne computer and storing the ELF file into an RAM in the satellite borne computer, and keeping the format of the ELF file unchanged; step three: analyzing and converting an ELF file layout; step four: allocating a memory, and copying code segments and data segments of the target ELF file into the memory of the spaceborne computer; step five: calculating a relocation address; step six: executing relocation; step seven: and acquiring an entry of the executable program from the ELF file header, executing the function and running the APP. The method can realize the dynamic loading and running functions of the satellite in-orbit application software under the condition of not changing the hardware configuration of the current satellite-borne computer, so that the upgrading or the new function of the satellite function is more convenient.

Description

Satellite-borne APP dynamic loading method supporting RAM file system
Technical Field
The invention relates to the technical field of space computers, in particular to a dynamic loading method of a satellite-borne APP supporting a RAM file system.
Background
At present, satellite-borne application software is difficult to expand and change, and the expansion of a satellite after in-orbit operation is difficult, so that the functions are fixed, and the flexibility is poor. The existing method adopts a mode of on-track maintenance of part or all software after recompiling all software, so that the application software is difficult to change and the function is difficult to expand. The following disadvantages are mainly present:
(1) the service is single and difficult to expand. Most of the existing satellite-borne application software only realizes specific services and functions, and the satellite is difficult to expand and reuse after in-orbit operation, so that the functions are fixed and the flexibility is poor;
(2) single person development and limited functions. Most of the development modes are developed by one person or a few persons, the dependence degree of interfaces is high, the development function is limited, the multi-person multi-department collaborative development is difficult to achieve, and the efficiency is low;
(3) the compatibility is poor. Different satellite devices are difficult to be compatible, even in the same satellite, software is developed by different units and only serves the sub-system, and resource sharing is difficult to realize.
Therefore, a dynamic satellite-borne APP loading method supporting a RAM file system needs to be researched, and the method can inject an executable file into a satellite-borne RAM without changing the hardware configuration of the current satellite-borne computer, and then load the executable file into the system and operate the system, so that the dynamic loading and operation functions of satellite in-orbit application software are realized, and the upgrading or new function of the satellite function is more convenient.
By the method, dynamic expansion capability and flexible updating of on-orbit application of satellite application are realized, and constantly changing application requirements are met. Meanwhile, the development mode of the satellite software is changed: the function of the satellite-borne general software is independent to form a basic platform, special APP software is developed for specific satellite application, the multiplexing granularity of the satellite-borne software is improved, the software development efficiency is further improved, and multi-user and multi-department collaborative development is favorably realized.
Disclosure of Invention
In view of the above, the invention provides a dynamic satellite-borne APP loading method supporting a RAM file system, which solves the problems of single function and poor expansibility of a satellite-borne application by injecting an APP into a satellite-borne RAM and dynamically loading and operating, and realizes multi-user and multi-department collaborative development and satellite software function reconstruction.
The method comprises the following steps:
the method comprises the following steps: compiling and linking the satellite-borne APP to generate an executable file in an ELF format;
step two: injecting the ELF file generated in the step one into a satellite borne computer and storing the ELF file into an RAM in the satellite borne computer, and keeping the format of the ELF file unchanged;
step three: analyzing and converting an ELF file layout;
step four: allocating a memory, and copying code segments and data segments of the target ELF file into the memory of the spaceborne computer;
step five: calculating a relocation address;
step six: executing relocation;
step seven: and acquiring an entry of an executable program from the ELF file header, executing a function, and running the APP.
Further, the third step includes the following steps:
(1) reading an ELF file header, verifying the ELF file by using the ELF file header, and then acquiring offsets of a program header table and a segment header table in the ELF file;
(2) and loading each segment in the ELF file into a memory according to the content of each entry in the program header table.
Further, the fourth step includes the following steps:
(1) reading a program header table and a section header table, analyzing the offset and the size of a code section and a data section in an ELF file, and allocating memory address spaces for the code section and the data section;
(2) and executing file reading, and copying the code segment and the data segment of the target ELF file into a memory.
Further, the fifth step includes the following steps:
(1) reading a base address from an ELF file, wherein the base address is an address to which an APP program is expected to be loaded;
(2) and calculating the difference between the actual loading address of the APP and the base address in the ELF file.
Further, the sixth step includes the following steps:
(1) traversing the section header table, finding the section of the SHT _ RELA type, traversing each relocation entry in the section and reading;
(2) for each relocation entry, finding a symbol address in a corresponding symbol table according to the type of the relocation entry, and adding the difference value to serve as a target address;
(3) the address portion of the machine instruction is modified to enable the program to properly access the desired function or variable.
Compared with the prior art, the invention has the following beneficial effects:
(1) the method realizes the reconstruction of the satellite function, improves the expansibility of the satellite function, and realizes different application modes by loading different application software, so that the flexibility and the intellectualization of the satellite are greatly improved;
(2) certain changes are brought to the satellite software development mode: the satellite-borne general software functions are separated to form a basic platform, special APP software is developed aiming at specific satellite applications, the multiplexing granularity of the satellite-borne software is improved, and the software development efficiency is further improved; one satellite-borne computer supports the operation of a plurality of satellite-borne application software, and is beneficial to realizing multi-person and multi-department collaborative development; the requirement of explosive growth of space software tasks is met;
(3) the satellite resources can be transmitted in advance or quickly in the future through a unified software dynamic reconstruction platform, and the effective load function of the satellite platform is realized through injecting application software on the ground after the satellite enters the orbit.
Drawings
Fig. 1 is a process diagram of a dynamic loading method of a satellite-borne APP supporting a RAM file system according to an embodiment of the present invention.
Fig. 2 is a schematic diagram of the format of an ELF file.
Detailed Description
The invention is described in detail below by way of example with reference to the accompanying drawings.
As shown in fig. 1, the present invention provides a dynamic loading method of a satellite-borne APP supporting a RAM file system, which comprises the following steps:
the method comprises the following steps: compiling and linking the satellite-borne APP to generate an executable file in an ELF format; the format of the ELF file is shown in fig. 2, and the components, contents and uses of the ELF file are shown in table 1:
TABLE 1
Figure BDA0002713102870000031
Wherein the ELF file header is defined as follows:
Figure BDA0002713102870000032
Figure BDA0002713102870000041
the ELF file describes two aspects of information: the layout of the application data in the disk and the layout of the application in the memory under the running state. The disk layout is the structure of the ELF file, and the loading process of the executable program is the process of reading and analyzing the ELF file, converting the disk layout of the ELF file into the layout in the memory during running and establishing the memory layout according to the content of the file.
Step two: and injecting the ELF file generated in the step one into a satellite borne computer and storing the ELF file into an RAM in the satellite borne computer, and keeping the format of the ELF file unchanged.
Step three: analyzing and converting an ELF file layout; firstly reading an ELF file header, checking the ELF file by using the ELF file header, then acquiring offsets of a program header table and a section header table in the ELF file, wherein the offsets are e _ phoff and e _ shoff respectively, and finding the program header table and the section header table according to the two offsets. And then loading each segment in the ELF file into a memory according to the content of each entry in the program header table.
Step four: allocating a memory, and copying code segments and data segments of the target ELF file into the memory of the spaceborne computer; reading the program header table and the section header table, analyzing the offset and the size of the code section and the data section in the ELF file, then allocating memory address space for the code section and the data section, executing file reading, and copying the code section and the data section of the target ELF file into a memory.
Step five: calculating a relocation address; reading a base address from the ELF file, wherein the base address is the address to which the APP program wants to load, calculating the difference between the actual load address of the APP and the base address in the ELF file, and using the difference to relocate the ELF file.
Step six: executing relocation; in ELF files, functions such as function calls, variable accesses, etc. require the use of addresses for functions and variables, which are encoded in machine instructions in different ways. In the ELF file, the relocation information is stored in a special section, the type of the section is SHT _ RELA, the section header table is traversed, the section of the SHT _ RELA type is found, and each relocation entry in the section is traversed and read. For each relocation entry, according to the type of the relocation entry, finding the symbol address in the corresponding symbol table, adding the difference value to serve as a target address, and then modifying the address part in the machine instruction to enable the program to correctly access the required function or variable.
Step seven: and acquiring an entry of an executable program from the ELF file header, executing the function, and running the APP software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (5)

1. A dynamic loading method of satellite-borne APP supporting a RAM file system is characterized by comprising the following steps:
the method comprises the following steps: compiling and linking the satellite-borne APP to generate an executable file in an ELF format;
step two: injecting the ELF file generated in the step one into a satellite borne computer and storing the ELF file into an RAM in the satellite borne computer, and keeping the format of the ELF file unchanged;
step three: analyzing and converting an ELF file layout;
step four: allocating a memory, and copying code segments and data segments of the target ELF file into the memory of the spaceborne computer;
step five: calculating a relocation address;
step six: executing relocation;
step seven: and acquiring an entry of an executable program from the ELF file header, executing a function, and running the APP.
2. The method of claim 1, wherein: the third step comprises the following steps:
(1) reading an ELF file header, verifying the ELF file by using the ELF file header, and then acquiring offsets of a program header table and a segment header table in the ELF file;
(2) and loading each segment in the ELF file into a memory according to the content of each entry in the program header table.
3. The method of claim 2, wherein: the fourth step comprises the following steps:
(1) reading a program header table and a section header table, analyzing the offset and the size of a code section and a data section in an ELF file, and allocating memory address spaces for the code section and the data section;
(2) and executing file reading, and copying the code segment and the data segment of the target ELF file into a memory.
4. The method of claim 3, wherein: the fifth step comprises the following steps:
(1) reading a base address from an ELF file, wherein the base address is an address to which an APP program is expected to be loaded;
(2) and calculating the difference between the actual loading address of the APP and the base address in the ELF file.
5. The method of claim 4, wherein: the sixth step comprises the following steps:
(1) traversing the section header table, finding the section of the SHT _ RELA type, traversing each relocation entry in the section and reading;
(2) for each relocation entry, finding a symbol address in a corresponding symbol table according to the type of the relocation entry, and adding the difference value to serve as a target address;
(3) the address portion of the machine instruction is modified to enable the program to properly access the desired function or variable.
CN202011063640.9A 2020-09-30 2020-09-30 Satellite-borne APP dynamic loading method supporting RAM file system Pending CN112328319A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011063640.9A CN112328319A (en) 2020-09-30 2020-09-30 Satellite-borne APP dynamic loading method supporting RAM file system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011063640.9A CN112328319A (en) 2020-09-30 2020-09-30 Satellite-borne APP dynamic loading method supporting RAM file system

Publications (1)

Publication Number Publication Date
CN112328319A true CN112328319A (en) 2021-02-05

Family

ID=74314435

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011063640.9A Pending CN112328319A (en) 2020-09-30 2020-09-30 Satellite-borne APP dynamic loading method supporting RAM file system

Country Status (1)

Country Link
CN (1) CN112328319A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113312114A (en) * 2021-06-29 2021-08-27 北京微纳星空科技有限公司 On-orbit reconstruction method, device, equipment and storage medium of satellite-borne software
CN113672238A (en) * 2021-09-07 2021-11-19 广东九联科技股份有限公司 Operation method, device and equipment based on real-time operating system modular management
CN115495158A (en) * 2022-10-09 2022-12-20 电子科技大学 Dynamic construction method of system service in microkernel operating system
CN116909656A (en) * 2023-09-14 2023-10-20 北京中天星控科技开发有限公司 Method for realizing embedded dynamic APP loading based on elf file

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107729085A (en) * 2017-10-19 2018-02-23 北京空间飞行器总体设计部 A kind of On-board software dynamic loading method for supporting address to redirect
CN111124550A (en) * 2020-03-26 2020-05-08 北京翼辉信息技术有限公司 Program dynamic loading method and device and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107729085A (en) * 2017-10-19 2018-02-23 北京空间飞行器总体设计部 A kind of On-board software dynamic loading method for supporting address to redirect
CN111124550A (en) * 2020-03-26 2020-05-08 北京翼辉信息技术有限公司 Program dynamic loading method and device and storage medium

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113312114A (en) * 2021-06-29 2021-08-27 北京微纳星空科技有限公司 On-orbit reconstruction method, device, equipment and storage medium of satellite-borne software
CN113312114B (en) * 2021-06-29 2022-04-12 北京微纳星空科技有限公司 On-orbit reconstruction method, device, equipment and storage medium of satellite-borne software
CN113672238A (en) * 2021-09-07 2021-11-19 广东九联科技股份有限公司 Operation method, device and equipment based on real-time operating system modular management
CN113672238B (en) * 2021-09-07 2024-03-12 广东九联开鸿科技发展有限公司 Operation method, device and equipment based on real-time operating system modularized management
CN115495158A (en) * 2022-10-09 2022-12-20 电子科技大学 Dynamic construction method of system service in microkernel operating system
CN115495158B (en) * 2022-10-09 2023-08-08 电子科技大学 Dynamic construction method for system service in microkernel operating system
CN116909656A (en) * 2023-09-14 2023-10-20 北京中天星控科技开发有限公司 Method for realizing embedded dynamic APP loading based on elf file
CN116909656B (en) * 2023-09-14 2023-12-08 北京中天星控科技开发有限公司 Method for realizing embedded dynamic APP loading based on elf file

Similar Documents

Publication Publication Date Title
CN112328319A (en) Satellite-borne APP dynamic loading method supporting RAM file system
US7203941B2 (en) Associating a native resource with an application
JP5139987B2 (en) Extensible metadata
US8566372B2 (en) Method and device for dynamically loading relocatable file
KR100518584B1 (en) Shared library system and method for constructing the system
CN101661486B (en) Method and system for fragment sorting for hard disk of host comprising virtual computer
US8627316B2 (en) Mobile communications device application processing system
CN106850650B (en) Method for accessing data by game client and client game system
CN110673856A (en) Data processing method and device and machine-readable storage medium
CN102298518A (en) Translation of technology-agnostic management commands into multiple management protocols
US6959430B2 (en) Specialized heaps for creation of objects in object-oriented environments
US20040015855A1 (en) Frameworks for accessing Java class files
CN1354853A (en) Method for linking on chip card program modules swapped in working memory of processor
US6754796B2 (en) Frameworks for implementation of java heaps
US6901591B1 (en) Frameworks for invoking methods in virtual machines
CN111344667B (en) System and method for compiling and executing code within virtual memory sub-pages of one or more virtual memory pages
CN115700470A (en) File loading processing method and device, computer storage medium and electronic equipment
US7685565B1 (en) Run time reconfiguration of computer instructions
US20030028865A1 (en) Two tier clusters for representation of objects in java programming environments
CN113791870B (en) WebAssemble virtual machine distributed system fine granularity migration method and system
CN101126988A (en) Class file loading method and system
KR101140522B1 (en) System and Method for Managing Object
US6934726B2 (en) Storing and retrieving of field descriptors in Java computing environments
CN112596734A (en) Static library generation method and device
Stanek et al. Online software maintenance for mission-critical systems

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination