CN110990018B - Compiling method and compiling system of embedded system - Google Patents

Compiling method and compiling system of embedded system Download PDF

Info

Publication number
CN110990018B
CN110990018B CN201911039090.4A CN201911039090A CN110990018B CN 110990018 B CN110990018 B CN 110990018B CN 201911039090 A CN201911039090 A CN 201911039090A CN 110990018 B CN110990018 B CN 110990018B
Authority
CN
China
Prior art keywords
interface
address table
operating system
interface address
address
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.)
Active
Application number
CN201911039090.4A
Other languages
Chinese (zh)
Other versions
CN110990018A (en
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.)
CRSC Research and Design Institute Group Co Ltd
Original Assignee
CRSC Research and Design Institute Group Co Ltd
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 CRSC Research and Design Institute Group Co Ltd filed Critical CRSC Research and Design Institute Group Co Ltd
Priority to CN201911039090.4A priority Critical patent/CN110990018B/en
Publication of CN110990018A publication Critical patent/CN110990018A/en
Application granted granted Critical
Publication of CN110990018B publication Critical patent/CN110990018B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a compiling and deploying method, a compiling method and a compiling system of an embedded system, relating to the field of embedded systems, wherein the deploying method comprises the steps of storing a first interface address table into an operating system memory, and storing a first group of interfaces into the first interface address table according to indexes; storing a second interface address table into an application program memory, and storing a second group of interfaces into the second interface address table according to indexes; and the operating system and the application program realize access through the first interface address table or the second interface address table. The application program can be compiled without depending on the operating system, and under the condition that the interface is not changed, the operating system is modified without recompiling the application program. The embedded system realizes the mutual access between the operating system and the application software without the Lai Dongtai library and the static library.

Description

Compiling method and compiling system of embedded system
Technical Field
The invention belongs to the field of embedded systems, and particularly relates to a compiling deployment method, a compiling method and a compiling system of an embedded system.
Background
Embedded systems (Embedded systems), which are control, monitoring or auxiliary devices, machines or devices used for plant operations, are "special purpose computer systems designed for specific applications that are fully Embedded inside controlled devices.
In the current embedded system, the operating system (including the BSP) and the application program share the same memory space, so that the operating system and the application program are finally compiled and linked together to form an executable program, and the executable program is deployed to a hardware device to run.
The problem with the existing method is that the operating system (including the BSP) and the application program are developed and maintained by different departments, respectively, the application program is dependent on the operating system, and once the operating system is modified and reissued, the application program must be recompiled using a new library. When multiple application programs exist, a user can have a large amount of repeated compiling work due to upgrading of an operating system, and the compiling work corresponds to repeated version release.
Disclosure of Invention
In view of the above problems, the present invention provides a compiling deployment method, a compiling method and a compiling system for an embedded system.
A first aspect provides a compiling deployment method for an embedded system, where the deployment method includes:
storing a first interface address table into an operating system memory, and storing a first group of interfaces into the first interface address table according to an index;
storing a second interface address table into an application program memory, and storing a second group of interfaces into the second interface address table according to indexes;
and the operating system and the application program realize access through the first interface address table or the second interface address table.
Further, when an interface function is newly added, a new interface function address is added at the end of the interface address table.
Further, when the interface function is deleted, a value of 0 is set at the position where the address of the interface function is deleted.
A second aspect provides a compiling method for an embedded system, the compiling method including:
the operating system provides a first interface address table, and the first interface address table provides a first group of interfaces;
the application program obtains the actual address of the interface function of the operating system based on the address of the first interface address table in the operating system and the offset of the interface function of the operating system in the first interface address table, and then forcibly converts the actual address of the function into the address of the interface function for access.
Further, the compiling method comprises the following steps:
the application program provides a second interface address table, and the second interface address table provides a second group of interfaces;
and the operating system executes the application executable file of the corresponding interface address through the second interface address table.
Further, the compiling method: before accessing the interface function through the interface address table, judging whether the address of the interface function is effective.
A third aspect provides a compiling system of an embedded system, the compiling system including:
the interface address table comprises a first interface address table and a second interface address table, wherein the first interface address table is stored in an operating system memory, and the second interface address table is stored in an application program memory;
the interface function address comprises a first interface address table and a second interface address table, the first group of interfaces are stored in the first interface address table according to indexes, and the second group of interfaces are stored in the second interface address table according to indexes;
and the operating system and the application program realize access through the first interface address table or the second interface address table.
Further, when an interface function is newly added, a new interface function address is added at the end of the interface address table.
The compiling system according to claim 7 or 8 wherein when the interface function is deleted, a value of 0 is set at a position where the address of the interface function is deleted.
The invention provides a compiling and deploying method, a compiling method and a compiling system of an embedded system. The application program can be compiled without depending on the operating system, and under the condition that the interface is not changed, the operating system is modified without recompiling the application program. The embedded system realizes the mutual access between the operating system and the application software without the Lai Dongtai library and the static library.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 illustrates a compilation system according to the prior art;
FIG. 2 illustrates an interface address table according to an embodiment of the invention;
FIG. 3 is a diagram illustrating a compilation method according to an embodiment of the present invention;
FIG. 4 shows a compilation system diagram according to an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The operating system provided by the embodiment of the present invention may also be a BSP, where the BSP is a layer of a board-level support packet between the motherboard hardware and a driver layer program in the operating system, and generally considered as a part of the operating system, and mainly implements support for the operating system, and provides a function packet for accessing a hardware device register for a driver program in an upper layer, so that the BSP can better run on the hardware motherboard. In the composition of the embedded system software, there is a BSP. The BSP is relative to an operating system, different operating systems correspond to BSPs in different definition forms, for example, the BSP of VxWorks and the BSP of Linux are completely different from a certain CPU in writing method and interface definition although the functions are the same, so the programming process of writing the BSP according to the definition form of the BSP of the system is mostly modified on a certain molded BSP template. The current embedded system includes an operating system or BSP, and an application program, which are generally developed and maintained by different parts, respectively, and finally generates an executable file. As shown in fig. 1, the executable file must be recompiled when any of the operating system (BSP) and the application program changes. The operating system and the BSP belong to the underlying basic software, so that the operating system and the BSP can be used on various devices, namely, a plurality of application programs use the basic software, and therefore, once the operating system or the BSP is modified, all the application programs on the upper layer are recompiled and redistributed.
Therefore, embodiments of the present invention provide a compiling deployment method, a compiling method, and a compiling system for an embedded system, which can ensure that an operating system (including a BSP) and an application program can be compiled and deployed independently, and when the operating system (including the BSP) is modified, an application may not need to be recompiled and reissued as long as an interface between the operating system and the application is not changed.
In a first aspect, an embodiment of the present invention provides a compiling and deploying method for an embedded system, where the deploying method includes:
the first interface address table is stored in an operating system memory, and the first group of interfaces are stored in the first interface address table according to indexes, namely, in an address table, the addresses of a group of functions are stored. Wherein the system interface function is located in the first set of interfaces. Specifically, as shown in fig. 2, the first group of interfaces may be multiple, and the multiple first group of interfaces are sequentially stored in the first interface address table for easy indexing, where different first group of interfaces have different system interface functions;
storing a second interface address table into an application program memory, and storing a second group of interfaces into the second interface address table according to an index, wherein an application interface function is located in the second group of interfaces, specifically, the second group of interfaces may be multiple, and the multiple second group of interfaces are stored in the second interface address table in sequence, so as to facilitate indexing, wherein different second group of interfaces have different application interface functions;
the operating system and the application program realize access through the first interface address table or the second interface address table, as shown in fig. 3, that is, direct access between the operating system (including BSP) and the application program realizes mutual access between the operating system (including BSP) and the application software.
After deployment based on the method, the compiling process is that the application program obtains the actual address of the first interface function of the operating system according to the address of the first interface address table in the operating system and the offset of the first group of interfaces in the address table, and then the actual address of the first interface function is forcibly converted into the address of the interface function for access, and at the moment, the compiling application program does not need to use an operating system static library.
Similarly, the application program can also obtain the BSP interface address through the BSP interface address table and directly access the BSP interface address, and a BSP static library is not needed during compiling.
Therefore, the application program can be compiled without depending on the operating system and the BSP, and under the condition that the interface is not changed, the operating system is modified without recompiling the application program.
The embedded system realizes the mutual access between the operating system and the application software without the Lai Dongtai library and the static library.
In specific implementation, for example, a program is developed by being divided into A, B parts, so that if the part A modifies the program, the part B can be not modified and recompiled as long as the interface between the two parts is not changed. And after the release, if any one of the interfaces is modified, the other party can not be modified under the condition of not changing the interface, thereby reducing the flow of the reissue.
In one embodiment, when an interface function is newly added, a new interface function address is added at the end of an interface address table; specifically, a first group of interfaces in a first interface address table are stored in sequence; when a first interface function is newly added, a first group of interfaces is required to be newly added, and the newly added first group of interfaces is added at the tail of the first interface address table.
In one embodiment, when the interface function is deleted, a value of 0 is set at the position of the address of the deleted interface function,
to ensure forward version compatibility. Specifically, when the first interface function is deleted, in order to ensure forward version compatibility, a value of 0 is set at the position of the first group of interfaces of the deleted first interface function.
In the specific implementation process of the above embodiment, as shown in fig. 2, the interface 1 address, the interface 2 address, and the interface 3 address are sequentially distributed from bottom to top in the drawing, and may be distributed to the interface N address as needed, where the address close to the interface 1 is a start position of the interface table, and a corresponding end far from the interface 1 address is an end of the interface address table. When an interface needs to be added, a new interface function address is added at one end far away from the interface 1 address. When the interface function needs to be deleted, if the interface function in the interface 3 address needs to be deleted, after the interface function in the interface 3 address is deleted, a 0 value needs to be set at the interface 3 address position.
In a second aspect, an embodiment of the present invention further provides a compiling method for an embedded system, where the compiling method includes:
the operating system provides a first interface address table, wherein the first interface address table provides a first group of interfaces;
the application program is based on the address of a first interface address table in the operating system and the offset of the first group of interfaces in the first interface address table; specifically, the interface address table stores a group of function addresses, the functions are stored in sequence, the address of a certain function is to be obtained, that is, from the initial address of the address table, according to the sequence position of the function in the address table, a corresponding function address is found, for example, 32 bits are found, each function address occupies 4Bytes, if the function is the 3 rd function, the corresponding function address is stored at the position shifted by 11 Bytes;
the method comprises the steps of obtaining a real address of a first interface function of an operating system, and then forcibly converting the real address of the first interface function into an interface function address for access.
Specifically, the application program may also obtain the BSP interface address through the BSP interface address table and directly access the BSP interface address.
The embodiment can ensure that the operating system (including the BSP) and the application program can be compiled and deployed independently, and when the operating system (including the BSP) is modified, the application can be compiled and released again as long as the interface between the operating system and the application is not changed. The method can compile the application program without using the static library of the operating system and the BSP static library.
In one embodiment, as shown in fig. 3, the compiling method includes:
the application program provides a second interface address table, and the second interface address table provides a second group of interfaces;
and the operating system executes the application executable file of the corresponding interface address through the second interface address table.
The embedded system realizes mutual access between the operating system and the application software without the Lai Dongtai library and the static library.
In one embodiment, the compilation method: before accessing the interface function through the interface address table, judging whether the address of the interface function is effective. If the information is invalid, no access is performed, and the compiling efficiency is improved.
In a third aspect, an embodiment of the present invention further provides a compiling system of an embedded system, where, as shown in fig. 2 and 4, the compiling system includes an interface address table and an interface function address, the interface address table includes a first interface address table and a second interface address table, the first interface address table is stored in an operating system memory, and the second interface address table is stored in an application program memory;
the interface function address comprises a first interface address table and a second interface address table, the first group of interfaces are stored in the first interface address table according to the index, and the second group of interfaces are stored in the second interface address table according to the index;
and the operating system and the application program realize access through the first interface address table or the second interface address table.
The compiling process of the compiling system is that the application program obtains the actual address of the first interface function of the operating system according to the address of the first interface address table in the operating system and the offset of the first group of interfaces in the address table, and then the actual address of the first interface function is forcibly converted into the address of the interface function for access, and at the moment, the compiling application program does not need to use an operating system static library.
Similarly, the application program can also obtain the BSP interface address through the BSP interface address table and directly access the BSP interface address, and a BSP static library is not needed during compiling.
Therefore, the application program can be compiled without depending on the operating system and the BSP, and under the condition that the interface is not changed, the operating system is modified without recompiling the application program.
The embedded system realizes the mutual access between the operating system and the application software without the Lai Dongtai library and the static library.
In one embodiment, when an interface function is newly added, a new interface function address is added at the end of an interface address table; specifically, a first group of interfaces in a first interface address table are stored in sequence; when a first interface function is newly added, a first group of interfaces is required to be newly added, and the newly added first group of interfaces is added at the tail of the first interface address table.
In one embodiment, when the interface function is deleted, a value of 0 is set at the position of the address of the deleted interface function,
to ensure forward version compatibility. Specifically, when the first interface function is deleted, in order to ensure the forward version compatibility, a value of 0 is set at the position of the first group of interfaces of the deleted first interface function.
Although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (7)

1. A compiling method for an embedded system, the compiling method comprising:
storing a first interface address table into an operating system memory, and storing a first group of interfaces into the first interface address table according to an index;
storing a second interface address table into an application program memory, and storing a second group of interfaces into the second interface address table according to indexes;
the operating system and the application program realize access through the first interface address table or the second interface address table;
the operating system provides a first interface address table, and the first interface address table provides a first group of interfaces;
the application program obtains the actual address of the interface function of the operating system based on the address of a first interface address table in the operating system and the offset of the interface function of the operating system in the first interface address table, and then forcibly converts the actual address of the function into the address of the interface function for access;
the application program provides a second interface address table, and the second interface address table provides a second group of interfaces;
and the operating system executes the application executable file of the corresponding interface address through the second interface address table.
2. The compiling method according to claim 1 wherein when an interface function is newly added, a new interface function address is added at the end of the interface address table.
3. The compiling method according to claim 1 or 2 wherein when the interface function is deleted, a value of 0 is set at a position where the address of the interface function is deleted.
4. The compiling method of claim 1 wherein the compiling method: before accessing the interface function through the interface address table, judging whether the address of the interface function is effective.
5. A compilation system for an embedded system, the compilation system comprising:
the interface address table comprises a first interface address table and a second interface address table, the first interface address table is stored in the memory of the operating system, and the second interface address table is stored in the memory of the application program;
the interface function address comprises a first interface address table and a second interface address table, a first group of interfaces are stored in the first interface address table according to the index, and a second group of interfaces are stored in the second interface address table according to the index;
wherein the operating system and the application program realize access through the first interface address table or the second interface address table;
the operating system provides a first interface address table, and the first interface address table provides a first group of interfaces;
the application program obtains the actual address of the interface function of the operating system based on the address of a first interface address table in the operating system and the offset of the interface function of the operating system in the first interface address table, and then forcibly converts the actual address of the function into the address of the interface function for access;
the application program provides a second interface address table, and the second interface address table provides a second group of interfaces;
and the operating system executes the application executable file of the corresponding interface address through the second interface address table.
6. The compiling system of claim 5 wherein when an interface function is added, a new interface function address is added at the end of the interface address table.
7. The compiling system according to claim 5 or 6 wherein when an interface function is deleted, a value of 0 is set at a position where the interface function address is deleted.
CN201911039090.4A 2019-10-29 2019-10-29 Compiling method and compiling system of embedded system Active CN110990018B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911039090.4A CN110990018B (en) 2019-10-29 2019-10-29 Compiling method and compiling system of embedded system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911039090.4A CN110990018B (en) 2019-10-29 2019-10-29 Compiling method and compiling system of embedded system

Publications (2)

Publication Number Publication Date
CN110990018A CN110990018A (en) 2020-04-10
CN110990018B true CN110990018B (en) 2023-03-24

Family

ID=70082510

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911039090.4A Active CN110990018B (en) 2019-10-29 2019-10-29 Compiling method and compiling system of embedded system

Country Status (1)

Country Link
CN (1) CN110990018B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116680013B (en) * 2023-06-16 2024-02-20 上海移芯通信科技股份有限公司 Compiling and developing method and device for separating system foundation bag from application program

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1645339A (en) * 2005-01-31 2005-07-27 浙江大学 Debugging method for applied programm in simulator of embedded system
CN1719403A (en) * 2004-07-08 2006-01-11 腾讯科技(深圳)有限公司 Method of making network page picture directly apply to instant communication tool
KR20080039080A (en) * 2006-10-31 2008-05-07 에스케이 텔레콤주식회사 Terminal having an interfacing function of the heterogeneity language compile library, api calling method and compile function generating method
CN101441566A (en) * 2008-11-18 2009-05-27 腾讯科技(深圳)有限公司 Embedded type platform and method for dynamically linking program on the same
CN101645020A (en) * 2008-08-04 2010-02-10 优诺威讯国际有限公司 Virtual operating system creation method
CN104951705A (en) * 2015-07-08 2015-09-30 南京烽火星空通信发展有限公司 Android application data encryption packaging method based on operating system interface rewriting
CN107247608A (en) * 2017-05-31 2017-10-13 河南思维轨道交通技术研究院有限公司 A kind of operating system implementation method with application software hardware address independence
CN107615243A (en) * 2015-07-28 2018-01-19 华为技术有限公司 A kind of method, apparatus and system of call operation system library

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI273397B (en) * 2004-07-01 2007-02-11 Winity Technology Inc Virtual memory device including a bridge circuit
US10108406B2 (en) * 2016-10-24 2018-10-23 International Business Machines Corporation Linking optimized entry points for local-use-only function pointers

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1719403A (en) * 2004-07-08 2006-01-11 腾讯科技(深圳)有限公司 Method of making network page picture directly apply to instant communication tool
CN1645339A (en) * 2005-01-31 2005-07-27 浙江大学 Debugging method for applied programm in simulator of embedded system
KR20080039080A (en) * 2006-10-31 2008-05-07 에스케이 텔레콤주식회사 Terminal having an interfacing function of the heterogeneity language compile library, api calling method and compile function generating method
CN101645020A (en) * 2008-08-04 2010-02-10 优诺威讯国际有限公司 Virtual operating system creation method
CN101441566A (en) * 2008-11-18 2009-05-27 腾讯科技(深圳)有限公司 Embedded type platform and method for dynamically linking program on the same
CN104951705A (en) * 2015-07-08 2015-09-30 南京烽火星空通信发展有限公司 Android application data encryption packaging method based on operating system interface rewriting
CN107615243A (en) * 2015-07-28 2018-01-19 华为技术有限公司 A kind of method, apparatus and system of call operation system library
CN107247608A (en) * 2017-05-31 2017-10-13 河南思维轨道交通技术研究院有限公司 A kind of operating system implementation method with application software hardware address independence

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Research on Java Compiling System for Embedded Systems;Teng Haikun等;《ISBDAI"18:Proceedings of the International Symposium on Big Data and Artificial Intelligence》;20181229;第342-345页 *
基于.COM文件格式的一种动态加载机制的研究;杨志祥;《中国优秀硕士学位论文全文数据库 信息科技辑》;20070615;第I138-115页 *
嵌入式单地址空间操作系统动态加载的研究;李培亮等;《电子测试》;20101231(第7期);第23-27页 *

Also Published As

Publication number Publication date
CN110990018A (en) 2020-04-10

Similar Documents

Publication Publication Date Title
US10282195B2 (en) Generating and applying patches to computer program code concurrently with its execution
US6202205B1 (en) System and method for profile-based, on-the-fly optimization of library code
KR100518584B1 (en) Shared library system and method for constructing the system
CN106095620B (en) A kind of development approach of built-in Linux partition holding
US6154878A (en) System and method for on-line replacement of software
US8176142B2 (en) Shared JAVA jar files
US7913243B2 (en) Method and system for generating and applying patches to a computer program concurrently with its execution
US20130086598A1 (en) Generating compiled code that indicates register liveness
JPH02272627A (en) Digital computer system and method of invocation of procedure of the same
CN105975816A (en) Method and system for code protection based on virtual technology under mobile terminal
CN101334737A (en) Embedded equipment start-up or reset method
KR20060120312A (en) System and method for reducing execution time of byte code at java virtual machine
CN110659088B (en) Method and system for expanding program under embedded environment
CN110990018B (en) Compiling method and compiling system of embedded system
US10452364B2 (en) Method and system for preparing code to be executed by programmable control devices
JP2007510211A (en) Mapping dynamic link libraries on computer equipment
CN104331275A (en) JavaCard and method for patching application of JavaCard
CN109933358B (en) Control method for reducing program upgrading amount of metering equipment
CN114860393A (en) Cross-platform virtual machine migration method, device and equipment
KR100478463B1 (en) Dynamic Linking Method for Application Program
CN106873913A (en) A kind of method that embedded system self adaptation difference flash carries out subregion
KR100763199B1 (en) Method for calling a method in virtual machine environment and system including a virtual machine processing the method
US6311227B1 (en) Procedure calling method
JP6295914B2 (en) Programmable controller system, its support device, programmable controller
CN108776594B (en) Software programming suitable for real-time control of processor and assembly linking method thereof

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
GR01 Patent grant
GR01 Patent grant