CN119557009A - Method and device for starting embedded Linux main and standby operating system based on ping-pong mechanism - Google Patents

Method and device for starting embedded Linux main and standby operating system based on ping-pong mechanism Download PDF

Info

Publication number
CN119557009A
CN119557009A CN202411607028.1A CN202411607028A CN119557009A CN 119557009 A CN119557009 A CN 119557009A CN 202411607028 A CN202411607028 A CN 202411607028A CN 119557009 A CN119557009 A CN 119557009A
Authority
CN
China
Prior art keywords
image file
main
backup
verification
kernel
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.)
Granted
Application number
CN202411607028.1A
Other languages
Chinese (zh)
Other versions
CN119557009B (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.)
Hangzhou Vango Technologies Inc
Original Assignee
Hangzhou Vango Technologies Inc
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 Hangzhou Vango Technologies Inc filed Critical Hangzhou Vango Technologies Inc
Priority to CN202411607028.1A priority Critical patent/CN119557009B/en
Publication of CN119557009A publication Critical patent/CN119557009A/en
Application granted granted Critical
Publication of CN119557009B publication Critical patent/CN119557009B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operations
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1417Boot up procedures

Landscapes

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

Abstract

本发明公开了一种基于乒乓机制的嵌入式Linux主备操作系统启动方法和装置,应用该嵌入式系统的MPU芯片内部ROM中包含主系统和备份系统的ROMCODE;应用该嵌入式系统的架构包括flash存储区,flash设置主区域和备份区域,主区域配置主系统镜像文件,备份区域配置备份系统镜像文件;其中启动方法包括:执行主系统的ROMCODE和备份系统的ROMCODE;校验主系统镜像文件中SPL镜像文件和备份系统镜像文件中SPL镜像文件;将校验结果保存至校验记录中;如主系统镜像文件的SPL镜像文件校验成功,启动主系统镜像文件的SPL镜像文件;如备份系统镜像文件的SPL镜像文件校验成功,启动备份系统镜像文件的SPL镜像文件。该方法能够实现嵌入式Linux主备操作系统的快速启动。The present invention discloses a method and device for starting an embedded Linux main and standby operating system based on a ping-pong mechanism, wherein the internal ROM of an MPU chip of the embedded system includes ROMCODE of a main system and a backup system; the architecture of the embedded system includes a flash storage area, the flash sets a main area and a backup area, the main area configures a main system image file, and the backup area configures a backup system image file; wherein the starting method includes: executing the ROMCODE of the main system and the ROMCODE of the backup system; verifying the SPL image file in the main system image file and the SPL image file in the backup system image file; saving the verification result in a verification record; if the SPL image file of the main system image file is successfully verified, starting the SPL image file of the main system image file; if the SPL image file of the backup system image file is successfully verified, starting the SPL image file of the backup system image file. The method can realize the rapid startup of the embedded Linux main and standby operating system.

Description

Method and device for starting embedded Linux main and standby operating systems based on ping-pong mechanism
Technical Field
The invention belongs to the embedded technical field, and particularly relates to a method and a device for starting an embedded Linux main/standby operating system based on a ping-pong mechanism
Background
With the rapid development of embedded Linux in the field of emerging embedded operation systems, application products are wider and wider, realization functions are more and more complex, and new requirements are put forward on system stability. In order to ensure reliable and stable operation of the system, the industrial embedded product is generally configured with a main system and a standby system.
At present, two modes of starting the main and standby double systems exist, namely, when the main system cannot be started, the backup system is started. For example, the chinese patent application with application number 2014108371866 discloses a method for starting a master/slave embedded boot program, which includes first reading the master boot program to load, if the loading fails, restarting the device, and reading the backup boot program to load. This approach corresponds to 2 times the normal start-up time. Second, when the main system cannot be started, the files in the backup area are used for recovering the main system, and then the main system is started again. The invention patent application of China with the application number 202211304625.8 discloses a backup starting method of an embedded system architecture, wherein the embedded system architecture applied by the method comprises the steps of configuring a first system partition, a second system partition and a mirror image area in a storage area, recovering system files of the first system partition and the second system partition according to the system mirror image files of the mirror image area if the first system partition and the second system partition cannot be started, and then starting a system from the first system partition based on the recovered system files of the first system partition. Because the repair of the flash memory is slow, the starting time of the equipment is prolonged.
Both methods have the problem that when the main system cannot be started, the starting time of the whole equipment is long, so that the application program cannot be run on line on time. In some application scenarios, there is a requirement for the starting time of the device, for example, if the starting time of the acquisition terminal in the power industry is too long, the application program fails to connect to the power server.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a method and a device for starting an embedded Linux main and standby operating system based on a ping-pong mechanism, which can realize the quick starting of the embedded Linux main and standby operating system.
In order to solve the technical problems, the invention discloses a method for starting an embedded Linux main and standby operating system based on a ping-pong mechanism, which is applied to a microprocessor chip internal ROM of the embedded system and comprises ROMCODE of the main system and ROMCODE of a standby system, wherein the architecture of the embedded system comprises a flash storage area, the flash storage area is provided with a main area and a standby area, the main area is configured with a main system image file, and the standby area is configured with a standby system image file, and the method comprises the following steps:
executing ROMCODE of the primary system and ROMCODE of the backup system;
the method comprises the steps of checking a secondary guide program image file in a main system image file and a secondary guide program image file in a backup system image file, and storing a checking result into a checking record, wherein the checking result comprises a system identifier, an image file name and a checking success or failure identifier;
if the verification of the secondary boot program image file in the main system image file is successful, starting the secondary boot program image file in the main system image file;
if the verification of the secondary boot image file in the backup system image file is successful, the secondary boot image file in the backup system image file is started.
Further, the method further comprises:
checking Uboot image files in the main system image files and Uboot image files in the backup system image files, and storing the checking results into checking records;
if the Uboot image file in the main system image file is successfully checked, starting the Uboot image file in the main system image file;
if the Uboot image file in the backup system image file is successfully checked, starting the Uboot image file in the backup system image file.
Further, the method further comprises:
Checking the kernel image file in the main system image file and the kernel image file in the backup system image file;
If the verification of the kernel mirror image file in the main system mirror image file is successful, guiding the kernel mirror image file in the main system mirror image file to the memory for running, mounting the root file system, and ending the starting process;
If the verification of the kernel image file in the image file of the main system fails, and the verification of the kernel image file in the image file of the backup system succeeds, the kernel image file in the image file of the backup system is guided to the memory for running, the root file system is mounted, and the starting process is ended.
Further, the method further comprises:
acquiring a check record in an idle state after the system is started;
If the verification record contains a verification result of verification failure, acquiring the position of the mirror image file which fails to be verified in the flash storage area according to the system identifier and the mirror image file name in the verification result;
And repairing the mirror image file with verification failure.
Further, the method adopts an fdisk tool to repair the image file which fails to be checked.
On the other hand, the invention also discloses a device for starting the embedded Linux main and standby operating system based on the ping-pong mechanism, which comprises ROMCODE of the main system and ROMCODE of the standby system in the ROM inside the microprocessor chip of the embedded system, wherein the architecture of the embedded system comprises a flash storage area, the flash storage area is provided with a main area and a standby area, the main area is configured with a main system image file, and the standby area is configured with a standby system image file, and the device comprises:
ROMCODE a start-up module for executing ROMCODE of the primary system and ROMCODE of the backup system;
the system comprises a first verification module, a second verification module and a first verification module, wherein the first verification module is used for verifying a second-level guide program image file in a main system image file and a second-level guide program image file in a backup system image file;
The first starting module is used for starting the secondary guide program image file in the main system image file if the secondary guide program image file in the main system image file is successfully checked, and starting the secondary guide program image file in the backup system image file if the secondary guide program image file in the backup system image file is successfully checked.
Further, the apparatus further comprises:
The second checking module is used for checking the Uboot image files in the main system image files and the backup system image files;
The second starting module is used for starting the Uboot image file in the main system image file if the Uboot image file in the main system image file is successfully checked, and starting the Uboot image file in the backup system image file if the Uboot image file in the backup system image file is successfully checked.
Further, the apparatus further comprises:
The third checking module is used for checking the kernel image file in the main system image file and the kernel image file in the backup system image file;
and the third starting module is used for guiding the kernel mirror image file in the mirror image file of the main system to run to the memory if the kernel mirror image file in the mirror image file of the main system is successfully checked, mounting the root file system and ending the starting process, and guiding the kernel mirror image file in the mirror image file of the backup system to run to the memory if the kernel mirror image file in the mirror image file of the main system is successfully checked and mounting the root file system and ending the starting process.
Further, the apparatus further comprises:
the system comprises a repair module, a flash storage area, a storage module and a storage module, wherein the repair module is used for acquiring a check record in an idle state after the system is started, and if the check record contains a check result of check failure, acquiring the position of a mirror file of the check failure in the flash storage area according to a system identifier and a mirror file name in the check result;
further, the repair module repairs the image file with the check failure by adopting an fdisk tool.
Compared with the prior art, the embedded Linux main and standby operating system starting method and device based on the ping-pong mechanism have the advantages that in the starting process, the main system and the backup system are started simultaneously, if a certain stage in the starting process of the main system fails, the corresponding mirror image file of the backup system is started, the starting is not stopped, the mirror image file of the main system in the flash is not repaired, the verification result is recorded only, the repair of the flash is placed in an idle state after the system is started, the starting time is not occupied, the starting smoothness is ensured, and the running time of an application program is not influenced.
Drawings
The foregoing and/or other advantages of the invention will become more apparent from the following detailed description of the invention when taken in conjunction with the accompanying drawings and detailed description.
FIG. 1 is a flow chart of an embedded Linux active/standby operating system starting method based on a ping-pong mechanism;
FIG. 2 is a block diagram of an embedded Linux active/standby operating system starting device based on a ping-pong mechanism.
Detailed Description
The embodiment discloses a method for starting an embedded Linux active/standby operating system based on a ping-pong mechanism, as shown in fig. 1. The ROM inside the microprocessor chip of the embedded system contains ROMCODE of the main system and ROMCODE of the backup system. ROMCODE is a piece of code that is solidified into the ROM inside the microprocessor chip, which cannot be modified, as the first boot program of the system. In this embodiment, ROMCODE of the main system starts at the 0 address of the on-chip ROM and ROMCODE of the backup system starts at the offset address of the on-chip ROM.
The framework of the embedded system comprises a flash storage area, wherein the flash storage area is provided with a main area and a backup area, the main area is configured with a main system image file, and the backup area is configured with a backup system image file, and in the embodiment, the image file used for starting comprises a secondary boot program image file, a Uboot image file and a kernel image file. The secondary boot program SPL (Secondary program loader) is used for initializing necessary devices of the embedded board card, such as a clock, a memory and a flash, and is used for preparing for loading UBoot, UBoot (Universal Boot Loader) is used for starting necessary hardware of the system, providing a debugging interface for initializing environment variables, preparing for loading a kernel, and kernel is a kernel of the system, and providing memory management, process management, a device driver, a system call interface and the like. After the kernel runs in the memory, the root file system rootfs is mounted, which is a system for logically storing and recovering named files and placed files, and then the running user application program can be started.
The method for starting the embedded Linux active/standby operating system disclosed by the embodiment comprises the following steps:
S101, executing ROMCODE of a main system and ROMCODE of a backup system;
ROMCODE is an MPU curing program, and according to the constraints of the MPU, the ROMCODE data is checked, and each MPU checking method may be different. If the verification fails, the chip cannot be started normally.
S102, checking a secondary guide program image file in a main system image file and a secondary guide program image file in a backup system image file, and storing a checking result into a checking record, wherein the checking result comprises a system identifier, an image file name and a checking success or failure identifier;
if the verification result of a certain time is that the verification of the secondary boot image file in the primary system image file is successful, the verification failure of the secondary boot image file in the backup system image file can be recorded as:
main system SPL 1 and backup system SPL 0
Here, "1" means that the check succeeds, and "0" means that the check fails.
S103, if the secondary boot program image file in the main system image file is successfully checked, starting the secondary boot program image file in the main system image file;
if the verification of the secondary boot image file in the backup system image file is successful, the secondary boot image file in the backup system image file is started.
If the SPL image files in the image files of the main system and the SPL image files in the image files of the backup system are successfully checked, after the step is finished, the SPL in the main system and the SPL in the backup system are started.
S201, checking Uboot image files in the main system image files and Uboot image files in the backup system image files;
S202, if the Uboot image file in the main system image file is successfully checked, starting the Uboot image file in the main system image file;
if the Uboot image file in the backup system image file is successfully checked, starting the Uboot image file in the backup system image file.
S301, checking the kernel image file in the main system image file and the kernel image file in the backup system image file;
S302, if the verification of the kernel mirror image file in the mirror image file of the main system is successful, guiding the kernel mirror image file in the mirror image file of the main system to the memory for running, mounting the root file system, and ending the starting process;
If the verification of the kernel image file in the image file of the main system fails, and the verification of the kernel image file in the image file of the backup system succeeds, the kernel image file in the image file of the backup system is guided to the memory for running, the root file system is mounted, and the starting process is ended.
In the starting process, the main system and the backup system are started at the same time, if a certain stage in the starting process of the main system fails, the corresponding image file of the backup system is started, the starting is not stopped, the image file of the main system in the flash is not repaired, only the verification result is recorded, the starting is cut to the corresponding position of the backup system, the action is equivalent to ping-pong once, if the follow-up starting process fails again, the ping-pong action is triggered, the system is started to be switched back and forth in the main system and the backup system, the starting smoothness is ensured, and the running time of an application program is not influenced.
In order to ensure that the data of the main and standby systems are correct, the flash data needs to be repaired, and the repair of the flash data is performed after the system is started, namely, after the steps are executed, the method further comprises the following steps:
after the system is started, acquiring a check record in an idle state;
If the verification record contains a verification result of verification failure, acquiring the position of the mirror image file which fails to be verified in the flash storage area according to the system identifier and the mirror image file name in the verification result;
And repairing the mirror image file with verification failure.
The verification record data volume is extremely small, the storage time is hardly occupied, the time consumption of the starting process is not influenced, and the flash can be conveniently repaired.
The repair of flash data does not occupy the starting time, so that the main and standby system is started with the characteristic of a pipeline, and the system can be started on time like normal conditions under abnormal conditions, thereby ensuring the normal operation of the system on-line program. Specifically, the flash repair can repair the image file which fails to be checked by calling a disk repair tool, such as an fdisk tool of Linux, through the system.
The embodiment also discloses a device for realizing the embedded Linux active/standby operating system starting method based on the ping-pong mechanism, as shown in fig. 2. The embedded system comprises a microprocessor chip, a backup system and a device, wherein the ROM in the microprocessor chip of the embedded system comprises ROMCODE of a main system and ROMCODE of the backup system, the architecture of the embedded system comprises a flash storage area, the flash storage area is provided with a main area and a backup area, the main area is configured with a main system image file, and the backup area is configured with a backup system image file, and the device comprises:
ROMCODE a start-up module for executing ROMCODE of the primary system and ROMCODE of the backup system;
the system comprises a first verification module, a second verification module and a first verification module, wherein the first verification module is used for verifying a second-level guide program image file in a main system image file and a second-level guide program image file in a backup system image file;
The first starting module is used for starting the secondary guide program image file in the main system image file if the secondary guide program image file in the main system image file is successfully checked, and starting the secondary guide program image file in the backup system image file if the secondary guide program image file in the backup system image file is successfully checked.
The second checking module is used for checking the Uboot image files in the main system image files and the backup system image files;
The second starting module is used for starting the Uboot image file in the main system image file if the Uboot image file in the main system image file is successfully checked, and starting the Uboot image file in the backup system image file if the Uboot image file in the backup system image file is successfully checked.
The third checking module is used for checking the kernel image file in the main system image file and the kernel image file in the backup system image file;
and the third starting module is used for guiding the kernel mirror image file in the mirror image file of the main system to run to the memory if the kernel mirror image file in the mirror image file of the main system is successfully checked, mounting the root file system and ending the starting process, and guiding the kernel mirror image file in the mirror image file of the backup system to run to the memory if the kernel mirror image file in the mirror image file of the main system is successfully checked and mounting the root file system and ending the starting process.
In order to ensure that the data of the main and standby systems are correct, the flash data needs to be repaired, and the device further comprises:
the system comprises a repair module, a flash storage area, a storage module and a storage module, wherein the repair module is used for acquiring a check record in an idle state after the system is started, and if the check record contains a check result of check failure, acquiring the position of a mirror file of the check failure in the flash storage area according to a system identifier and a mirror file name in the check result;
In this embodiment, the repair module repairs the image file with the fdisk tool that fails in verification.
The invention provides a concept and a method for starting an embedded Linux main and standby operating system based on a ping-pong mechanism, and particularly provides a method and a plurality of ways for realizing the technical scheme, wherein the method and the method are only preferred embodiments of the invention, and it should be pointed out that a plurality of improvements and modifications can be made by a person with ordinary skill in the art without departing from the principle of the invention, and the improvements and the modifications are also regarded as the protection scope of the invention. The components not explicitly described in this embodiment can be implemented by using the prior art.

Claims (10)

1.基于乒乓机制的嵌入式Linux主备操作系统启动方法,其特征在于,应用所述嵌入式系统的微处理器芯片内部ROM中包含主系统的ROMCODE和备份系统的ROMCODE;应用所述嵌入式系统的架构包括flash存储区,所述flash存储区设置主区域和备份区域,所述主区域配置主系统镜像文件,所述备份区域配置备份系统镜像文件;所述方法包括:1. A method for starting an embedded Linux main and backup operating system based on a ping-pong mechanism, characterized in that the internal ROM of a microprocessor chip of the embedded system includes a ROMCODE of a main system and a ROMCODE of a backup system; the architecture of the embedded system includes a flash storage area, the flash storage area is provided with a main area and a backup area, the main area is configured with a main system image file, and the backup area is configured with a backup system image file; the method comprises: 执行主系统的ROMCODE和备份系统的ROMCODE;Execute the ROMCODE of the main system and the ROMCODE of the backup system; 校验主系统镜像文件中的二级引导程序镜像文件和备份系统镜像文件中的二级引导程序镜像文件;将校验结果保存至校验记录中;所述校验结果包括:系统标识、镜像文件名称和校验成功或失败标识;Verify the secondary boot program image file in the main system image file and the secondary boot program image file in the backup system image file; save the verification result to the verification record; the verification result includes: system identification, image file name and verification success or failure identification; 如主系统镜像文件中的二级引导程序镜像文件校验成功,启动主系统镜像文件中的二级引导程序镜像文件;If the secondary boot program image file in the main system image file is verified successfully, the secondary boot program image file in the main system image file is started; 如备份系统镜像文件中的二级引导程序镜像文件校验成功,启动备份系统镜像文件中的二级引导程序镜像文件。If the secondary boot program image file in the backup system image file is verified successfully, the secondary boot program image file in the backup system image file is started. 2.根据权利要求1所述的基于乒乓机制的嵌入式Linux主备操作系统启动方法,其特征在于,还包括:2. The method for starting an embedded Linux main and standby operating system based on a ping-pong mechanism according to claim 1, characterized in that it also includes: 校验主系统镜像文件中的Uboot镜像文件和备份系统镜像文件中的Uboot镜像文件;将校验结果保存至校验记录中;Verify the Uboot image file in the main system image file and the Uboot image file in the backup system image file; save the verification result to the verification record; 如主系统镜像文件中的Uboot镜像文件校验成功,启动主系统镜像文件中的Uboot镜像文件;If the Uboot image file in the main system image file is verified successfully, start the Uboot image file in the main system image file; 如备份系统镜像文件中的Uboot镜像文件校验成功,启动备份系统镜像文件中的Uboot镜像文件。If the Uboot image file in the backup system image file is verified successfully, start the Uboot image file in the backup system image file. 3.根据权利要求2所述的基于乒乓机制的嵌入式Linux主备操作系统启动方法,其特征在于,还包括:3. The method for starting an embedded Linux main and standby operating system based on the ping-pong mechanism according to claim 2, characterized in that it also includes: 校验主系统镜像文件中的内核镜像文件和备份系统镜像文件中的内核镜像文件;将校验结果保存至校验记录中;Verify the kernel image file in the main system image file and the kernel image file in the backup system image file; save the verification result to the verification record; 如主系统镜像文件中的内核镜像文件校验成功,引导主系统镜像文件中的内核镜像文件到内存运行,挂载根文件系统,结束启动流程;If the kernel image file in the main system image file is verified successfully, the kernel image file in the main system image file is booted to the memory for execution, the root file system is mounted, and the startup process ends; 如主系统镜像文件中的内核镜像文件校验失败,且备份系统镜像文件中的内核镜像文件校验成功,引导备份系统镜像文件中的内核镜像文件到内存运行,挂载根文件系统,结束启动流程。If the kernel image file in the main system image file fails to be verified, and the kernel image file in the backup system image file succeeds in being verified, the kernel image file in the backup system image file is booted to the memory for execution, the root file system is mounted, and the startup process ends. 4.根据权利要求1-3中任一项所述的基于乒乓机制的嵌入式Linux主备操作系统启动方法,其特征在于,还包括:4. The method for starting an embedded Linux active/standby operating system based on a ping-pong mechanism according to any one of claims 1 to 3, characterized in that it further comprises: 系统启动后在空闲状态时获取校验记录;After the system is started, the verification record is obtained in the idle state; 如所述校验记录包含校验失败的校验结果,根据所述校验结果中系统标识和镜像文件名称获取校验失败的镜像文件在flash存储区的位置;If the verification record includes a verification result of a verification failure, obtaining the location of the image file that failed the verification in the flash storage area according to the system identifier and the image file name in the verification result; 对校验失败的镜像文件进行修复。Repair the image file that failed the verification. 5.根据权利要求4所述的基于乒乓机制的嵌入式Linux主备操作系统启动方法,其特征在于,采用fdisk工具对校验失败的镜像文件进行修复。5. The method for starting an embedded Linux active/standby operating system based on a ping-pong mechanism according to claim 4, characterized in that the image file that fails verification is repaired using the fdisk tool. 6.基于乒乓机制的嵌入式Linux主备操作系统启动装置,其特征在于,应用所述嵌入式系统的微处理器芯片内部ROM中包含主系统的ROMCODE和备份系统的ROMCODE;应用所述嵌入式系统的架构包括flash存储区,所述flash存储区设置主区域和备份区域,所述主区域配置主系统镜像文件,所述备份区域配置备份系统镜像文件;所述装置包括:6. An embedded Linux main-backup operating system startup device based on a ping-pong mechanism, characterized in that the internal ROM of a microprocessor chip using the embedded system contains a ROMCODE of a main system and a ROMCODE of a backup system; the architecture of the embedded system using the embedded system includes a flash storage area, the flash storage area is provided with a main area and a backup area, the main area is configured with a main system image file, and the backup area is configured with a backup system image file; the device comprises: ROMCODE启动模块,用于执行主系统的ROMCODE和备份系统的ROMCODE;ROMCODE startup module, used to execute the ROMCODE of the main system and the ROMCODE of the backup system; 第一校验模块,用于校验主系统镜像文件中的二级引导程序镜像文件和备份系统镜像文件中的二级引导程序镜像文件;将校验结果保存至校验记录中;所述校验结果包括:系统标识、镜像文件名称和校验成功或失败标识;The first verification module is used to verify the secondary boot program image file in the main system image file and the secondary boot program image file in the backup system image file; and save the verification result to the verification record; the verification result includes: system identification, image file name and verification success or failure identification; 第一启动模块,用于如主系统镜像文件中的二级引导程序镜像文件校验成功,启动主系统镜像文件中的二级引导程序镜像文件;如备份系统镜像文件中的二级引导程序镜像文件校验成功,启动备份系统镜像文件中的二级引导程序镜像文件。The first startup module is used to start the secondary boot program image file in the main system image file if the secondary boot program image file in the main system image file is verified successfully; if the secondary boot program image file in the backup system image file is verified successfully, start the secondary boot program image file in the backup system image file. 7.根据权利要求6所述的基于乒乓机制的嵌入式Linux主备操作系统启动装置,其特征在于,还包括:7. The embedded Linux main and standby operating system startup device based on the ping-pong mechanism according to claim 6, characterized in that it also includes: 第二校验模块,用于校验主系统镜像文件中的Uboot镜像文件和备份系统镜像文件中的Uboot镜像文件;将校验结果保存至校验记录中;The second verification module is used to verify the Uboot image file in the main system image file and the Uboot image file in the backup system image file; and save the verification result to the verification record; 第二启动模块,用于如主系统镜像文件中的Uboot镜像文件校验成功,启动主系统镜像文件中的Uboot镜像文件;如备份系统镜像文件中的Uboot镜像文件校验成功,启动备份系统镜像文件中的Uboot镜像文件。The second startup module is used to start the Uboot image file in the main system image file if the Uboot image file in the main system image file is successfully verified; if the Uboot image file in the backup system image file is successfully verified, start the Uboot image file in the backup system image file. 8.根据权利要求7所述的基于乒乓机制的嵌入式Linux主备操作系统启动装置,其特征在于,还包括:8. The embedded Linux main and standby operating system startup device based on the ping-pong mechanism according to claim 7, characterized in that it also includes: 第三校验模块,用于校验主系统镜像文件中的内核镜像文件和备份系统镜像文件中的内核镜像文件;将校验结果保存至校验记录中;The third verification module is used to verify the kernel image file in the main system image file and the kernel image file in the backup system image file; and save the verification result to the verification record; 第三启动模块,用于如主系统镜像文件中的内核镜像文件校验成功,引导主系统镜像文件中的内核镜像文件到内存运行,挂载根文件系统,结束启动流程;如主系统镜像文件中的内核镜像文件校验失败,且备份系统镜像文件中的内核镜像文件校验成功,引导备份系统镜像文件中的内核镜像文件到内存运行,挂载根文件系统,结束启动流程。The third startup module is used to, if the kernel image file in the main system image file is successfully verified, guide the kernel image file in the main system image file to the memory to run, mount the root file system, and end the startup process; if the kernel image file in the main system image file fails to be verified and the kernel image file in the backup system image file is successfully verified, guide the kernel image file in the backup system image file to the memory to run, mount the root file system, and end the startup process. 9.根据权利要求6-8中任一项所述的基于乒乓机制的嵌入式Linux主备操作系统启动装置,其特征在于,还包括:9. The embedded Linux active/standby operating system startup device based on the ping-pong mechanism according to any one of claims 6 to 8, characterized in that it also includes: 修复模块,用于在系统启动后在空闲状态时获取校验记录;如所述校验记录包含校验失败的校验结果,根据所述校验结果中系统标识和镜像文件名称获取校验失败的镜像文件在flash存储区的位置;。A repair module is used to obtain a verification record in an idle state after the system is started; if the verification record contains a verification result of a verification failure, the location of the image file that failed the verification in the flash storage area is obtained according to the system identifier and the image file name in the verification result;. 10.根据权利要求9所述的基于乒乓机制的嵌入式Linux主备操作系统启动装置,其特征在于,所述修复模块采用fdisk工具对校验失败的镜像文件进行修复。10. The embedded Linux active-standby operating system startup device based on the ping-pong mechanism according to claim 9, characterized in that the repair module uses the fdisk tool to repair the image file that fails verification.
CN202411607028.1A 2024-11-12 2024-11-12 Method and device for starting embedded Linux main and standby operating systems based on ping-pong mechanism Active CN119557009B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411607028.1A CN119557009B (en) 2024-11-12 2024-11-12 Method and device for starting embedded Linux main and standby operating systems based on ping-pong mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411607028.1A CN119557009B (en) 2024-11-12 2024-11-12 Method and device for starting embedded Linux main and standby operating systems based on ping-pong mechanism

Publications (2)

Publication Number Publication Date
CN119557009A true CN119557009A (en) 2025-03-04
CN119557009B CN119557009B (en) 2025-09-26

Family

ID=94764121

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411607028.1A Active CN119557009B (en) 2024-11-12 2024-11-12 Method and device for starting embedded Linux main and standby operating systems based on ping-pong mechanism

Country Status (1)

Country Link
CN (1) CN119557009B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013186692A (en) * 2012-03-08 2013-09-19 Hitachi Systems Ltd Virtual machine providing system
CN108647119A (en) * 2018-05-16 2018-10-12 杭州海兴电力科技股份有限公司 The startup method, apparatus and equipment of linux system
CN113485764A (en) * 2021-07-05 2021-10-08 珠海格力电器股份有限公司 Embedded system, control method and device thereof and storage medium
CN118426848A (en) * 2024-04-30 2024-08-02 北京东土军悦科技有限公司 Operating system starting method and device, computing equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013186692A (en) * 2012-03-08 2013-09-19 Hitachi Systems Ltd Virtual machine providing system
CN108647119A (en) * 2018-05-16 2018-10-12 杭州海兴电力科技股份有限公司 The startup method, apparatus and equipment of linux system
CN113485764A (en) * 2021-07-05 2021-10-08 珠海格力电器股份有限公司 Embedded system, control method and device thereof and storage medium
CN118426848A (en) * 2024-04-30 2024-08-02 北京东土军悦科技有限公司 Operating system starting method and device, computing equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
桑赫;林岩;张烽;: "嵌入式系统硬件平台的启动方式研究", 单片机与嵌入式系统应用, no. 12, 1 December 2015 (2015-12-01) *

Also Published As

Publication number Publication date
CN119557009B (en) 2025-09-26

Similar Documents

Publication Publication Date Title
CN101329632B (en) Method and apparatus for starting CPU by BOOT
CN106775610B (en) Electronic equipment starting method and electronic equipment
CN103902399B (en) Software system repair processing method and software system repair processing device
US20110173691A1 (en) Method for downloading software
CN115237644B (en) System fault processing method, central operation unit and vehicle
CN101221508A (en) Method and device for starting equipment
CN101556547A (en) Safe method and system used for remotely upgrading embedded Linux kernel
CN111143132A (en) BIOS recovery method, device, equipment and readable storage medium
CN112433769A (en) BMC starting method and device, computer equipment and storage medium
CN113867807A (en) Method, device, equipment and storage medium for shortening power-on time of server
CN110928726A (en) Embedded system self-recovery method and system based on watchdog and PXE
CN117130672A (en) Server startup process control method, system, terminal and storage medium
CN116010211A (en) Monitoring method, system, electronic equipment and medium for preventing startup from being stuck
CN104657232A (en) BIOS automatic recovery system and BIOS automatic recovery method
CN111090546B (en) Method, device and equipment for restarting operating system and readable storage medium
CN101739315A (en) System and method for automatically starting backup firmware
CN116185510A (en) Partition switch starting method, array server and computer readable storage medium
CN119557009B (en) Method and device for starting embedded Linux main and standby operating systems based on ping-pong mechanism
CN109783150A (en) A kind of anti-brick method and device of embedded system starting
CN114995852A (en) Device upgrade method, device and computer-readable storage medium
CN114741091A (en) Firmware loading method and device, electronic equipment and computer readable storage medium
CN102012823A (en) Method and device for quickly restarting computer
CN102402447A (en) Equipment starting method and equipment
CN100394392C (en) Automatic starting control method and system for computer program recovery mode
CN117389598A (en) Configuration update and hardening methods, devices, electronic equipment and storage media

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