Firmware starting method and device, equipment and storage medium

By obtaining server information during firmware startup and storing and reading according to the startup stage type, the problem of cumbersome firmware startup steps in the prior art is solved, and more efficient firmware operation is achieved.

CN119557010APending Publication Date: 2025-03-04INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411607506.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

In the process of starting the server firmware, the existing technology requires frequent search of HOB or PCD lists. The steps are cumbersome and some startup stages cannot be used, resulting in inefficiency.

Method used

By obtaining the server information corresponding to the firmware, and storing the information to the target area according to the type of the current startup stage, the submodules are run in turn to read and write information to determine the configuration and start the corresponding submodule.

Benefits of technology

It simplifies the acquisition and storage process of server information, reduces development complexity, streamlines the amount of code, and improves firmware operation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557010A_ABST
    Figure CN119557010A_ABST
Patent Text Reader

Abstract

The invention provides a firmware starting method and device, equipment and a storage medium. The method comprises the steps that server information corresponding to firmware is acquired; obtaining a starting type of a current starting stage, and storing the server information to a target area of the current starting stage according to the starting type; sequentially running one or more sub-modules in the current starting stage, reading server information in the target area, and determining configuration corresponding to the one or more sub-modules according to the server information; and according to the configuration, sequentially starting one or more sub-modules in the current starting stage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a firmware startup method, device, equipment and storage medium. Background Art

[0002] With the rapid development of cloud computing technology and the Internet industry, servers are increasingly widely used in practical applications, especially in large data centers, cloud computing bases, and other occasions. Tens of thousands or even hundreds of thousands of servers are often deployed in a data center, and there are many types and categories of server models corresponding to the same generation of chips. Different types of server models correspond to different settings or different codes at each stage of firmware startup, so it is necessary to identify the server information at each stage. In the prior art, a HOB (Hand-Off Block) or PCD (Platform Configuration Database) is usually created, information is stored in it, and information is transmitted through the HOB or PCD. However, this method requires searching the HOB list or PCD list each time, which is cumbersome and the HOB or PCD cannot be used in some startup stages.

[0003] Therefore, in view of the shortcomings of the prior art solutions, the present invention provides a firmware startup method. Summary of the invention

[0004] Based on this, it is necessary to provide a firmware startup method, device, equipment and storage medium to address the above technical problems.

[0005] On the one hand, a firmware startup method is provided, the method comprising: obtaining server information corresponding to the firmware; obtaining the startup type of the current startup phase, and storing the server information to a target area of ​​the current startup phase according to the startup type; sequentially running one or more sub-modules of the current startup phase, reading the server information in the target area, and determining the configuration corresponding to the one or more sub-modules according to the server information; and sequentially starting the one or more sub-modules of the current startup phase according to the configuration.

[0006] Optionally, the startup type includes a first startup stage and a second startup stage, and obtaining the startup type of the current startup stage and storing the server information in a target area of ​​the current startup stage according to the startup type includes: in response to the current startup stage being of the first startup stage, traversing a storage unit list, determining a target storage unit, and obtaining the server information corresponding to the firmware from the target storage unit; obtaining the storage area of ​​a first global variable of the first startup stage, and writing the server information in a target area of ​​the storage area of ​​the first global variable; in response to the current startup stage being of the second startup stage, obtaining the server information corresponding to the firmware from the global variables of the first startup stage; obtaining the storage area of ​​a second global variable of the second startup stage, and writing the server information in a second target area of ​​the storage area of ​​the second global variable.

[0007] Optionally, before acquiring the server information corresponding to the firmware, the method further includes: acquiring the server information corresponding to the firmware through a bus, and storing the server information in the target storage unit.

[0008] Optionally, obtaining the storage area of ​​the first global variable in the first startup phase and writing the server information in a target area of ​​the storage area of ​​the first global variable, and / or obtaining the storage area of ​​the second global variable in the second startup phase and writing the server information in a second target area of ​​the storage area of ​​the second global variable, includes: obtaining the storage area of ​​the global variables in the current startup phase and determining a header of the storage area of ​​the global variables; determining a reserved area in the header based on the header of the storage area of ​​the global variables and using the reserved area as the target area; and writing the server information in the target area.

[0009] Optionally, the first startup phase includes a first sub-startup phase and a second sub-startup phase, the storage area of ​​the global variable cannot be written in the first sub-startup phase, and the storage area of ​​the global variable can be written in the second sub-startup phase, and the method also includes: in response to the type of the sub-startup phase being the first sub-startup phase, sequentially running one or more sub-modules of the first sub-startup phase, traversing the storage unit list, determining the target storage unit, obtaining server information corresponding to the firmware from the target storage unit, and determining the configuration corresponding to the one or more sub-modules according to the server information; in response to the type of the sub-startup phase being the second sub-startup phase, traversing the storage unit list, determining the target storage unit, and obtaining the server information corresponding to the firmware from the target storage unit; obtaining the storage area of ​​the first global variable of the first startup phase, writing the server information in the target area of ​​the storage area of ​​the first global variable, sequentially running one or more sub-modules of the second sub-startup phase, reading the server information in the target area, and determining the configuration corresponding to the one or more sub-modules according to the server information.

[0010] Optionally, the method also includes: when the type of the current startup phase is the second startup phase, comparing the first verification code in the storage area of ​​the global variable of the second startup phase and the second verification code in the target storage unit; when the first verification code and the second verification code are the same, determining the configuration corresponding to one or more sub-modules of the second startup phase according to the server information.

[0011] Optionally, the sequentially running one or more sub-modules of the current startup phase to read the server information in the target area includes: presetting a read instruction; sequentially running one or more sub-modules, and reading the target area in the storage area of ​​the global variables passed in by the one or more sub-module interfaces through the read instruction to obtain the server information.

[0012] On the other hand, a firmware startup device is provided, the device comprising: an acquisition module, used to acquire the type of the current startup stage, wherein the type of the current startup stage comprises a first startup stage and a second startup stage; a storage module, used to acquire the startup type of the current startup stage, and store the server information to a target area of ​​the current startup stage according to the startup type; a first processing module, used to sequentially run one or more sub-modules of the current startup stage, read the server information in the target area, and determine the configuration corresponding to the one or more sub-modules according to the server information; and a second processing module, used to sequentially start the one or more sub-modules of the current startup stage according to the configuration.

[0013] On the other hand, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: obtaining server information corresponding to the firmware; obtaining the startup type of the current startup phase, and storing the server information to a target area of ​​the current startup phase according to the startup type; sequentially running one or more sub-modules of the current startup phase, reading the server information in the target area, and determining configurations corresponding to the one or more sub-modules according to the server information; and sequentially starting the one or more sub-modules of the current startup phase according to the configuration.

[0014] On the other hand, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: obtaining server information corresponding to the firmware; obtaining the startup type of the current startup phase, and storing the server information to the target area of ​​the current startup phase according to the startup type; sequentially running one or more sub-modules of the current startup phase, reading the server information in the target area, and determining the configuration corresponding to the one or more sub-modules according to the server information; and sequentially starting the one or more sub-modules of the current startup phase according to the configuration.

[0015] The above-mentioned firmware startup method, device, equipment and storage medium, the method includes: obtaining server information corresponding to the firmware; obtaining the startup type of the current startup stage, and storing the server information to the target area of ​​the current startup stage according to the startup type; running one or more sub-modules of the current startup stage in sequence, reading the server information in the target area, and determining the configuration corresponding to the one or more sub-modules according to the server information; according to the configuration, starting one or more sub-modules of the current startup stage in sequence; in this way, the server information can be easily obtained at each stage, reducing the complexity of development, streamlining the amount of code, and improving the efficiency of firmware operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A schematic diagram of a firmware startup method in one embodiment;

[0017] Figure 2 A schematic diagram of a startup process of the PEI phase of a firmware startup method in an embodiment;

[0018] Figure 3 A schematic diagram of the startup process at each stage of a firmware startup method in an embodiment;

[0019] Figure 4 is a structural block diagram of a firmware startup device in an embodiment;

[0020] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0022] It should be understood that in the description of the present application, unless the context clearly requires otherwise, words such as "include", "comprises", and the like throughout the specification should be interpreted as including rather than being exclusive or exhaustive; that is, as including but not limited to.

[0023] It should also be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, "plurality" means two or more.

[0024] It should be noted that the terms "S1", "S2", etc. are only used for the purpose of describing the steps, and do not specifically refer to the order or sequence, nor are they used to limit the present application. They are only for the convenience of describing the method of the present application, and cannot be understood as indicating the order of the steps. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present application.

[0025] In one embodiment, Figure 1 As shown, a firmware startup method is provided, comprising the following steps:

[0026] S101: Obtain server information corresponding to the firmware.

[0027] Here, the server information may include model information, color, etc. The firmware may be UEFI (Unified Extensible Firmware Interface) BIOS (Basic Input Output System) firmware.

[0028] S102: Acquire a startup type of a current startup phase, and store the server information in a target area of ​​the current startup phase according to the startup type.

[0029] Here, the startup phase includes PEI (Pre-EFI Initialization), DXE (Dynamic Executable), SMM (System management mode), BDS (Boot Device Selection) and RT (RUNTIME).

[0030] S103: running one or more submodules of the current startup phase in sequence, reading server information in the target area, and determining configurations corresponding to the one or more submodules according to the server information.

[0031] Here, assuming that the startup phase is the PEI phase, the corresponding submodules may include PEI-M 1-1, PEI-M 1-2, and the like.

[0032] S104: According to the configuration, start one or more sub-modules of the current startup phase in sequence.

[0033] It should be noted that this application can easily obtain server information at each stage, reduce the complexity of development, streamline the amount of code, and improve the efficiency of firmware operation.

[0034] In some specific implementations, the startup type includes a first startup stage and a second startup stage, and obtaining the startup type of the current startup stage and storing the server information in a target area of ​​the current startup stage according to the startup type includes:

[0035] In response to the type of the current startup phase being the first startup phase, traversing the storage unit list, determining a target storage unit, and acquiring server information corresponding to the firmware from the target storage unit;

[0036] Acquire a storage area of ​​a first global variable in the first startup phase, and write the server information into a target area of ​​the storage area of ​​the first global variable;

[0037] In response to the type of the current startup phase being the second startup phase, acquiring server information corresponding to the firmware from the global variables of the first startup phase;

[0038] A storage area of ​​a second global variable in the second startup phase is obtained, and the server information is written into a second target area of ​​the storage area of ​​the second global variable.

[0039] Here, the first startup phase may include a PEI phase and a DXE phase, and the second startup phase may include an SMM phase, a BDS phase, and an RT phase; different startup phases correspond to different global variables.

[0040] Among them, the storage area of ​​the first global variable can be the storage area of ​​the global variables in the PEI stage, that is, the storage area of ​​EFI_PEI_SERVICES, and the storage area of ​​the second global variable can be the storage area of ​​the global variables in the DXE, SMM, BDS or RT stage, that is, the storage area of ​​EFI_SYSTEM_TABLE.

[0041] Specifically, when the current startup stage is the first type of startup stage, you can call the service function GetHobList to traverse the HOB list, obtain the custom HOB including server information, and save the server information to the target area of ​​the current startup stage; when the current startup stage is the second type of startup stage, the server information of the previous startup stage is copied through the scheduler of the current startup stage and stored in the target area of ​​the current startup stage.

[0042] In one embodiment, the startup process of a firmware may include multiple second startup stages, such as startup stage A, startup stage B, startup stage C, etc. The startup stages are sorted according to the startup order, startup stage B is after startup stage A, and startup stage C is after startup stage B. Among them, startup stage A can obtain server information from the storage area of ​​the global variables of the first startup stage, startup stage B can obtain server information from the storage area of ​​the global variables of the A startup stage, and correspondingly, startup stage C can obtain server information from the storage area of ​​the global variables of the C startup stage.

[0043] In this way, server information is obtained in different ways according to the type of the startup phase.

[0044] In some specific implementations, before obtaining the server information corresponding to the firmware, the method further includes:

[0045] The server information corresponding to the firmware is obtained through the bus, and the server information is stored in the target storage unit.

[0046] Here, the target storage unit may be a HOB with a user-defined name. HOB is a data block used for handover and is used to transfer system information between different parts in the pre-startup phase.

[0047] Specifically, server information is usually stored in the EEPROM of the I2C interface on the motherboard, which is connected to the CPU via I2C. During the startup process, BIOS reads the server information via I2C through the I2C service function, creates a HOB with a user-defined name, and saves the server information.

[0048] In some specific implementations, the acquiring a storage area of ​​a first global variable in the first startup phase, and writing the server information in a target area of ​​the storage area of ​​the first global variable, and / or the acquiring a storage area of ​​a second global variable in the second startup phase, and writing the server information in a second target area of ​​the storage area of ​​the second global variable, includes:

[0049] Acquire the storage area of ​​the global variables in the current startup phase, and determine the header of the storage area of ​​the global variables;

[0050] According to the header of the storage area of ​​the global variable, a reserved area in the header is determined, and the reserved area is used as the target area;

[0051] Write the server information in the target area.

[0052] Here, the content in the reserved area is blank. The storage area of ​​the global variables in each startup phase includes a blank reserved area.

[0053] Exemplarily, EFI_TABLE_HEADER is defined in the UEFI specification as follows:

[0054]

[0055] Specifically, assuming that the current startup stage is the PEI stage, the global variable of the PEI stage is EFI_PEI_SERVICES, the header of the storage area of ​​the global variable is EFI_TABLE_HEADER Hdr, the reserved area in the header is UINT32Reserved, and the server information is written in the reserved area.

[0056] In one embodiment, the first submodule in the current startup phase may execute the step of writing and storing the server information in the target area of ​​the storage area of ​​the global variable. For example, if the current startup phase is DXE, the submodule that executes the storage step is DXE-M 1-1, and the subsequent submodules DXE-M 1-2, DXE-M 1-n, etc., directly execute the operation of obtaining the storage information and performing the configuration.

[0057] In this way, the server information is written in the reserved area of ​​the storage area of ​​the global variable without customizing a new area. The operation is simple and avoids the problem that some systems cannot handle the customized area.

[0058] In some specific implementations, the first startup phase includes a first sub-startup phase and a second sub-startup phase, the storage area of ​​the global variable cannot be written in the first sub-startup phase, and the storage area of ​​the global variable can be written in the second sub-startup phase, and the method further includes:

[0059] In response to the type of the sub-startup phase being the first sub-startup phase, sequentially running one or more sub-modules of the first sub-startup phase, traversing the storage unit list, determining the target storage unit, obtaining server information corresponding to the firmware from the target storage unit, and determining configurations corresponding to the one or more sub-modules according to the server information;

[0060] In response to the type of the sub-startup phase being the second sub-startup phase, traverse the storage unit list, determine the target storage unit, and obtain the server information corresponding to the firmware from the target storage unit; obtain the storage area of ​​the first global variable of the first startup phase, write the server information in the target area of ​​the storage area of ​​the first global variable, run one or more sub-modules of the second sub-startup phase in sequence, read the server information in the target area, and determine the configuration corresponding to the one or more sub-modules according to the server information.

[0061] Here, the first startup stage can be the PEI stage, and the PEI stage is specifically divided into the PEI-1 sub-stage and the PEI-2 sub-stage; in the PEI-1 stage (i.e., the stage before memory initialization), the code of the BIOS PEI stage runs on the FLASH, and the global variables defined in PEI-M are only readable but not writable; in the PEI-2 stage (the stage after memory initialization), after the code of the BIOS PEI stage is copied to the memory, the corresponding code runs in the memory, and the global variables defined in PEI-M are readable and can be rewritten.

[0062] The first startup phase may also be a DXE phase, and all submodules in the DXE are submodules of the second sub-startup phase.

[0063] Specifically, if the current startup stage is the first startup stage (i.e., the PEI stage), in the PEI-1 stage, the server information is obtained from I2C, an OEMGUID HOB is created and the server information is saved. When the sub-module PEI-M 1-n of the PEI-1 stage determines the server information, the GetHobList service is called to find the OEMGUID HOB and the saved server information is read; in the PEI-2 stage, the GetHobList service is called to find the OEMGUID HOB and the saved server information is read; the model configuration information is saved in the UINT32 Reserved area corresponding to Hdr in EFI_PEI_SERVICES; when the sub-module PEI-M 2-n of the PEI-2 stage determines the server information, the server information is obtained by reading the parameter (*PeiServices)->Hdr.Reserved passed in at the function entry of the PEI-M module.

[0064] In this way, the method of obtaining the server information is determined according to whether the storage area of ​​the global variable is writable during the startup phase.

[0065] In some specific embodiments, the method further comprises:

[0066] When the type of the current startup phase is the second startup phase, comparing the first check code in the storage area of ​​the global variable of the second startup phase with the second check code in the target storage unit;

[0067] When the first verification code and the second verification code are the same, the configuration corresponding to one or more submodules in the second startup phase is determined according to the server information.

[0068] Here, the first check code and the second check code may be CRC32 (cyclic redundancy check) codes or other check codes.

[0069] In this way, the correctness of the transmission of server information between different startup stages can be ensured through the verification code.

[0070] In some specific implementations, sequentially running one or more submodules of the current startup phase to read server information in the target area includes:

[0071] Preset read instructions;

[0072] One or more sub-modules are run in sequence, and through the read instruction, a target area in the storage area of ​​the global variable transmitted by the one or more sub-module interfaces is read to obtain the server information.

[0073] Here, the read instruction is used to read the content of the target area.

[0074] Specifically, when a submodule DXE-M of DXE is running, the server information is obtained by directly reading (*SystemTable)->Hdr.Reserved contained in the module entry parameter through a read instruction.

[0075] In this way, there is no need to perform a list query and the server information can be directly obtained, which reduces the code size and improves the operating efficiency.

[0076] In some embodiments, the method further comprises:

[0077] Design one or more test cases;

[0078] Through the one or more test cases, test whether the firmware startup process is executed normally.

[0079] Here, the test case is used to detect whether the firmware boot process can be executed normally after writing the server information in the target area of ​​the global variable.

[0080] Among them, a normal startup process may include being able to correctly read and write the target area without affecting other functions; having no problems with interaction with other modules and system components; having no abnormalities from cold start to operating system loading; and being able to execute normally in multiple environments.

[0081] Specifically, it can be used to detect whether the firmware startup process is executed normally on different versions of firmware, whether the firmware startup process is executed normally on different hardware platforms, and whether the firmware startup process is executed normally in different operating systems.

[0082] In this way, changing the fields in the reserved area may break compatibility with other firmware components, and needs to be tested through test cases to ensure that this practice does not affect the stability and security of the system.

[0083] In one embodiment, firmware startup may include the following process:

[0084] S1: PEI-1 stage, directly obtain model information from I2C, create OEMGUID HOB and save model information;

[0085] S2: The first PEI-M in the PEI-2 stage calls the I2C service function to obtain the model configuration information. Because PEI-M is already running in the memory, it saves the model configuration information to the UINT32Reserved area corresponding to Hdr in EFI_PEI_SERVICES. The process implemented in C language is as follows:

[0086]

[0087] S3: Other PEI-Ms after PEI-2. Directly read the model configuration information when using

[0088]

[0089] Specifically, Figure 2 Schematic diagram of the PEI stage startup process in the embodiment of the present application, such as Figure 2 As shown, the PEI stage startup process in the present application includes: SEC stage; PEI stage starts; PEI stage scheduler starts; running each PEI attribute module of PEI-1 stage; memory initialization module of PEI-1 stage; memory is available; copying PEI module of PEI-2 stage to memory; running PEI module of PEI-2 stage; end of PEI stage. Among them, running each PEI attribute module in the PEI-1 stage specifically includes: calling the I2C service function to obtain the model configuration information (i.e., server information), creating an OEMGUID HOB (i.e., target transfer unit), and saving the model configuration information to the HOB; calling the GetHobList service, searching for the OEMGUID HOB, and reading the saved model configuration information; running each PEI attribute module in the PEI-1 stage specifically includes: calling the GetHobList service, searching for the OEMGUID HOB, and reading the saved model configuration information; saving the model configuration information to the UINT32 Reserved area (i.e., target area) corresponding to Hdr in EFI_PEI_SERVICES; reading the parameter (*PeiServices)->Hdr.Reserved passed in at the PEI-M module function entry to obtain the model configuration information.

[0090] S4: DXE stage, when the first DXE-M module is executed, the service function GetHobList is called and the corresponding OEMGUID name is searched to obtain the model information, and the model configuration information is saved to the UINT32 Reserved area corresponding to Hdr in EFI_SYSTEM_TABLE.

[0091]

[0092]

[0093] S4: When other modules are running in the DXE, SMM, and RUNTIME stages, the module entry parameters of the DXE, SMM, and RUNTIME modules all contain the EFI_SYSTEM_TABLE variable, and the parameter EFI_SYSTEM_TABLE->Hdr.Reserved passed in by the DXE-M / SMM-M / RT-M module function entry is read to obtain the model configuration information

[0094]

[0095] Specifically, Figure 3 Schematic diagram of the startup process of each stage in the embodiment of this application, such as Figure 3 As shown, the startup process of each stage includes: the DXE stage starts; the DXE stage scheduler starts; the various DXE modules of the DXE stage are run; the DXE stage ends; the SMM stage starts; the SMM stage scheduler starts; the various SMM modules of the SMM stage are run; the SMM stage ends; the BDS stage starts; the BDS stage scheduler starts; the various DXE modules of the BDS stage are run; the BDS stage ends; the RUNTIME stage starts; the various RT modules of the RUNTIME stage are run; and the OS.

[0096] Specifically, the various DXE modules running the DXE stage include: calling the GetHobList service, searching for OEMGUIDHOB, and reading the saved model configuration information; saving the model configuration information to the UINT32 Reserved area corresponding to Hdr in EFI_SYSTEM_TABLE; reading the parameter EFI_SYSTEM_TABLE->Hdr.Reserved passed in by the DXE-M module function entry to obtain the model configuration information.

[0097] Specifically, running each SMM module in the SMM phase includes: reading the parameter EFI_SYSTEM_TABLE->Hdr.Reserved passed in by the SMM-M module function entry to obtain the model configuration information.

[0098] Specifically, running each DXE module in the BDS stage includes: reading the parameter EFI_SYSTEM_TABLE->Hdr.Reserved passed in by the DXE-M module function entry to obtain the model configuration information.

[0099] Specifically, running each RT module in the RUNTIME phase includes: reading the parameter EFI_SYSTEM_TABLE->Hdr.Reserved passed in by the RT-M module function entry to obtain the model configuration information.

[0100] It should be understood that although Figure 1-3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-3At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0101] In one embodiment, Figure 4 As shown, a firmware startup device is provided, the device comprising: an acquisition module 401, used to acquire the type of the current startup stage, wherein the type of the current startup stage comprises a first startup stage and a second startup stage; a storage module 402, used to acquire the startup type of the current startup stage, and store the server information to a target area of ​​the current startup stage according to the startup type; a first processing module 403, used to sequentially run one or more sub-modules of the current startup stage, read the server information in the target area, and determine the configuration corresponding to the one or more sub-modules according to the server information; a second processing module 404, used to sequentially start the one or more sub-modules of the current startup stage according to the configuration.

[0102] As a preferred implementation, in an embodiment of the present application, the startup type includes a first startup stage and a second startup stage, and the storage module 402 is specifically used to: in response to the type of the current startup stage being the first startup stage, traverse the storage unit list, determine the target storage unit, and obtain the server information corresponding to the firmware from the target storage unit; obtain the storage area of ​​the first global variable of the first startup stage, and write the server information in the target area of ​​the storage area of ​​the first global variable; in response to the type of the current startup stage being the second startup stage, obtain the server information corresponding to the firmware from the global variables of the first startup stage; obtain the storage area of ​​the second global variable of the second startup stage, and write the server information in the second target area of ​​the storage area of ​​the second global variable.

[0103] As a preferred implementation, in the embodiment of the present application, the device also includes a third processing module, and the third processing module is specifically used to: obtain server information corresponding to the firmware through a bus, and store the server information in the target storage unit.

[0104] As a preferred implementation, in an embodiment of the present application, the storage module 402 is specifically used to: obtain the storage area of ​​the global variables in the current startup phase, and determine the header of the storage area of ​​the global variables; determine the reserved area in the header according to the header of the storage area of ​​the global variables, and use the reserved area as the target area; and write server information in the target area.

[0105] As a preferred implementation, in an embodiment of the present application, the first startup phase includes a first sub-startup phase and a second sub-startup phase. The storage area of ​​the global variable cannot be written in the first sub-startup phase, and the storage area of ​​the global variable can be written in the second sub-startup phase. The device also includes a fifth processing module, and the fifth processing module is specifically used to: in response to the type of the sub-startup phase being the first sub-startup phase, sequentially run one or more sub-modules of the first sub-startup phase, traverse the storage unit list, determine the target storage unit, obtain the server information corresponding to the firmware from the target storage unit, and determine the configuration corresponding to the one or more sub-modules according to the server information; in response to the type of the sub-startup phase being the second sub-startup phase, traverse the storage unit list, determine the target storage unit, and obtain the server information corresponding to the firmware from the target storage unit; obtain the storage area of ​​the first global variable of the first startup phase, write the server information in the target area of ​​the storage area of ​​the first global variable, sequentially run one or more sub-modules of the second sub-startup phase, read the server information in the target area, and determine the configuration corresponding to the one or more sub-modules according to the server information.

[0106] As a preferred implementation, in an embodiment of the present application, the device also includes a sixth processing module, which is specifically used to: when the type of the current startup phase is the second startup phase, compare the first verification code in the storage area of ​​the global variable of the second startup phase with the second verification code in the target storage unit; when the first verification code and the second verification code are the same, determine the configuration corresponding to one or more sub-modules of the second startup phase according to the server information.

[0107] As a preferred implementation, in an embodiment of the present application, the first processing module 403 is specifically used to: preset a read instruction; run one or more sub-modules in sequence, and read the target area in the storage area of ​​the global variable passed in by the one or more sub-module interfaces through the read instruction to obtain the server information.

[0108] For the specific definition of the firmware startup device, please refer to the definition of the firmware startup method above, which will not be repeated here. Each module in the above-mentioned firmware startup device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0109] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a firmware startup method is implemented.

[0110] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0111] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: S1: obtaining server information corresponding to a firmware; S2: obtaining a startup type of a current startup phase, and storing the server information to a target area of ​​the current startup phase according to the startup type; S3: sequentially running one or more submodules of the current startup phase, reading the server information in the target area, and determining configurations corresponding to the one or more submodules according to the server information; S4: sequentially starting one or more submodules of the current startup phase according to the configuration.

[0112] In one embodiment, the processor further implements the following steps when executing the computer program: in response to the type of the current startup stage being the first startup stage, traverse the storage unit list, determine the target storage unit, and obtain the server information corresponding to the firmware from the target storage unit; obtain the storage area of ​​the first global variable of the first startup stage, and write the server information in the target area of ​​the storage area of ​​the first global variable; in response to the type of the current startup stage being the second startup stage, obtain the server information corresponding to the firmware from the global variables of the first startup stage; obtain the storage area of ​​the second global variable of the second startup stage, and write the server information in the second target area of ​​the storage area of ​​the second global variable.

[0113] In one embodiment, when the processor executes the computer program, the following steps are further implemented: obtaining server information corresponding to the firmware through a bus, and storing the server information in the target storage unit.

[0114] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining the storage area of ​​the global variables in the current startup phase, and determining the header of the storage area of ​​the global variables; determining the reserved area in the header according to the header of the storage area of ​​the global variables, and using the reserved area as the target area; and writing the server information in the target area.

[0115] In one embodiment, when the processor executes the computer program, the following steps are also implemented: in response to the type of the sub-startup phase being the first sub-startup phase, one or more sub-modules of the first sub-startup phase are sequentially executed, the storage unit list is traversed, the target storage unit is determined, the server information corresponding to the firmware is obtained from the target storage unit, and the configuration corresponding to the one or more sub-modules is determined according to the server information; in response to the type of the sub-startup phase being the second sub-startup phase, the storage unit list is traversed, the target storage unit is determined, and the server information corresponding to the firmware is obtained from the target storage unit; the storage area of ​​the first global variable of the first startup phase is obtained, the server information is written in the target area of ​​the storage area of ​​the first global variable, one or more sub-modules of the second sub-startup phase are sequentially executed, the server information in the target area is read, and the configuration corresponding to the one or more sub-modules is determined according to the server information.

[0116] In one embodiment, when the processor executes the computer program, the following steps are also implemented: when the type of the current startup phase is the second startup phase, the first check code in the storage area of ​​the global variable of the second startup phase and the second check code in the target storage unit are compared; when the first check code and the second check code are the same, the configuration corresponding to one or more sub-modules of the second startup phase is determined according to the server information.

[0117] In one embodiment, when the processor executes the computer program, the following steps are also implemented: presetting a read instruction; running one or more sub-modules in sequence, and reading the target area in the storage area of ​​the global variable passed in by the one or more sub-module interfaces through the read instruction to obtain the server information.

[0118] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: S1: obtaining server information corresponding to the firmware; S2: obtaining the startup type of the current startup phase, and storing the server information to a target area of ​​the current startup phase according to the startup type; S3: sequentially running one or more sub-modules of the current startup phase, reading the server information in the target area, and determining the configuration corresponding to the one or more sub-modules according to the server information; S4: sequentially starting one or more sub-modules of the current startup phase according to the configuration.

[0119] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: in response to the current startup stage being of the first startup stage, traversing the storage unit list, determining the target storage unit, and obtaining the server information corresponding to the firmware from the target storage unit; obtaining the storage area of ​​the first global variable of the first startup stage, and writing the server information in the target area of ​​the storage area of ​​the first global variable; in response to the current startup stage being of the second startup stage, obtaining the server information corresponding to the firmware from the global variables of the first startup stage; obtaining the storage area of ​​the second global variable of the second startup stage, and writing the server information in the second target area of ​​the storage area of ​​the second global variable.

[0120] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: obtaining server information corresponding to the firmware through a bus, and storing the server information in the target storage unit.

[0121] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining the storage area of ​​the global variables in the current startup phase, and determining the header of the storage area of ​​the global variables; determining the reserved area in the header according to the header of the storage area of ​​the global variables, and using the reserved area as the target area; and writing the server information in the target area.

[0122] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: in response to the type of the sub-startup phase being the first sub-startup phase, one or more sub-modules of the first sub-startup phase are sequentially executed, the storage unit list is traversed, the target storage unit is determined, the server information corresponding to the firmware is obtained from the target storage unit, and the configuration corresponding to the one or more sub-modules is determined according to the server information; in response to the type of the sub-startup phase being the second sub-startup phase, the storage unit list is traversed, the target storage unit is determined, and the server information corresponding to the firmware is obtained from the target storage unit; the storage area of ​​the first global variable of the first startup phase is obtained, the server information is written in the target area of ​​the storage area of ​​the first global variable, one or more sub-modules of the second sub-startup phase are sequentially executed, the server information in the target area is read, and the configuration corresponding to the one or more sub-modules is determined according to the server information.

[0123] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the type of the current startup phase is the second startup phase, the first check code in the storage area of ​​the global variable of the second startup phase and the second check code in the target storage unit are compared; when the first check code and the second check code are the same, the configuration corresponding to one or more sub-modules of the second startup phase is determined according to the server information.

[0124] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: presetting a read instruction; running one or more sub-modules in sequence, and reading the target area in the storage area of ​​the global variables passed in by the one or more sub-module interfaces through the read instruction to obtain the server information.

[0125] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0126] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0127] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A firmware startup method, characterized in that: The method comprises: Get the server information corresponding to the firmware; Acquire the startup type of the current startup phase, and store the server information in the target area of ​​the current startup phase according to the startup type; sequentially running one or more submodules of the current startup phase, reading server information in the target area, and determining configurations corresponding to the one or more submodules according to the server information; According to the configuration, one or more submodules of the current startup phase are started in sequence.

2. The firmware startup method according to claim 1, characterized in that: The startup type includes a first startup stage and a second startup stage. The acquiring the startup type of the current startup stage and storing the server information in a target area of ​​the current startup stage according to the startup type includes: In response to the type of the current startup phase being the first startup phase, traversing the storage unit list, determining a target storage unit, and acquiring server information corresponding to the firmware from the target storage unit; Acquire a storage area of ​​a first global variable in the first startup phase, and write the server information into a target area of ​​the storage area of ​​the first global variable; In response to the type of the current startup phase being the second startup phase, acquiring server information corresponding to the firmware from the global variables of the first startup phase; A storage area of ​​a second global variable in the second startup phase is obtained, and the server information is written into a second target area of ​​the storage area of ​​the second global variable.

3. The firmware startup method according to claim 2, characterized in that: Before obtaining the server information corresponding to the firmware, the method further includes: The server information corresponding to the firmware is obtained through the bus, and the server information is stored in the target storage unit.

4. The firmware startup method according to claim 2, characterized in that: The acquiring the storage area of ​​the first global variable in the first startup phase, and writing the server information in a target area of ​​the storage area of ​​the first global variable, and / or acquiring the storage area of ​​the second global variable in the second startup phase, and writing the server information in a second target area of ​​the storage area of ​​the second global variable, comprises: Acquire the storage area of ​​the global variables in the current startup phase, and determine the header of the storage area of ​​the global variables; According to the header of the storage area of ​​the global variable, a reserved area in the header is determined, and the reserved area is used as the target area; Write the server information in the target area.

5. The firmware startup method according to claim 3, characterized in that: The first startup phase includes a first sub-startup phase and a second sub-startup phase, the storage area of ​​the global variable cannot be written in the first sub-startup phase, and the storage area of ​​the global variable can be written in the second sub-startup phase, and the method further includes: In response to the type of the sub-startup phase being the first sub-startup phase, sequentially running one or more sub-modules of the first sub-startup phase, traversing the storage unit list, determining the target storage unit, obtaining server information corresponding to the firmware from the target storage unit, and determining configurations corresponding to the one or more sub-modules according to the server information; In response to the sub-startup phase being the second sub-startup phase, traverse the storage unit list, determine the target storage unit, and obtain the server information corresponding to the firmware from the target storage unit; obtain the storage area of ​​the first global variable of the first startup phase, write the server information in the target area of ​​the storage area of ​​the first global variable, run one or more sub-modules of the second sub-startup phase in sequence, read the server information in the target area, and determine the configuration corresponding to the one or more sub-modules according to the server information.

6. The firmware startup method according to claim 2, characterized in that: The method further comprises: When the type of the current startup phase is the second startup phase, comparing the first check code in the storage area of ​​the global variable of the second startup phase with the second check code in the target storage unit; When the first verification code and the second verification code are the same, the configuration corresponding to one or more submodules in the second startup phase is determined according to the server information.

7. The firmware startup method according to claim 1, characterized in that: The sequentially running one or more submodules of the current startup phase and reading server information in the target area includes: Preset read instructions; One or more sub-modules are run in sequence, and through the read instruction, a target area in the storage area of ​​the global variable transmitted by the one or more sub-module interfaces is read to obtain the server information.

8. A firmware startup device, characterized in that: The device comprises: An acquisition module is used to obtain server information corresponding to the firmware; A storage module, used for obtaining a startup type of a current startup phase, and storing the server information in a target area of ​​the current startup phase according to the startup type; A first processing module, configured to sequentially run one or more submodules of the current startup phase, read server information in the target area, and determine configurations corresponding to the one or more submodules; The second processing module is used to start one or more sub-modules of the current startup phase in sequence according to the configuration.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Firmware starting method and device, electronic equipment and machine readable medium

    CN120448189A