Basic input / output system layout information generation method, updating method, and product
By generating a BIOS image containing layout information in the BIOS compiler, external devices can directly parse and perform modular updates, solving the problems of high cost and low efficiency caused by traditional BIOS updates relying on third-party tools, and realizing a flexible, accurate and secure update process.
Patent Information
- Application Number
- PCT/CN2025/084499
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-27
- Filing Date
- 2025-03-24
- Publication Date
- 2026-01-02
AI Technical Summary
Traditional BIOS update methods rely on specific third-party tools, which are complex and costly, resulting in low update efficiency.
During the BIOS compiler compilation process, the layout variables of each firmware volume are obtained through the layout variable extraction script and stored in the preset layout firmware volume to generate a BIOS image containing layout information. External devices can directly parse the image for modular updates.
It enables flexible modular updates without relying on third-party tools, reducing operational complexity and costs, improving update accuracy and efficiency, and enhancing system security and stability.
Smart Images

Figure CN2025084499_02012026_PF_FP_ABST
Abstract
Description
Basic Input / Output System Layout Information Generation Method, Update Method, and Products
[0001] Cross-reference to related applications
[0002] This application claims priority to Chinese Patent Application No. 202410846340X, filed on June 27, 2024, entitled “Method for generating, updating and product of basic input / output system layout information”, the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application relates to the technical field of BIOS, and more specifically, to a method for generating and updating basic input / output system layout information, and a product thereof. Background Technology
[0004] With the rapid development of computer technology, BIOS (Basic Input / Output System) is a set of programs embedded in a ROM (Read-Only Memory) chip on the motherboard of the computer. It stores the most important basic input / output programs, power-on self-test programs, and system startup programs. It can read and write specific information about system settings from CMOS. Its main function is to provide the lowest level and most direct hardware settings and control for the computer.
[0005] As a crucial part of the computer boot process, the BIOS is particularly important for updating and maintaining. Traditional BIOS update methods often rely on specific third-party tools for parsing and updating, which are complex and limited by third parties, resulting in high BIOS update costs. Summary of the Invention
[0006] This application provides a method for generating and updating basic input / output system layout information, as well as a product, which aims to reduce the cost of BIOS updates.
[0007] In some embodiments of this application, a method for generating basic input / output system layout information is provided, applied to a compiler of a basic input / output system, the method comprising:
[0008] During the compilation process of the compiler of the basic input / output system, the layout variables of each firmware volume in the basic input / output system are obtained. The layout variables include offset, size and attributes.
[0009] The layout variables of each firmware volume in the basic input / output system are stored in a preset layout firmware volume.
[0010] After the compiler of the Basic Input / Output System (PIOS) is completed, it generates a PIOS image containing the layout information of the PIOS.
[0011] In some embodiments of this application, before obtaining the layout variables of each firmware volume in the basic input / output system, the method further includes:
[0012] In response to the first creation operation, a layout firmware volume is created, wherein the layout firmware volume is used to store the layout variables of each firmware volume of the basic input / output system, and is integrated into the basic input / output system image after the compiler of the basic input / output system is completed.
[0013] In some embodiments of this application, after creating the layout firmware volume in response to the first creation operation, the method further includes:
[0014] In response to a position adjustment operation, the position of the layout firmware volume is set to the target position.
[0015] In some embodiments of this application, in response to a position adjustment operation, setting the position of the layout firmware volume to a target position includes:
[0016] In response to the first position adjustment operation, the target position of the layout firmware volume is set at the beginning of the basic input / output system image.
[0017] In some embodiments of this application, in response to a position adjustment operation, setting the position of the layout firmware volume to a target position includes:
[0018] In response to the second position adjustment operation, the target position of the layout firmware volume is set at the end of the basic input / output system image.
[0019] In some embodiments of this application, after creating the layout firmware volume in response to the first creation operation, the method further includes:
[0020] In response to the identifier addition operation, an identification identifier is added to the header file of the layout firmware volume. The identification identifier is used to locate the layout firmware volume.
[0021] In some embodiments of this application, obtaining the layout variables of each firmware volume in the basic input / output system includes:
[0022] Run the layout variable extraction script to capture the layout variable process file of the Basic Input / Output System (PIOS) generated by the PIOS compiler during the compilation process.
[0023] The layout variable extraction script generates layout variables for each firmware volume in the Basic Input / Output System (BIOS) based on the BIOS layout variable process file.
[0024] In some embodiments of this application, after obtaining the layout variables of each firmware volume in the basic input / output system, the method further includes:
[0025] In response to the second creation operation, an executable file creation tool is created;
[0026] During the compilation process, the compiler of the Basic Input / Output System executes the executable file creation tool, calls the layout variable extraction script, and generates the layout variables of each firmware volume in text form based on the layout variables of each firmware volume obtained from the layout variable extraction script.
[0027] In some embodiments of this application, the layout variables of each firmware volume in the basic input / output system are stored in a preset layout firmware volume, including:
[0028] The layout variables of each firmware volume in the basic input / output system are stored in the layout firmware volume in text form.
[0029] In some embodiments of this application, after the compiler of the basic input / output system has completed compilation, the method further includes:
[0030] Obtain the compilation result returned by the compiler of the basic input / output system after compilation;
[0031] Monitor whether the compilation result contains a layout firmware volume, and whether the layout firmware volume contains layout information of the basic input / output system;
[0032] When the compilation result contains a layout firmware volume, and the layout firmware volume contains layout information for the basic input / output system, the compilation result is used as the basic input / output system image.
[0033] If the compilation result does not contain a layout firmware volume, or if the layout firmware volume does not contain layout information for the basic input / output system, the compilation process is re-executed.
[0034] In some embodiments of this application, the layout firmware volume is configured with an identification identifier to monitor whether the compilation return result contains the layout firmware volume, including:
[0035] Iterate through the compiled results and query the identification identifier of the layout firmware volume;
[0036] When the identification identifier of the layout firmware volume is found, the compilation result will include the layout firmware volume.
[0037] In some embodiments of this application, a basic input / output system modular update method is provided, applied to an external device, the method comprising:
[0038] Obtain the basic input / output system image, which is obtained according to the basic input / output system layout information generation method of the first aspect of the embodiment;
[0039] Parse the basic input / output system image to obtain the layout information of the basic input / output system contained in the basic input / output system image;
[0040] Based on the layout information of the Basic Input / Output System (BIOS), the module to be updated in the BIOS image is updated. The module to be updated is any firmware volume in the BIOS.
[0041] In some embodiments of this application, the basic input / output system image is parsed to obtain the layout information of the basic input / output system contained in the basic input / output system image, including:
[0042] Traverse the basic input / output system image to find the identification identifier of the layout firmware volume and locate the layout firmware volume;
[0043] Obtain the layout information of the basic input / output system contained in the basic input / output system image from the layout firmware volume.
[0044] In some embodiments of this application, updating the modules to be updated in the basic input / output system image based on the layout information of the basic input / output system includes:
[0045] In response to a module update operation, obtain the target update module corresponding to the module to be updated;
[0046] Based on the layout information of the basic input / output system, locate the module to be updated and overwrite the module to be updated with the target update module.
[0047] In some embodiments of this application, the external device includes a baseboard management controller, a complex programmable logic device, and a programming tool.
[0048] In some embodiments of this application, a basic input / output system layout information generation apparatus is provided, applied to a compiler of a basic input / output system. The basic input / output system layout information generation apparatus includes:
[0049] The layout variable acquisition module is used to acquire the layout variables of each firmware volume in the basic input / output system during the compilation process of the compiler. The layout variables include offset, size and attributes.
[0050] The storage module is used to store the layout variables of each firmware volume in the basic input / output system in a preset layout firmware volume.
[0051] The Basic Input / Output System Image Generation Module is used to generate a Basic Input / Output System image containing the layout information of the Basic Input / Output System after the compiler has finished compiling the Basic Input / Output System.
[0052] In some embodiments of this application, a basic input / output system modular update apparatus is provided, applied to an external device. The basic input / output system modular update apparatus includes:
[0053] The acquisition module is used to acquire the basic input / output system image, which is obtained according to the basic input / output system layout information generation method of the first aspect of the embodiment;
[0054] The parsing module is used to parse the basic input / output system image and obtain the layout information of the basic input / output system contained in the basic input / output system image;
[0055] The update module is used to update the modules to be updated in the Basic Input / Output System image based on the layout information of the Basic Input / Output System. The modules to be updated are any firmware volumes in the Basic Input / Output System.
[0056] In some embodiments of this application, a computer device is provided, including: at least one processor and a memory storing a computer program executable on the processor, wherein when the processor executes the computer program, it executes a basic input / output system layout information generation method of the first aspect of the embodiment, or executes a basic input / output system modular update method of the second aspect of the embodiment.
[0057] In some embodiments of this application, a non-volatile readable storage medium is provided, which stores a computer program, wherein when the computer program is executed by a processor, it executes the basic input / output system layout information generation method of the first aspect of the embodiment, or executes the basic input / output system modular update method of the second aspect of the embodiment.
[0058] In some embodiments of this application, a computer program product is provided, including a computer program / instruction that, when executed by a processor, implements a basic input / output system layout information generation method of the first aspect of the embodiment, or implements a basic input / output system modular update method of the second aspect of the embodiment. Beneficial effects:
[0059] In the method for generating basic input / output system layout information provided in some embodiments of this application, during the compilation process of the basic input / output system compiler, the layout variables of each firmware volume in the basic input / output system are obtained through a layout variable extraction script. The layout variables of a firmware volume include the offset, size, and attributes of the firmware volume. Then, the layout variables of each firmware volume in the basic input / output system are stored in a preset layout firmware volume. After the basic input / output system compiler completes the compilation, a basic input / output system image containing the layout information of the basic input / output system is generated.
[0060] During the BIOS image compilation process, a layout firmware volume is set up to store the layout variables of each firmware volume in the BIOS. This allows the BIOS layout information to be quickly obtained from the layout firmware volume in the BIOS image.
[0061] Based on the BIOS image generated by this method, which contains BIOS layout information, external devices can obtain the BIOS layout information by parsing the BIOS image. Then, they can accurately locate any firmware volume and perform modular updates without relying on any third-party tools for BIOS updates, thus reducing the cost of BIOS updates. Attached Figure Description
[0062] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0063] Figure 1 shows a flowchart of the steps of the basic input / output system layout information generation method provided in an embodiment of this application;
[0064] Figure 2 shows the execution flowchart of the basic input / output system layout information generation method provided in the embodiments of this application;
[0065] Figure 3 shows a flowchart of the steps of the modular update method for a basic input / output system provided in an embodiment of this application;
[0066] Figure 4 shows a flowchart of the steps of the modular update method for a basic input / output system provided in an embodiment of this application;
[0067] Figure 5 shows a functional block diagram of the basic input / output system layout information generation device provided in an embodiment of this application;
[0068] Figure 6 shows a functional block diagram of the basic input / output system modular update device provided in an embodiment of this application;
[0069] Figure 7 shows a schematic diagram of the computer device provided in an embodiment of this application;
[0070] Figure 8 shows a schematic diagram of a non-volatile readable storage medium provided in an embodiment of this application;
[0071] Figure 9 shows a schematic diagram of a computer program product provided in an embodiment of this application. Detailed Implementation
[0072] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0073] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the various embodiments of this application will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been presented in the various embodiments of this application to enable readers to better understand this application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in this application can be implemented. The division of the various embodiments below is for the convenience of description and should not constitute any limitation on the specific implementation of this application. The various embodiments can be combined with and referenced by each other without contradiction.
[0074] BIOS: Basic Input / Output System;
[0075] ROM: Read-Only Memory;
[0076] BMC: Baseboard Management Controller;
[0077] CPLD: Complex Programmable Logic Device.
[0078] With the rapid development of computer technology, the BIOS, as an important part of the computer boot process, has become particularly important in terms of updating and maintenance. Currently, BIOS update methods often rely on specific third-party tools for parsing and updating, which is complicated and limited by third parties, resulting in high update costs and low efficiency.
[0079] Therefore, in order to reduce the cost of BIOS updates, this application provides a method for generating basic input / output system layout information and a method for updating basic input / output system modularly.
[0080] Referring to Figure 1, a flowchart of a method for generating layout information of a basic input / output system according to an embodiment of this application is shown. The method is applied to a compiler of a basic input / output system and may include the following steps:
[0081] S101: During the compilation process of the compiler of the basic input / output system, obtain the layout variables of each firmware volume in the basic input / output system. The layout variables include offset, size and attributes.
[0082] In some embodiments of this application, during the compilation process of the BIOS compiler to generate a BIOS image, the layout variables corresponding to each firmware volume (FV) generated during the compilation process are obtained. The layout variables corresponding to each firmware volume can describe the layout information of each firmware volume in the BIOS image. That is, the layout variables corresponding to each firmware volume constitute the layout information of the BIOS.
[0083] When obtaining the layout variables of each firmware volume in the BIOS, you can do so by running a layout variable extraction script. This script can be a Python script that captures the scattered BIOS layout variable process files generated during the compilation process. These files include the layout variable process files for any firmware volume, which contain descriptive information for that firmware volume. For example, this includes the firmware volume's name, offset, size, and attributes. Running the layout variable extraction script allows you to obtain the layout variables for each firmware volume from the BIOS layout variable process files. These layout variables include offset, size, and attributes.
[0084] The specific code design of the layout variable extraction script can be customized according to the actual application requirements, as long as the layout variable extraction script can obtain the layout variables of each firmware volume in the BIOS. This embodiment does not impose any restrictions.
[0085] S102: Store the layout variables of each firmware volume in the basic input / output system in a preset layout firmware volume.
[0086] A layout firmware volume is a pre-created OEM FV (Original Equipment Manufacturer Firmware Volume). During the compilation process of the BIOS compiler to generate the BIOS image, once the compilation is successful, the layout firmware volume will be integrated into the compiled BIOS image.
[0087] After the layout variable extraction script obtains the layout variables of each firmware volume in the BIOS, it stores the layout variables of each firmware volume in the BIOS in a preset layout firmware volume. That is, the layout variables of each firmware volume in the BIOS are stored in a separate layout firmware volume. After compilation, the BIOS image will generate a BIOS image containing the layout information of the BIOS.
[0088] S103: After the compiler of the basic input / output system is completed, it generates a basic input / output system image containing the layout information of the basic input / output system.
[0089] After the BIOS compiler finishes compiling, the layout firmware volume in the BIOS image will store the BIOS layout information. When an external device updates the BIOS, the complete layout information of the BIOS can be parsed from the BIOS image. There is no need to rely on third-party tools to parse the BIOS. The layout information inside the current BIOS can be obtained directly through the existing interaction protocol between the external device and the BIOS. This makes it easy for external devices directly connected to the BIOS to update the BIOS directly. It also allows for precise modular updates of the BIOS, reducing the cost of BIOS updates.
[0090] In one feasible implementation, before obtaining the layout variables of each firmware volume in the BIOS, the method further includes: creating a layout firmware volume in response to a first creation operation.
[0091] Specifically, an OEM FV is created in the ROM where the BIOS program is located as a layout firmware volume. The layout firmware volume is used to store the layout variables of each firmware volume of the BIOS, and is integrated into the BIOS image after the BIOS compiler is completed.
[0092] After creating the layout firmware volume, you can also adjust the address of the layout firmware volume, that is, set the target location of the layout firmware volume; specifically, in response to the location adjustment operation, the location of the layout firmware volume is set to the target location.
[0093] In actual implementation, the location of the firmware volume can be customized according to the needs of the actual application.
[0094] In one feasible implementation, setting the location of the layout firmware volume to a target location in response to a location adjustment operation includes: setting the target location of the layout firmware volume to the starting location of the BIOS image in response to a first location adjustment operation.
[0095] This means that the target location of the layout firmware volume can be set at the beginning of the BIOS image, which makes it easier to quickly locate the layout firmware volume in the BIOS image.
[0096] In another feasible implementation, setting the position of the layout firmware volume to a target position in response to a position adjustment operation includes: setting the target position of the layout firmware volume to the end position of the BIOS image in response to a second position adjustment operation.
[0097] In addition to setting the target location of the layout firmware volume at the beginning of the BIOS image, it can also be set at the end of the BIOS image; otherwise, the target location of the layout firmware volume can be set at other locations according to the actual application requirements.
[0098] In order to quickly locate the layout firmware volume in the BIOS image, in one possible implementation, after creating the layout firmware volume in response to the first creation operation, the method further includes: adding an identification identifier to the header file of the layout firmware volume in response to an identification addition operation, the identification identifier being used to locate the layout firmware volume.
[0099] For example, a unique GUID (Globally Unique Identifier) can be set for the layout firmware volume OEM FV as an identification identifier.
[0100] When parsing the BIOS image, the layout firmware volume can be quickly and accurately located by traversing the BIOS image and querying the unique GUID of the layout firmware volume.
[0101] In one feasible implementation, during the process of obtaining the layout variables of each firmware volume in the BIOS, a layout variable extraction script can be run to capture the BIOS layout variable process file generated by the BIOS compiler during the compilation process; the layout variable extraction script generates the layout variables of each firmware volume in the BIOS based on the BIOS layout variable process file.
[0102] Specifically, a layout variable extraction script is pre-compiled. The layout variable extraction script can be a Python script. The layout variable extraction script is used to capture the scattered BIOS layout variable process files generated during the compilation process. Then, according to the preset layout variable format, namely offset, size and attribute, the layout variables of each firmware volume are obtained from the BIOS layout variable process files. The layout variables corresponding to each firmware volume form the BIOS layout information.
[0103] For example, the layout variable extraction script can obtain the layout variables of each firmware volume from the BIOS layout variable process file, and then generate a text file for the layout variables of each firmware volume according to the variable format of offset, size and attribute.
[0104] After running the layout variable extraction script to obtain the layout variables of each firmware volume in the BIOS, the method also includes:
[0105] In response to the second creation operation, an executable file creation tool is created; then, during the compilation process, the BIOS compiler executes the executable file creation tool, calls the layout variable extraction script, and generates the layout variables of each firmware volume in text form based on the layout variables of each firmware volume obtained from the layout variable extraction script.
[0106] For example, during the execution process, the executable file creation tool is used to extract the layout variables of each firmware volume in the BIOS obtained by the layout variable extraction script and generate layout variables that can be parsed. For example, the executable file creation tool is a make file.
[0107] Specifically, when the make file is executed, it can call the layout variable extraction script to obtain the layout variables of each firmware volume in the BIOS, and generate the layout variables of each firmware volume in text form. The text form layout variables can be parsed by external devices.
[0108] Then, when storing the layout variables of each firmware volume in the BIOS in the preset layout firmware volume, simply store the layout variables of each firmware volume in the BIOS in text form in the layout firmware volume.
[0109] In one feasible implementation, the layout variables corresponding to each firmware volume can also be encrypted. For example, after the make file generates the layout variables in text form for each firmware volume, the make file calls a preset encryption thread to encrypt the plaintext layout variables before storing them in the layout firmware volume. The encryption algorithm can be RSA (an asymmetric encryption algorithm) or a hash algorithm. In actual implementation, the encryption algorithm can be selected adaptively. In addition to encryption algorithms, lossless compression algorithms can also be used to compress the layout variables. Lossless compression algorithms include Huffman Coding, Dictionary Compression, LZW (Lempel-Ziv-Welch) compression algorithm, etc.
[0110] By encrypting or compressing the plaintext layout variables and then storing them in the layout firmware volume as non-plaintext data, the encrypted or compressed BIOS layout information can be restored according to the corresponding decryption / decompression method, thus avoiding the direct exposure of the BIOS layout information.
[0111] In actual implementation, in addition to generating layout variables in text form for each firmware volume through the created makefile, it is also possible to generate layout variables for each firmware volume in other formats that can be successfully parsed.
[0112] The arrangement of the layout variables of each firmware volume stored in the layout firmware volume can also be customized according to the actual application requirements. For example, the layout variables of each firmware volume can be arranged sequentially according to the order of the layout variables of the firmware volume obtained by the layout variable extraction script; or the layout variables of each firmware volume can be arranged sequentially according to the order of the offset addresses of the firmware volumes. This embodiment does not impose any restrictions.
[0113] In one feasible implementation, after the BIOS compiler has completed the compilation, the method further includes:
[0114] Obtain the compilation result returned by the compiler of the basic input / output system after compilation;
[0115] Monitor whether the compilation results contain a layout firmware volume, and whether the layout firmware volume contains BIOS layout information;
[0116] When the compilation result contains a layout firmware volume, and the layout firmware volume contains BIOS layout information, the compilation result is used as the BIOS image.
[0117] If the compilation result does not contain a layout firmware volume, or if the layout firmware volume does not contain BIOS layout information, the compilation process will be re-executed.
[0118] By checking the compilation results after compilation, it is ensured that the generated BIOS image includes the layout firmware volume and the layout firmware volume contains the BIOS layout information. If the compilation results do not include the layout firmware volume or the layout firmware volume does not contain the BIOS layout information, the compilation process can be executed again.
[0119] Specifically, because the layout firmware volume is configured with an identification identifier, when monitoring whether the compilation return result contains the layout firmware volume, the compilation return result can be traversed to query the identification identifier of the layout firmware volume; when the identification identifier of the layout firmware volume is found, the compilation return result contains the layout firmware volume.
[0120] Referring to Figure 2, an execution flowchart of the basic input / output system layout information generation method provided in this application embodiment is shown. The basic input / output system layout information generation method includes the following steps:
[0121] S11: In response to the first creation operation, create a layout firmware volume.
[0122] Specifically, an OEM FV is created in the ROM where the BIOS program is located as a layout firmware volume to store the layout variables of each firmware volume of the BIOS, and it is integrated into the BIOS image after the BIOS compiler has finished compiling.
[0123] S12: In response to the position adjustment operation, set the position of the layout firmware volume to the target position.
[0124] In actual implementation, the position of the layout firmware volume can be customized according to the needs of the actual application. The target position of the layout firmware volume can be the beginning position of the BIOS image or the end position of the BIOS image.
[0125] S13: In response to the identifier addition operation, add an identification identifier to the header file of the layout firmware volume.
[0126] For example, a unique GUID is set in the header file of the OEM FV layout firmware volume as an identification identifier. When parsing the BIOS image, the unique GUID of the layout firmware volume can be queried by traversing the BIOS image, so as to quickly and accurately locate the layout firmware volume.
[0127] S14: Run the layout variable extraction script to obtain the layout variables of each firmware volume in the basic input / output system.
[0128] The pre-compiled layout variable extraction script is executed to capture the BIOS layout variable process file generated during the compilation process. Then, according to the preset layout variable format, namely offset, size and attributes, the layout variables of each firmware volume are obtained from the BIOS layout variable process file.
[0129] S15: In response to the second creation operation, create and execute the executable file creation tool, call the layout variable extraction script, generate the layout variables of each firmware volume in text form based on the layout variables of each firmware volume in the basic input / output system obtained by the layout variable extraction script, and store them in the layout firmware volume.
[0130] For example, a makefile can be created to automate the execution of a layout variable extraction script. The makefile sets the commands and parameters for calling the layout variable extraction script, which can generate layout variables in text form for each firmware volume and store them in the layout firmware volume.
[0131] S16: After the compiler of the basic input / output system has finished compiling, check whether the compilation result contains the layout firmware volume;
[0132] When the compilation result contains a layout firmware volume, proceed to step S17;
[0133] If the compilation result does not contain the layout firmware volume, proceed to step S18;
[0134] S17: Monitor whether the layout firmware volume contains layout information for the basic input / output system;
[0135] When the layout firmware volume contains BIOS layout information, proceed to step S19;
[0136] If the layout firmware volume does not contain BIOS layout information, proceed to step S18.
[0137] S18: Re-execute the compilation process.
[0138] S19: Output the compilation result as a basic input / output system image.
[0139] Referring to Figure 3, a flowchart illustrating the steps of a basic input / output system modular update method according to an embodiment of this application is shown. The basic input / output system modular update method is applied to an external device and includes the following steps:
[0140] S201: Obtain the basic input / output system image.
[0141] The BIOS image is obtained according to the BIOS layout information generation method of this embodiment. Therefore, the BIOS image includes a layout firmware volume, and the layout firmware volume stores the BIOS layout information, that is, the layout variables of each firmware volume in the BIOS.
[0142] External devices include BMC, CPLD, and programming tools such as programmers. External devices can also be other devices that support the parsing of BIOS flash. External devices such as BMC or CPLD can interact with the BIOS and can obtain and load the BIOS image.
[0143] S202: Parse the basic input / output system image to obtain the layout information of the basic input / output system contained in the basic input / output system image.
[0144] Specifically, external devices such as BMC or CPLD can parse the BIOS image based on their respective agreed rules with the BIOS. In the process of obtaining the BIOS layout information contained in the BIOS image, they can traverse the BIOS image to find the identification mark of the layout firmware volume and locate the layout firmware volume. Then, they can obtain the BIOS layout information contained in the BIOS image in the layout firmware volume, that is, obtain the offset, size and attributes of each firmware volume.
[0145] S203: Update the module to be updated in the Elementary Input / Output System image based on the layout information of the Elementary Input / Output System. The module to be updated is any firmware volume in the Elementary Input / Output System.
[0146] Specifically, the process of updating the module to be updated in the BIOS image according to the BIOS layout information includes: in response to the module update operation, obtaining the target update module corresponding to the module to be updated; locating the module to be updated according to the BIOS layout information, and overwriting the module to be updated with the target update module.
[0147] To facilitate the detection of whether the BIOS update is complete, in one feasible implementation, an update completion flag can be set at the end of the target update module. When the update is complete, the external device can detect the high-order update completion flag, thereby determining that the BIOS update module has been successfully updated.
[0148] In actual implementation, other methods can be set to verify whether the BIOS update module has been successfully updated; this embodiment does not impose any restrictions.
[0149] Referring to Figure 4, a flowchart of the steps of the basic input / output system modular update method provided in this application embodiment is shown. The basic input / output system modular update method includes the following steps:
[0150] S21: Obtain the basic input / output system image.
[0151] S22: Parse the basic input / output system image to obtain the layout information of the basic input / output system contained in the basic input / output system image.
[0152] External devices load the BIOS image and parse it according to the agreed rules between the external device and the BIOS. For example, by parsing the layout variables in text form of each firmware volume in the BIOS image, the layout information of the complete BIOS can be constructed.
[0153] S23: Update the modules to be updated in the basic input / output system image.
[0154] Based on the BIOS layout information obtained from the analysis, external devices can locate the BIOS module that needs to be updated and perform a modular upgrade. During the upgrade process, external devices can replace or modify the corresponding modules as needed to achieve the BIOS update.
[0155] S24: Determine whether the module to be updated has been successfully updated;
[0156] The process ends when the module to be updated has been successfully updated.
[0157] Collect error information when the module to be updated fails to complete the update.
[0158] The BIOS layout information generation method and BIOS modular update method provided in some embodiments of this application have the following characteristics:
[0159] Beneficial effects:
[0160] 1. Operational flexibility and convenience: By storing BIOS layout information in a pre-configured firmware volume (OEM FV), the BIOS layout information can be obtained simply by parsing the BIOS image. This eliminates the need for any third-party tools, making the operation more flexible and requiring no additional software installation or configuration. Automated calls via Python scripts and makefiles simplify the operation process and improve ease of use.
[0161] 2. Efficiency and accuracy: Since this embodiment can directly obtain the BIOS layout information by parsing the BIOS image, it avoids the parsing errors or information loss problems that may occur in traditional methods. At the same time, by pre-setting the OEM FV and storing the layout information, the accuracy and integrity of the information can be ensured, providing reliable data support for subsequent modular updates. Since the BIOS layout information is directly obtained, the modules that need to be updated can be located accurately in real time, realizing efficient modular updates.
[0162] 3. Wide applicability and low cost: The method provided in this embodiment does not depend on a specific hardware platform or software environment and can be applied to various types of BIOS firmware images; the application scope is wider and not limited to a specific system or device; moreover, because no third-party tools are needed, the cost is reduced, making BIOS updates and maintenance more economical and efficient.
[0163] 4. Advantages of modular updates: Traditional BIOS update methods often involve a complete replacement, while the method provided in this embodiment can achieve modular BIOS updates, that is, individual firmware volumes can be updated or upgraded without replacing the entire BIOS firmware. This not only improves the efficiency of updates but also reduces the risks that may occur during the update process. In addition, modular updates can be flexibly customized as needed to meet the needs of different users.
[0164] 5. Improve system security and stability; The method provided in this embodiment can ensure the integrity and security of the BIOS image. Since the BIOS layout information is stored in the OEM FV, it is not easy to be tampered with or destroyed, thereby improving system security. At the same time, since the update process is more accurate and controllable, it also reduces the errors or instability factors that may be introduced during the update process, thus improving system stability.
[0165] 6. Because existing BIOS upgrade solutions do not support external devices parsing BIOS flash, out-of-band modular BIOS upgrades are not possible. However, the method provided in this application provides BIOS layout information through the BIOS image itself, which can be provided to any third-party tool or device to parse the BIOS image, thereby enabling modular upgrades, modular modifications, and personalized encryption schemes. For example, in the current Intel PFR solution, the BIOS is modularly split during compilation, and a header is added to each module. The header contains the physical address of the current BIOS module in the SPI flash. The PFR (CPLD) parses this header to update the SPI flash. Compared with Intel's BIOS update solution, the update method provided in this embodiment does not require modular splitting of the BIOS, can maintain fewer BIOS files, and increases the possibility of PFR updating more modules simultaneously.
[0166] In summary, some embodiments of this application provide an efficient, accurate, flexible, and secure solution for modular BIOS updates by parsing the BIOS image without relying on third-party tools to obtain BIOS layout information. This not only simplifies the operation process and reduces costs but also improves the security and stability of the system.
[0167] Referring to Figure 5, a functional block diagram of a basic input / output system layout information generation device provided in an embodiment of this application is shown. The basic input / output system layout information generation device is applied to a compiler of a basic input / output system. The basic input / output system layout information generation device includes:
[0168] The layout variable acquisition module 101 is used to acquire the layout variables of each firmware volume in the basic input / output system during the compilation process of the compiler of the basic input / output system. The layout variables include offset, size and attributes.
[0169] Storage module 102 is used to store the layout variables of each firmware volume in the basic input / output system in a preset layout firmware volume.
[0170] The Basic Input / Output System Image Generation Module 103 is used to generate a Basic Input / Output System image containing the layout information of the Basic Input / Output System after the compiler of the Basic Input / Output System has been compiled.
[0171] In some embodiments of this application, the basic input / output system layout information generation apparatus further includes:
[0172] The layout firmware volume creation module is used to create a layout firmware volume in response to the first creation operation. The layout firmware volume is used to store the layout variables of each firmware volume of the basic input / output system and is integrated into the basic input / output system image after the compiler of the basic input / output system is completed.
[0173] In some embodiments of this application, the basic input / output system layout information generation apparatus further includes:
[0174] The position adjustment module is used to set the position of the layout firmware volume to the target position in response to the position adjustment operation.
[0175] In some embodiments of this application, the position adjustment module includes:
[0176] The first position adjustment unit is configured to, in response to a first position adjustment operation, set the target position of the layout firmware volume to the starting position of the basic input / output system image.
[0177] In some embodiments of this application, the position adjustment module includes:
[0178] The first position adjustment unit is used to set the target position of the layout firmware volume at the end position of the basic input / output system image in response to the second position adjustment operation.
[0179] In some embodiments of this application, the basic input / output system layout information generation apparatus further includes:
[0180] The identifier addition module is used to add an identification identifier to the header file of the layout firmware volume in response to the identifier addition operation. The identification identifier is used to locate the layout firmware volume.
[0181] In some embodiments of this application, the layout variable acquisition module includes:
[0182] The process file acquisition unit is used to run the layout variable extraction script and capture the basic input / output system layout variable process file generated by the compiler during the compilation process.
[0183] The layout variable acquisition unit is used to generate layout variables for each firmware volume in the basic input / output system based on the layout variable process file of the basic input / output system.
[0184] In some embodiments of this application, the basic input / output system layout information generation apparatus further includes:
[0185] An executable file creation tool creation module is used to create an executable file creation tool in response to a second creation operation;
[0186] During the compilation process, the compiler of the Basic Input / Output System executes the executable file creation tool, calls the layout variable extraction script, and generates the layout variables of each firmware volume in text form based on the layout variables of each firmware volume obtained from the layout variable extraction script.
[0187] In some embodiments of this application, the storage module includes:
[0188] Storage unit, used to store layout variables in text form of each firmware volume in the layout firmware volume of the basic input / output system.
[0189] In some embodiments of this application, the basic input / output system layout information generation apparatus further includes:
[0190] The monitoring module is used to obtain the compilation return result after the compiler of the basic input / output system is completed; to monitor whether the compilation return result contains the layout firmware volume, and whether the layout firmware volume contains the layout information of the basic input / output system;
[0191] The output module is used to use the compilation result as a basic input / output system image when the compilation result contains a layout firmware volume and the layout firmware volume contains layout information of the basic input / output system.
[0192] The recompile module is used to re-execute the compilation process when the compilation result does not contain the layout firmware volume, or the layout firmware volume does not contain the layout information of the basic input / output system.
[0193] In some embodiments of this application, the monitoring module includes:
[0194] The monitoring unit is used to traverse the compilation return results and query the identification identifier of the layout firmware volume; when the identification identifier of the layout firmware volume is found, the layout firmware volume is included in the compilation return results.
[0195] Referring to Figure 6, a functional block diagram of a basic input / output system modular update device according to an embodiment of this application is shown. The basic input / output system modular update device is applied to an external device and includes:
[0196] The acquisition module 201 is used to acquire the basic input / output system image, which is obtained according to the basic input / output system layout information generation method of the embodiment.
[0197] The parsing module 202 is used to parse the basic input / output system image and obtain the layout information of the basic input / output system contained in the basic input / output system image;
[0198] The update module 203 is used to update the module to be updated in the basic input / output system image according to the layout information of the basic input / output system. The module to be updated is any firmware volume in the basic input / output system.
[0199] In some embodiments of this application, the parsing module includes:
[0200] The parsing unit is used to traverse and search for the identification identifier of the layout firmware volume in the basic input / output system image, locate the layout firmware volume, and obtain the layout information of the basic input / output system contained in the basic input / output system image in the layout firmware volume.
[0201] In some embodiments of this application, the updating module includes:
[0202] The update unit is used to respond to the module update operation, obtain the target update module corresponding to the module to be updated, locate the module to be updated according to the layout information of the basic input / output system, and overwrite the module to be updated with the target update module.
[0203] Referring to FIG7, a schematic diagram of a computer device provided in an embodiment of the present application is shown, including: at least one processor 701 and a memory 702. The memory 702 stores a computer program that can run on the processor, wherein when the processor 701 executes the computer program, it executes the basic input / output system layout information generation method of the embodiment, or executes the basic input / output system modular update method of the embodiment.
[0204] Specifically, when executing the BIOS layout information generation method of the embodiment, the following process is performed: during the compilation process of the BIOS compiler, the layout variables of each firmware volume in the BIOS are obtained, and the layout variables include offset, size and attributes; the layout variables of each firmware volume in the BIOS are stored in a preset layout firmware volume; after the BIOS compiler is completed, a BIOS image containing the layout information of the BIOS is generated.
[0205] When executing the BIOS modular update method of the embodiment, the following process is performed: obtaining a BIOS image, which is obtained according to the BIOS layout information generation method of the embodiment; parsing the BIOS image to obtain the BIOS layout information contained in the BIOS image; and updating the module to be updated in the BIOS image according to the BIOS layout information, wherein the module to be updated is any firmware volume in the BIOS.
[0206] Referring to FIG8, a schematic diagram of a non-volatile readable storage medium provided in an embodiment of the present application is shown. The non-volatile readable storage medium 800 stores a computer program 801, wherein when the computer program 801 is executed by a processor, it executes the basic input / output system layout information generation method of the embodiment, or executes the basic input / output system modular update method of the embodiment.
[0207] Specifically, when executing the basic input / output system layout information generation method of the embodiment, the following process is performed: during the compilation process of the BIOS compiler, the layout variables of each firmware volume in the BIOS are obtained, and the layout variables include offset, size and attributes; the layout variables of each firmware volume in the BIOS are stored in a preset layout firmware volume; after the BIOS compiler is completed, a BIOS image containing the layout information of the BIOS is generated.
[0208] When executing the BIOS modular update method of the embodiment, the following process is performed: obtaining a BIOS image, which is obtained according to the BIOS layout information generation method of the embodiment; parsing the BIOS image to obtain the BIOS layout information contained in the BIOS image; and updating the module to be updated in the BIOS image according to the BIOS layout information, wherein the module to be updated is any firmware volume in the BIOS.
[0209] Referring to FIG9, a schematic diagram of a computer program product provided in an embodiment of this application is shown. The computer program product 900 includes a computer program / instruction 901. When the computer program / instruction 901 is executed by a processor, it implements the basic input / output system layout information generation method of the embodiment, or implements the basic input / output system modular update method of the embodiment.
[0210] Specifically, when executing the BIOS layout information generation method of the embodiment, the following process is performed: during the compilation process of the BIOS compiler, the layout variables of each firmware volume in the BIOS are obtained, and the layout variables include offset, size and attributes; the layout variables of each firmware volume in the BIOS are stored in a preset layout firmware volume; after the BIOS compiler is completed, a BIOS image containing the layout information of the BIOS is generated.
[0211] When executing the BIOS modular update method of the embodiment, the following process is performed: obtaining a BIOS image, which is obtained according to the BIOS layout information generation method of the embodiment; parsing the BIOS image to obtain the BIOS layout information contained in the BIOS image; and updating the module to be updated in the BIOS image according to the BIOS layout information, wherein the module to be updated is any firmware volume in the BIOS.
[0212] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0213] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0214] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.
[0215] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.
[0216] These computer program instructions may also be loaded onto a computer or other programmable data processing terminal equipment to cause a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable terminal equipment, provide steps for implementing the functions specified in one or more flowcharts and / or one or more block diagrams.
[0217] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0218] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0219] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for generating basic input / output system layout information, characterized in that, A compiler applied to a basic input / output system, the method comprising: During the compilation process of the compiler of the basic input / output system, the layout variables of each firmware volume in the basic input / output system are obtained, and the layout variables include offset, size and attributes; The layout variables of each firmware volume in the basic input / output system are stored in a preset layout firmware volume. After the compiler of the basic input / output system is completed, a basic input / output system image containing the layout information of the basic input / output system is generated.
2. The method for generating basic input / output system layout information according to claim 1, characterized in that, Before obtaining the layout variables of each firmware volume in the basic input / output system, the method further includes: In response to the first creation operation, a layout firmware volume is created, wherein the layout firmware volume is used to store the layout variables of each firmware volume of the basic input / output system, and is integrated into the basic input / output system image after the compiler of the basic input / output system has been compiled.
3. The method for generating basic input / output system layout information according to claim 2, characterized in that, In response to the first creation operation, after creating the layout firmware volume, the method further includes: In response to the position adjustment operation, the position of the layout firmware volume is set to the target position.
4. The method for generating basic input / output system layout information according to claim 3, characterized in that, In response to a position adjustment operation, setting the position of the layout firmware volume to a target position includes: In response to the first position adjustment operation, the target position of the layout firmware volume is set at the starting position of the basic input / output system image.
5. The method for generating basic input / output system layout information according to claim 3, characterized in that, In response to a position adjustment operation, setting the position of the layout firmware volume to a target position includes: In response to the second position adjustment operation, the target position of the layout firmware volume is set at the end position of the basic input / output system image.
6. The method for generating basic input / output system layout information according to any one of claims 2-5, characterized in that, In response to the first creation operation, after creating the layout firmware volume, the method further includes: In response to the identifier addition operation, an identification identifier is added to the header file of the layout firmware volume, the identification identifier being used to locate the layout firmware volume.
7. The method according to claim 1, characterized in that, Obtain the layout variables of each firmware volume in the basic input / output system, including: Run the layout variable extraction script to capture the layout variable process file of the basic input / output system generated by the compiler of the basic input / output system during the compilation process; The layout variable extraction script generates layout variables for each firmware volume in the basic input / output system based on the layout variable process file of the basic input / output system.
8. The method according to claim 7, characterized in that, After obtaining the layout variables of each firmware volume in the basic input / output system, the method further includes: In response to the second creation operation, an executable file creation tool is created; During the compilation process, the compiler of the basic input / output system executes the executable file creation tool, calls the layout variable extraction script, and generates text-based layout variables for each firmware volume based on the layout variables of each firmware volume obtained from the layout variable extraction script.
9. The method according to claim 8, characterized in that, The layout variables of each firmware volume in the basic input / output system are stored in a preset layout firmware volume, including: The layout variables in text form for each firmware volume in the basic input / output system are stored in the layout firmware volume.
10. The method according to claim 1, characterized in that, After the compiler of the basic input / output system has completed compilation, the method further includes: Obtain the compilation return result after the compiler of the basic input / output system has completed compilation; Monitor whether the compilation return result contains the layout firmware volume, and whether the layout firmware volume contains the layout information of the basic input / output system; When the compilation return result contains the layout firmware volume, and the layout firmware volume contains the layout information of the basic input / output system, the compilation return result is used as the image of the basic input / output system. If the compilation result does not contain the layout firmware volume, or if the layout firmware volume does not contain the layout information of the basic input / output system, the compilation process is re-executed.
11. The method according to claim 10, characterized in that, The layout firmware volume is configured with an identification identifier, and the monitoring of whether the compilation return result contains the layout firmware volume includes: Iterate through the compilation results and query the identification identifier of the layout firmware volume; When the identification identifier of the layout firmware volume is found, the compilation return result includes the layout firmware volume.
12. A modular update method for a basic input / output system, characterized in that, Applied to an external device, the method includes: Obtain a basic input / output system image, wherein the basic input / output system image is obtained by the basic input / output system layout information generation method according to any one of claims 1-11; The basic input / output system image is parsed to obtain the layout information of the basic input / output system contained in the basic input / output system image; Based on the layout information of the basic input / output system, the modules to be updated in the basic input / output system image are updated, where the modules to be updated are any firmware volumes in the basic input / output system.
13. The modular update method for a basic input / output system according to claim 12, characterized in that, The basic input / output system image is parsed to obtain the layout information of the basic input / output system contained in the basic input / output system image, including: Traverse the basic input / output system image to find the identification identifier of the layout firmware volume and locate the layout firmware volume; The layout information of the basic input / output system contained in the basic input / output system image is obtained from the layout firmware volume.
14. The modular update method for a basic input / output system according to claim 13, characterized in that, Based on the layout information of the basic input / output system, the modules to be updated in the basic input / output system image are updated, including: In response to a module update operation, obtain the target update module corresponding to the module to be updated; Based on the layout information of the basic input / output system, the module to be updated is located, and the target update module is used to overwrite the module to be updated.
15. The modular update method for a basic input / output system according to claim 12, characterized in that, The external devices include a baseboard management controller, a complex programmable logic device, and a programming tool.
16. A basic input / output system layout information generation device, characterized in that, A compiler applied to a basic input / output system, wherein the basic input / output system layout information generation device includes: The layout variable acquisition module is used to acquire the layout variables of each firmware volume in the basic input / output system during the compilation process of the compiler of the basic input / output system. The layout variables include offset, size and attributes. A storage module is used to store the layout variables of each firmware volume in the basic input / output system in a preset layout firmware volume. The Basic Input / Output System Image Generation Module is used to generate a Basic Input / Output System Image containing the layout information of the Basic Input / Output System after the compiler of the Basic Input / Output System has been compiled.
17. A modular update device for a basic input / output system, characterized in that, The basic input / output system modular update device, applied to external devices, includes: An acquisition module is used to acquire a basic input / output system image, wherein the basic input / output system image is obtained by the basic input / output system layout information generation method according to any one of claims 1-11; The parsing module is used to parse the basic input / output system image and obtain the layout information of the basic input / output system contained in the basic input / output system image; An update module is used to update the modules to be updated in the basic input / output system image according to the layout information of the basic input / output system, wherein the modules to be updated are any firmware volumes in the basic input / output system.
18. A computer device, characterized in that, include: At least one processor and a memory storing a computer program executable on the processor, wherein the processor executes the computer program to perform the basic input / output system layout information generation method according to any one of claims 1-11, or to perform the basic input / output system modular update method according to any one of claims 12-15.
19. A non-volatile readable storage medium, characterized in that, The non-volatile readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it performs the basic input / output system layout information generation method according to any one of claims 1-11, or performs the basic input / output system modular update method according to any one of claims 12-15.
20. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the basic input / output system layout information generation method according to any one of claims 1-11, or the basic input / output system modular update method according to any one of claims 12-15.
Citation Information
Patent Citations
Method, system and device for upgrading BIOS firmware and medium
CN113238778A
Parameter configuration method and device of basic input and output system, equipment and medium
CN114138278A
Basic input and output system firmware upgrading method and device
CN116679967A
Basic input and output system layout information generation method, updating method and product
CN118394368A
System and Method for Modular Patch based Firmware Update
US20200326930A1