CN110515751B - Method and system for loading and running VxWorks real-time protection process - Google Patents

Method and system for loading and running VxWorks real-time protection process Download PDF

Info

Publication number
CN110515751B
CN110515751B CN201810495580.4A CN201810495580A CN110515751B CN 110515751 B CN110515751 B CN 110515751B CN 201810495580 A CN201810495580 A CN 201810495580A CN 110515751 B CN110515751 B CN 110515751B
Authority
CN
China
Prior art keywords
executable code
memory
file
loading
code file
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
CN201810495580.4A
Other languages
Chinese (zh)
Other versions
CN110515751A (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.)
CRRC Zhuzhou Institute Co Ltd
Original Assignee
CRRC Zhuzhou Institute 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 CRRC Zhuzhou Institute Co Ltd filed Critical CRRC Zhuzhou Institute Co Ltd
Priority to CN201810495580.4A priority Critical patent/CN110515751B/en
Publication of CN110515751A publication Critical patent/CN110515751A/en
Application granted granted Critical
Publication of CN110515751B publication Critical patent/CN110515751B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/004Error avoidance
    • 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/44568Immediately runnable code
    • G06F9/44578Preparing or optimising for loading

Abstract

The invention discloses a method and a system for loading and running a VxWorks real-time protection process. The method comprises the following steps: constructing a temporary file system based on the memory; writing the compiled executable code file of the VxWorks real-time protection process into the temporary file system; and calling a related interface for starting the executable code file, and starting and loading the executable code file. According to the method, the starting and loading of the VxWorks real-time protection process can be realized by separating from a file system, so that the operating hardware requirement of the VxWorks real-time protection process is reduced, and the operating stability of the VxWorks real-time protection process is improved.

Description

Method and system for loading and running VxWorks real-time protection process
Technical Field
The invention belongs to the technical field of electronics, and particularly relates to a method and a system for loading and running a VxWorks real-time protection process.
Background
The vxWorks operating system is a very widely applied operating system in the prior art, and a conventional application program is an out program generated by DKM (Downloadable Kernel Module), wherein the task where the out program is located directly shares the same memory space with a system kernel, and if a BUG such as memory leakage occurs in the out, other tasks can be directly performed or the system crash can be caused.
Starting with vxWorks 6.4, vxWorks operating system introduced real-time protection process (VxWorks realtime process project, RTP) mode programming. Each RTP process in the RTP real-time process is completely independent, any error of the program in the RTP process is limited in the RTP process, and all resources are automatically released when the RTP real-time process is deleted. RTP differs from other multi-process OSs in that the RTP real-time process of VxWorks has complete static certainty, provides protection functionality while providing the highest real-time response certainty and rapidity, and can provide complete storage error detection and storage reporting functionality. The dynamic link library and shared data area functions are also provided at the same time. The RTP real-time protection process and the original higher-performance real-time task of the VWorks form a super equipment platform with both protectiveness and real-time performance.
The RTP real-time protection mode has the advantages that application programs are independent and do not affect each other, the stability of the kernel is improved, the execution efficiency of the memory copy in the kernel state and the user state is reduced, the CPU speed is locked faster and faster, and the efficiency sacrifice is smaller and smaller. However, in contrast to conventional DKM (downloadble kernel module project), RTP is suitable for multiple teams to operate independently and then aggregate debugging.
However, RTP real-time processes of vxWorks operating system generate executable files vxe, which are similar to exe executable files in Windows environment, file loading relies on a file system. However, in general, the embedded system has limited resources, not all embedded systems have large-capacity memory chips for building a file system, and the file system built based on the vxWorks operating system has the problems that the file system is easy to damage, files stored in the file system are easy to lose or damage, and the like.
Disclosure of Invention
The invention provides a method for loading and running a VxWorks real-time protection process, which comprises the following steps:
constructing a temporary file system based on the memory;
writing the compiled executable code file of the VxWorks real-time protection process into the temporary file system;
and calling a related interface for starting the executable code file, and starting and loading the executable code file.
In one embodiment, writing the executable code file of the compiled VxWorks real-time protection process into the temporary file system includes:
storing the executable code file in a data memory;
reading the executable code file in the data memory to the memory;
writing the executable code file in the memory into the temporary file system.
In one embodiment, the executable code file in the data store is read to memory, wherein the executable code file in the data store is read to memory in binary form.
In one embodiment, the executable code file in the data store is read to memory, wherein accessing the absolute address in the data store reads the executable code file to memory.
In one embodiment, the executable code file is read to memory by accessing an absolute address in the data store, wherein an offset and size of the executable code file relative to the base address of the data store is obtained.
In one embodiment:
reading the executable code file in the data memory to a memory, wherein an image file with the same content as the executable code file is generated in the memory;
writing the image file in the memory into the temporary file system, and generating a corresponding executable code program in the temporary file system;
and calling a related interface for starting the executable code program, and starting and loading the executable code program.
In an embodiment, the method further comprises:
and deleting the executable code program after the executable code program is started and loaded.
The invention also proposes a storage medium having stored thereon a program code for implementing the method according to the invention.
The invention also provides a system for loading and running the VxWorks real-time protection process, which comprises:
a memory;
a data storage;
the process loading module is configured to realize the method based on the memory and the data storage under the environment of the VxWorks operating system.
In an embodiment, the data memory is a Flash memory.
According to the method, the starting and loading of the VxWorks real-time protection process can be realized by separating from a file system, so that the operating hardware requirement of the VxWorks real-time protection process is reduced, and the operating stability of the VxWorks real-time protection process is improved.
Additional features or 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 some of the advantages of the present invention may be realized and attained by the steps particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification, illustrate the invention and together with the embodiments of the invention, serve to explain the invention, without limitation to the invention. In the drawings:
FIGS. 1 and 3 are flowcharts of methods according to various embodiments of the present invention;
FIG. 2 is a flow chart of a portion of a method according to an embodiment of the invention.
Detailed Description
The following will explain the embodiments of the present invention in detail with reference to the drawings and examples, so that the practitioner of the present invention can fully understand how to apply the technical means to solve the technical problems, achieve the implementation process of the technical effects, and implement the present invention according to the implementation process. It should be noted that, as long as no conflict is formed, each embodiment of the present invention and each feature of each embodiment may be combined with each other, and the formed technical solutions are all within the protection scope of the present invention.
The vxWorks operating system is a very widely applied operating system in the prior art, and a conventional application program is an out program generated by DKM (Downloadable Kernel Module), wherein the task where the out program is located directly shares the same memory space with a system kernel, and if a BUG such as memory leakage occurs in the out, other tasks can be directly performed or the system crash can be caused.
Starting with vxWorks 6.4, vxWorks operating system introduced real-time protection process (VxWorks real time process project, RTP) mode programming. Each RTP process in the RTP real-time process is completely independent, any error of the program in the RTP process is limited in the RTP process, and all resources are automatically released when the RTP real-time process is deleted. RTP differs from other multi-process OSs in that the RTP real-time process of VxWorks has complete static certainty, provides protection, protection functions while providing the highest real-time response certainty and rapidity, and can provide complete storage error detection and storage reporting functions. The dynamic link library and shared data area functions are also provided at the same time. The RTP real-time protection process and the original higher-performance real-time task of the VWorks form a super equipment platform with both protectiveness and real-time performance.
The RTP real-time protection mode has the advantages that application programs are independent and do not affect each other, the stability of the kernel is improved, the execution efficiency of the memory copy in the kernel state and the user state is reduced, the CPU speed is locked faster and faster, and the efficiency sacrifice is smaller and smaller. However, in contrast to conventional DKM (downloadble kernel module project), RTP is suitable for multiple teams to operate independently and then aggregate debugging.
However, RTP real-time processes of vxWorks operating system generate executable files vxe, which are similar to exe executable files in Windows environment, file loading relies on a file system. However, in general, the embedded system has limited resources, not all embedded systems have large-capacity memory chips for building a file system, and the file system built based on the vxWorks operating system has the problems that the file system is easy to damage, files stored in the file system are easy to lose or damage, and the like.
Aiming at the problems, the invention provides a method for loading and running a VxWorks real-time protection process. Specifically, the task protection of RTP is realized based on MMU, and the process scheme solves the contradiction between kernel protection and real-time performance and certainty. The user can dynamically create/delete the RTP real-time protection process or only operate a part of programs in the RTP real-time protection process according to the requirement. Each RTP real-time process is completely independent, and the RTP real-time process under VxWorks has complete static characteristics, so that a protection function can be provided under the condition of ensuring the certainty and rapidness of real-time response.
The executable code generated by RTP engineering is vxe, like exe file, the entry is a main function. The default RTP engineering main function ends and all tasks created by the main are also ended. For RTP processes, default interface functions may be used to make calls, and if the system is started running vxWorks, the vxe program must be placed under a file system to make calls, such as/TFFS.
Based on the analysis, in the method, a file system is not constructed by using a memory, a temporary file system (Ramdisk) is constructed on the basis of the memory, and the starting environment of the file vxe is virtualized by using the temporary file system, so that the starting loading of the file vxe is realized.
The implementation of the embodiment of the present invention is described in detail below based on a flowchart. The steps shown in the flowcharts of the figures may be performed in a computer system containing, for example, a set of computer executable instructions. Although a logical order of steps is depicted in the flowchart, in some cases the steps shown or described may be performed in a different order than presented.
As shown in FIG. 1, in one embodiment, a temporary file system is constructed based on memory (S110); when the VxWorks real-time protection process needs to be started and loaded, writing an executable code file of the compiled VxWorks real-time protection process into a temporary file system (S120); and calling a related interface for starting an executable code file of the VxWorks real-time protection process, and starting and loading the executable code file in the temporary file system.
In the steps of the method, a file system is not required to be established, so that the storage space is greatly saved, and the VxWorks real-time protection process can be applied to embedded products with limited storage space. Moreover, as the file system is not used, file loss or file damage and the like caused by file system damage can be avoided, and the overall reliability of the embedded system is improved.
According to the method, the starting and loading of the VxWorks real-time protection process can be realized by separating from a file system, so that the operating hardware requirement of the VxWorks real-time protection process is reduced, and the operating stability of the VxWorks real-time protection process is improved.
Further, in one embodiment, the executable code file of the VxWorks real-time protection process is stored in a specific data store. Specifically, as shown in fig. 2, in one embodiment, the method includes the steps of:
storing an executable code file of the VxWorks real-time protection process into a data memory (S221);
reading an executable code file in a data storage to a memory (S222);
the executable code file in the memory is written to the temporary file system (S223).
Further, in an embodiment, the data memory is a Flash memory.
Further, in one embodiment, in step S222, the executable code file in the data storage is read to the memory in binary form.
Specifically, in one embodiment, firstly, the vxWorks operating system constructs a temporary file system Ramdisk; storing the compiled RTP real-time process vxe file into Flash, then reading the content of vxe into memory in binary form, writing the file in the memory into a temporary file system through a file read-write interface, and then starting vxe program by calling the interface of vxe.
Further, in one embodiment, in step S222, the absolute address in the data storage is accessed to read the executable code file into the memory. Further, in one embodiment, an offset and size of the executable code file at a base address relative to the data store is obtained.
Specifically, in one embodiment, in step S222, an image file having the same content as the executable code file is generated in the memory; in step S223, the image file in the memory is written into the temporary file system, and a corresponding executable code program is generated in the temporary file system; finally, the relevant interface for starting the executable code program is called, and the executable code program is started and loaded.
According to the method, the file vxe stored on the Flash chip is read into the memory, then the temporary file vxe is constructed in the Ramdisk, and finally the loading operation of the file vxe is realized. The method has the advantages of simple principle, no need of adding new interface functions, low complexity, low maintenance difficulty and good reliability.
Further, in an embodiment, the method further comprises:
and deleting the executable code program after the executable code program is started and loaded.
Specifically, in one embodiment, the workflow corresponding to the method is shown in fig. 3.
S310, judging whether the execution parameters are legal or not, and ending the program if the execution parameters are not legal.
S320, reading the file vxe of the Flash memory to the memory, wherein the file vxe is directly stored on the Flash memory chip, a file system is not used without directly opening the file, and the starting address of the file vxe on the Flash memory chip is directly pointed to, and the offset address and the size of the offset address of the Flash memory relative to the base address of the memory are obtained.
S330, rewriting the. vxe file image in the memory into a temporary file system Ramdisk, and generating a. vxe file with the same content in the Ramdisk.
S340, calling a function interface for starting. vxe, starting and loading a. vxe program in the Ramdisk, and realizing loading operation of the. vxe file.
S350, deleting the temporary vxe program in the Ramdisk.
The method of the invention does not need to use a file system, directly re-reads the. vxe file from the Flash memory to the memory, and re-pours the memory file into the Ramdisk to generate an image with the same content. vxe file, and indirectly realizes the loading operation of the. vxe file by starting and loading the. vxe file in the Ramdisk. The method is simple and convenient to use, the principle is flexible and easy to understand, and the vxe program is loaded and operated from Flash conveniently.
Based on the method of the invention, the invention also proposes a storage medium on which a program code for implementing the method according to the invention is stored.
Furthermore, based on the method of the invention, the invention also provides a system for loading and running the VxWorks real-time protection process. Specifically, in one embodiment, the system includes:
a memory;
a data storage;
the process loading module is configured to realize the method based on the memory and the data storage in the VxWorks operating system environment.
Although the embodiments of the present invention are disclosed above, the embodiments are only used for the convenience of understanding the present invention, and are not intended to limit the present invention. There are various other embodiments of the methods described herein. Various modifications and variations may be made in the present invention by those skilled in the art without departing from the spirit of the invention, and such modifications and variations are intended to be within the scope of the appended claims.

Claims (9)

1. A method for loading and running VxWorks real-time protection processes, the method comprising:
constructing a temporary file system based on a memory, wherein the temporary file system adopts Ramdisk;
writing the compiled executable code file of the VxWorks real-time protection process into the temporary file system;
calling a related interface for starting the executable code file, and starting and loading the executable code file;
the process of writing the executable code file of the compiled VxWorks real-time protection process into the temporary file system comprises the following steps:
storing the executable code file in a data memory;
reading the executable code file in the data memory to the memory;
writing the executable code file in the memory into the temporary file system;
wherein reading the executable code file in the data store to memory comprises:
generating an image file with the same content as the executable code file in the memory;
and writing the image file in the memory into the temporary file system, and generating a corresponding executable code program in the temporary file system.
2. The method of claim 1, wherein the executable code file in the data store is read to memory in binary form.
3. The method of claim 2, wherein the executable code file in the data store is read to memory, wherein accessing an absolute address in the data store reads the executable code file to memory.
4. A method according to claim 3, wherein accessing an absolute address in the data store reads the executable code file into memory, wherein an offset and size of the executable code file in relation to the base address of the data store is obtained.
5. The method according to claim 1, characterized in that: and calling a related interface for starting the executable code program, and starting and loading the executable code program.
6. The method of claim 5, wherein the method further comprises:
and deleting the executable code program after the executable code program is started and loaded.
7. A storage medium having stored thereon program code for implementing the method of any of claims 1-6.
8. A system for loading and running VxWorks real-time protection processes, the system comprising:
a memory;
a data storage;
a process loading module configured to implement the method of any of claims 1-6 based on the memory and the data store in a VxWorks operating system environment.
9. The system of claim 8, wherein the data store is a Flash memory.
CN201810495580.4A 2018-05-22 2018-05-22 Method and system for loading and running VxWorks real-time protection process Active CN110515751B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810495580.4A CN110515751B (en) 2018-05-22 2018-05-22 Method and system for loading and running VxWorks real-time protection process

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810495580.4A CN110515751B (en) 2018-05-22 2018-05-22 Method and system for loading and running VxWorks real-time protection process

Publications (2)

Publication Number Publication Date
CN110515751A CN110515751A (en) 2019-11-29
CN110515751B true CN110515751B (en) 2023-05-12

Family

ID=68621839

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810495580.4A Active CN110515751B (en) 2018-05-22 2018-05-22 Method and system for loading and running VxWorks real-time protection process

Country Status (1)

Country Link
CN (1) CN110515751B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112114964A (en) * 2020-08-17 2020-12-22 上海睿赛德电子科技有限公司 Application security kernel access method suitable for embedded system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102135908A (en) * 2010-01-25 2011-07-27 研祥智能科技股份有限公司 Method, device and computer system for switching operating system
CN103309710A (en) * 2013-06-09 2013-09-18 南车株洲电力机车研究所有限公司 Method and system for loading OUT file through VXWORKS operating system
CN103677820A (en) * 2013-12-05 2014-03-26 上海斐讯数据通信技术有限公司 Embedded development software output method and system
CN104572224A (en) * 2015-02-04 2015-04-29 南车株洲电力机车研究所有限公司 Method, device and system for loading out file
CN107273370A (en) * 2016-04-06 2017-10-20 中兴通讯股份有限公司 Switching system method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104881604B (en) * 2014-02-27 2019-07-16 中兴通讯股份有限公司 The operation method and device of version file

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102135908A (en) * 2010-01-25 2011-07-27 研祥智能科技股份有限公司 Method, device and computer system for switching operating system
CN103309710A (en) * 2013-06-09 2013-09-18 南车株洲电力机车研究所有限公司 Method and system for loading OUT file through VXWORKS operating system
CN103677820A (en) * 2013-12-05 2014-03-26 上海斐讯数据通信技术有限公司 Embedded development software output method and system
CN104572224A (en) * 2015-02-04 2015-04-29 南车株洲电力机车研究所有限公司 Method, device and system for loading out file
CN107273370A (en) * 2016-04-06 2017-10-20 中兴通讯股份有限公司 Switching system method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
VxWorks开发板驱动程序学习之文件系统(一);轻蓝雨;《https://blog.csdn.net/Ouyangxiayun/article/details/52915038》;20161024;第1-13页 *
基于光纤通道的文件级数据共享系统的设计与实现;杨颖;《中国优秀硕士学位论文全文库》;20120731;第1-21页 *

Also Published As

Publication number Publication date
CN110515751A (en) 2019-11-29

Similar Documents

Publication Publication Date Title
US9274768B2 (en) Runtime code hooking for print driver and functionality testing
US6698016B1 (en) Method for injecting code into another process
US7743228B2 (en) Information processing apparatus and method for obtaining software processing log
US8321482B2 (en) Selectively modifying files of a container file
US9262283B2 (en) Method for reading kernel log upon kernel panic in operating system
US20160300044A1 (en) Anti-debugging method
KR20110098567A (en) Method and apparatus for generating minimal boot image
KR20100110652A (en) Memory apparatus and method for updating firmware of the memory apparatus
US10055377B2 (en) Using a proprietary framework on a standards-based embedded device
JP7012074B2 (en) Virtual disk expansion method and equipment
CN110716845A (en) Method for reading log information of Android system
CN108228077B (en) Storage area management method, operation method, device, equipment and readable medium
US9250917B2 (en) Auto-cloudifying applications via runtime modifications
US20090193215A1 (en) Erasing and restoring factory settings in computer systems
KR100766863B1 (en) Software-installation system using movable data storage and method thereof
CN110515751B (en) Method and system for loading and running VxWorks real-time protection process
US20240095174A1 (en) Method for detecting error of operating system kernel memory in real time
CN111290765B (en) Firmware quick burning method, system and storage medium
CN111026609B (en) Information auditing method, system, equipment and computer readable storage medium
CN100365572C (en) Software packaging method
CN114765051A (en) Memory test method and device, readable storage medium and electronic equipment
WO2020150018A1 (en) Input/output control code filter
CN116881086B (en) Method and device for monitoring memory during application running, computing equipment and storage medium
US8560824B2 (en) Methods and devices for decompressing and executing option memory for device in shadow memory of a computer system having a BIOS
CN112882690B (en) Application development method and device

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