A method for recording changes in BIOS firmware configuration options

By reading the Nvram variable area in the BIOS configuration interface and using HiiDataBase to parse option resources, the BIOS firmware configuration option changes are recorded, which solves the problem of lack of convenience in the existing technology and realizes the traceability basis and fault query of equipment operation and fault analysis.

CN119292695BActive Publication Date: 2025-10-14BEIJING INST OF COMP TECH & APPL
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411386216.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-10-14
Estimated Expiration
2044-09-30

AI Technical Summary

Technical Problem

In the prior art, the method for recording changes in BIOS firmware configuration options lacks convenience and requires establishing a non-standardized processing function for each option. As a result, the processing function needs to be changed every time an option is changed or added, which lacks flexibility and scalability.

Method used

By executing the save configuration operation in the BIOS configuration interface, reading the Variable variable area in Nvram, comparing the differences between the previous and next variable areas, using HiiDataBase to parse option resources, recording option names, values, system time and other information, and synchronously recording them to the BMC through Ipmi communication, achieving in-band and out-of-band synchronous recording.

Benefits of technology

It provides a traceability basis for equipment operation and fault analysis, records the administrator's authority and time for option changes, supports basic inquiries about equipment failures or returns, and solves the problem of missing operations from the equipment's delivery to the maintenance stage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292695B_ABST
    Figure CN119292695B_ABST
Patent Text Reader

Abstract

The application relates to a BIOS firmware configuration option change recording method and belongs to the technical field of computers. Before and after a BIOS firmware option modification processing node SubmitForm, Nvram variables in a Flash are read into memories, the contents of the two are compared, it is determined that a firmware configuration interface option has changed, page and option resources in a BIOS firmware configuration interface are obtained by loading a HiiDataBase database, page-related Package package resources are gradually decomposed, option resources OpHeader are further obtained, finally, each option is obtained by decomposing the option resources according to categories, the option content before and after the option modification is determined by combining VarstoreID in the option and the Nvram variable area before and after the option modification, the option change, system time and execution authority are packaged and stored on the Flash, and the information is synchronously sent to a BMC out-of-band, and in-band and out-of-band synchronous recording is realized. The application is convenient for regularly checking the working conditions of equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer technology, and in particular relates to a method for recording changes in BIOS firmware configuration options. Background Art

[0002] The computer BIOS firmware provides a Setup human-computer interactive configuration interface. The various options within this interface can be used to configure computer startup-related functions such as the motherboard's underlying hardware, motherboard startup, and operating system boot (e.g., enabling / disabling specific devices, adjusting the boot order, etc.). Modifying these options determines the execution of hardware, drivers, and customized functions in each stage of BIOS startup. The different settings of individual options and the associated settings of multiple options play a decisive role in motherboard startup. Improper settings can even cause malfunctions. Therefore, recording changes to each option on the Setup interface is very beneficial for normal device operation and troubleshooting.

[0003] Currently, the common practice is to encode and record the name and data (which can be numerical values, strings, specific character content, etc.) of each option of the firmware configuration program, and use the Variable service provided by UEFI to record the unmodified option code on Flash. If the option changes, a variable save action is performed, and the option name and option data before and after the modification are compared, and then processed in the program. The disadvantage of this method is the lack of convenience. For each option, a function processing branch needs to be established, and the name, option data type, data range, etc. of this option need to be parsed in a non-standardized manner (that is, these contents of the option need to be known in the C language). Whenever the option changes (such as the content, data type or range of the old option is modified) or a new option is added, the corresponding processing function needs to make corresponding changes. Summary of the Invention

[0004] (1) Technical issues to be resolved

[0005] The technical problem to be solved by the present invention is how to provide a method for recording changes in BIOS firmware configuration options, so as to solve the problem that the method for recording changes in BIOS firmware configuration options lacks convenience.

[0006] (2) Technical solution

[0007] In order to solve the above technical problems, the present invention proposes a method for recording changes in BIOS firmware configuration options, which includes the following steps:

[0008] S101. Execute the "Save Configuration" operation in the BIOS configuration interface to enter the processing flow of the ProcessAction function. Before the SubmitForm sub-function in the ProcessAction function, read the Variable variable area in Nvram and record it as VarStoreDataOrg.

[0009] S102, the SubmitForm function processes the changes in the BIOS configuration interface; if the BIOS configuration interface has not changed, exit the configuration interface and proceed to the next step of starting or restarting; if the BIOS configuration interface has changed, read the changed Variable variable area in Nvram again and record it as VarStoreDataMod;

[0010] S103. Compare VarStoreDataOrg and VarStoreDataMod. If they are the same, meaning the BIOS option variable area has not changed, exit the configuration interface and proceed to the next step of startup or restart. If they are different, meaning the BIOS option variable area has changed, enter the BIOS configuration interface option change comparison processing function HT706LogBIOSAudit.

[0011] S104, load EFI_HII_PACKAGE_FORMS type resource mHiiDatabase from HiiDataBase;

[0012] S105, through the ExportPackageLists operation, separate the Package resources in the mHiiDatabase into the package resource list HiiPackageList;

[0013] S106, parse HiiPackageList according to a specific format and length to obtain one of the page resources FormPackage;

[0014] S107, parse FormPackage according to the option format to obtain one of the option resources OpHeader;

[0015] S108. Obtain VarStoreId from the option resource OpHeader; obtain the name of the specific variable VarName in the Variable variable area in Nvram in steps S101 and S102 from VarStoreId;

[0016] S109. Parse the OpHeader content according to the OpHeader type and obtain the option name GetPromptString. Based on the VarName obtained in step S108, obtain the unchanged option value ValueOrg from VarStoreDataOrg before saving the configuration. Obtain the changed option value ValueMod from VarStoreDataMod after saving the configuration. Use gRT->GetTime to obtain the current system time. Use GetSystemAccessLevel to obtain the execution permission for the current firmware configuration interface.

[0017] S110. Obtain the data content before modification, ValueToStringOrg, and the data content after modification, ValueToStringMod, based on the unchanged option value, ValueOrg, before the configuration is saved, and the changed option value, ValueMod, after the configuration is saved. The option name, GetPromptString, the data content before modification, ValueToStringOrg, and the data content after modification, ValueToStringMod, as well as the current execution permission and the current system time, are recorded in the Flash memory. Simultaneously, these are sent to the out-of-band BMC via an IPMI communication OEM command for synchronous recording.

[0018] S111. Search for the next option resource OpHeader. If it exists, execute S108. If not, execute S112.

[0019] S112, search for the next page resource FormPackage, if it exists, execute S107, if not, proceed to the next step of starting or restarting.

[0020] (3) Beneficial effects

[0021] The present invention provides a method for recording changes in BIOS firmware configuration options, which has the following beneficial effects:

[0022] 1. For IT staff who operate and maintain the equipment, record the changes made to options by all operators based on administrator permissions and option change operation time, so as to facilitate regular inspection of equipment operation status;

[0023] 2. For equipment manufacturers, suppliers, and after-sales service providers, firmware configuration option modification records provide basic setting modification queries required in situations such as equipment failure or repair.

[0024] 3. It solves the problem of missing all normal or abnormal operations of the equipment from the time it is put into use to the maintenance or failure stage in the above-mentioned situation, and provides a traceable basis for equipment operation and failure analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 Flowchart of the present invention. DETAILED DESCRIPTION

[0026] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below with reference to the accompanying drawings and examples.

[0027] During the compilation process of the UEFI firmware, the Setup option content defined in .uni and .vfr is compiled by the Vfrcompile tool into a binary file and stored on the firmware Flash. When the firmware starts, it is driven by Ifr to load, parse and display it on the interface from the HII (Human Interface Infrastructure) database in the form of a Package. The present invention utilizes the access interface to Package resources provided by the HII framework to reversely separate the Formset page resources from the Package resources, and reversely obtain the options and related strings, data, etc. defined in .uni and .vfr before compilation from the option resources at runtime. The purpose of the present invention is to provide a method for recording changes in firmware configuration options by setting a function trigger point and comparing the changes in option resources before and after the modification and saving of BIOS firmware options. Existing options that comply with the UEFI specification can be identified by category, and options that comply with the UEFI specification in the future can be expanded for identification.

[0028] The present invention utilizes the feature that when the UEFI firmware is compiled, fonts, forms, strings, and images and other related HII resources are uniformly packaged into a package and loaded into the HiiDatabase database for real-time call at runtime. The interface option resources and related content are separated from the HiiDatabase database at runtime. First, EFI_HII_PACKAGE_FORMS (i.e., page resources) are filtered out by comparing the Package type defined in the UEFI standard. Then, in the page resources, the option resource data including EFI_IFR_ONE_OF_OP, EFI_IFR_NUMERIC_OP, EFI_IFR_STRING_OP, and EFI_IFR_CHECKBOX_OP are classified and processed, and the variable ID information in the resource is matched to the variable information in the corresponding Nvram. Next, the specific numerical value, string type, and length of each option resource are parsed separately according to the UEFI standard, and the local RTC is captured to provide a timestamp. Subsequently, information such as the current operating permission level, time, and content before and after option modification is spliced ​​to record the content string. Finally, the NorFlash read-write interface is used to complete in-band recording, and the IPMI communication interface is used to implement BMC out-of-band recording with OEM customized commands, and a query interface is provided.

[0029] The specific implementation steps are as follows:

[0030] S101. Execute the "Save Configuration" operation in the BIOS configuration interface to enter the processing flow of the ProcessAction function. Before the SubmitForm sub-function in the ProcessAction function, read the Variable variable area in Nvram and record it as VarStoreDataOrg.

[0031] S102, SubmitForm function processes the changes of BIOS configuration interface;

[0032] If the BIOS configuration interface does not change, exit the configuration interface and proceed to the next step of startup or restart;

[0033] If the BIOS configuration interface changes, read the changed Variable area in Nvram again and record it as VarStoreDataMod;

[0034] S103, compare VarStoreDataOrg and VarStoreDataMod;

[0035] If the two are the same, i.e. the BIOS option variable area has not changed, exit the configuration interface, and proceed to the next step of starting or restarting;

[0036] If the two are different, i.e. the BIOS option variable area has changed, enter the comparison BIOS configuration interface option change processing function HT706LogBIOSAudit;

[0037] S104, load the EFI_HII_PACKAGE_FORMS type resource mHiiDatabase from the HiiDataBase;

[0038] S105, separate the Package resource in mHiiDatabase into a package resource list HiiPackageList through the ExportPackageLists operation;

[0039] S106, parse HiiPackageList according to a specific format and length to obtain one of the page resources FormPackage;

[0040] Preferably, the parsing is according to the EFI_HII_PACKAGE_HEADER format and the offset of sizeof(EFI_HII_PACKAGE_LIST_HEADER).

[0041] S107, parse FormPackage according to the option format to obtain one of the option resources OpHeader;

[0042] Preferably, the parsing is according to the EFI_IFR_OP_HEADER format and the offset of sizeof(EFI_HII_PACKAGE_HEADER).

[0043] S108, obtain VarStoreId from the option resource OpHeader; and obtain the name VarName of the specific variable in the Variable variable area in the Nvram in the S101 and S102 steps through matching of VarStoreId;

[0044] For the option resource conforming to the UEFI standard, the first two members of the structure body definition are both the same EFI_IFR_OP_HEADER and EFI_IFR_QUESTION_HEADER, wherein VarStoreId in EFI_IFR_QUESTION_HEADER can be matched to obtain the name VarName of the specific variable in the Variable variable area in the Nvram in the S101 and S102 steps;

[0045] S109, parsing the OpHeader content according to the type of the OpHeader, obtaining the option name GetPromptString, obtaining the option value ValueOrg saved before the configuration is changed from the VarStoreDataOrg according to the VarName obtained in step S108, obtaining the option value ValueMod changed after the configuration from the VarStoreDataMod, obtaining the current system time by using gRT->GetTime, and obtaining the current firmware configuration interface execution authority by using GetSystemAccessLevel;

[0046] wherein,

[0047] If the type of the OpHeader is the EFI_IFR_ONE_OF_OP type, parsing the OpHeader content according to the format of the EFI_IFR_ONE_OF, obtaining the option name GetPromptString from the Prompt in the EFI_IFR_STATEMENT_HEADER under the EFI_IFR_QUESTION_HEADER in the EFI_IFR_ONE_OF structure by using HiiGetString, obtaining the option value ValueOrg saved before the configuration is changed from the VarStoreDataOrg according to the VarName obtained in step S108, obtaining the option value ValueMod changed after the configuration from the VarStoreDataMod, obtaining the current system time by using gRT->GetTime, and obtaining the current firmware configuration interface execution authority by using GetSystemAccessLevel;

[0048] If the type of the OpHeader is the EFI_IFR_NUMERIC_OP type, parsing the OpHeader content according to the format of the EFI_IFR_NUMERIC, obtaining the option name GetPromptString from the Prompt in the EFI_IFR_STATEMENT_HEADER under the EFI_IFR_QUESTION_HEADER in the EFI_IFR_NUMERIC_OP structure by using HiiGetString, obtaining the option value ValueOrg saved before the configuration is changed from the VarStoreDataOrg according to the VarName obtained in step S108, obtaining the option value ValueMod changed after the configuration from the VarStoreDataMod, obtaining the current system time by using gRT->GetTime, and obtaining the current firmware configuration interface execution authority by using GetSystemAccessLevel;

[0049] If the type of OpHeader is EFI_IFR_STRING_OP, parse the content of OpHeader according to the format of EFI_IFR_STRING, get the option name GetPromptString from the Prompt in the EFI_IFR_STATEMENT_HEADER under the EFI_IFR_QUESTION_HEADER in the EFI_IFR_STRING_OP structure by using HiiGetString, get the option value ValueOrg saved before the configuration is changed from VarStoreDataOrg according to the VarName obtained in step S108, get the option value ValueMod saved after the configuration is changed from VarStoreDataMod, convert ValueOrg and ValueMod into CHAR16 string format, get the current system time by using gRT->GetTime, and get the execution authority of the current firmware configuration interface by using GetSystemAccessLevel;

[0050] If the type of OpHeader is EFI_IFR_CHECKBOX_OP, parse the content of OpHeader according to the format of EFI_IFR_CHECKBOX, get the option name GetPromptString from the Prompt in the EFI_IFR_STATEMENT_HEADER under the EFI_IFR_QUESTION_HEADER in the EFI_IFR_CHECKBOX_OP structure by using HiiGetString, get the option value ValueOrg saved before the configuration is changed from VarStoreDataOrg according to the VarName obtained in step S108, get the option value ValueMod saved after the configuration is changed from VarStoreDataMod, get the current system time by using gRT->GetTime, and get the execution authority of the current firmware configuration interface by using GetSystemAccessLevel;

[0051] S110, according to the option value ValueOrg that has not been changed before saving the configuration and the option value ValueMod that has been changed after saving the configuration, obtain the data content before modification ValueToStringOrg and the data content after modification ValueToStringMod, record the option name GetPromptString, the data content before modification ValueToStringOrg and the data content after modification ValueToStringMod, as well as the current execution permission and the current system time in the Flash; at the same time, send the command to the out-of-band BMC through the IPMI communication OEM command, and record it synchronously

[0052] The Flash is the BIOS firmware Flash.

[0053] Among them, SendMessage is written and sent to the out-of-band BMC through IpmiOemCmd.

[0054] S111. Search for the next option resource OpHeader. If it exists, execute S108. If not, execute S112.

[0055] S112, search for the next page resource FormPackage, if it exists, execute S107, if not, proceed to the next step of starting or restarting.

[0056] The key points of the present invention are:

[0057] 1. Before and after the SubmitForm processing node is called to modify the BIOS firmware options, the Nvram variable in the Flash is read into the memory. By comparing the two contents, it is determined whether the firmware configuration interface options have changed.

[0058] 2. The BIOS firmware configuration interface page and option resources are loaded from the HiiDataBase database, and the page-related Package resources are gradually decomposed to obtain the option resource OpHeader. Finally, each option is decomposed by category in the option resource. The option content before and after the modification is determined by combining the VarstoreID in the option and the Nvram variable area before and after the option is modified.

[0059] 3. The option changes, system time, and execution permissions are packaged and stored on the Flash and sent synchronously to the BMC out-of-band, achieving in-band and out-of-band synchronization.

[0060] The present invention has the following beneficial effects:

[0061] 1. For IT staff who operate and maintain the equipment, record the changes made to options by all operators based on administrator permissions and option change operation time, so as to facilitate regular inspection of equipment operation status;

[0062] 2. For equipment manufacturers, suppliers, and after-sales service providers, firmware configuration option modification records provide basic setting modification queries required in situations such as equipment failure or repair.

[0063] 3. It solves the problem of missing all normal or abnormal operations of the equipment from the time it is put into use to the maintenance or failure stage in the above-mentioned situation, and provides a traceable basis for equipment operation and failure analysis.

[0064] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for recording changes in BIOS firmware configuration options, characterized in that: The method comprises the following steps: S101. Execute the "Save Configuration" operation in the BIOS configuration interface to enter the processing flow of the ProcessAction function. Before the SubmitForm sub-function within the ProcessAction function, read the Variable variable area in Nvram and record it as VarStoreDataOrg. S102, the SubmitForm function processes the changes in the BIOS configuration interface; if the BIOS configuration interface has not changed, exit the configuration interface and proceed to the next step of starting or restarting; if the BIOS configuration interface has changed, read the changed Variable variable area in Nvram again and record it as VarStoreDataMod; S103. Compare VarStoreDataOrg and VarStoreDataMod. If they are the same, meaning the BIOS option variable area has not changed, exit the configuration interface and proceed to the next step of startup or restart. If they are different, meaning the BIOS option variable area has changed, enter the BIOS configuration interface option change comparison processing function HT706LogBIOSAudit. S104, load EFI_HII_PACKAGE_FORMS type resource mHiiDatabase from HiiDataBase; S105, through the ExportPackageLists operation, separate the Package resources in the mHiiDatabase into the package resource list HiiPackageList; S106, parse HiiPackageList according to a specific format and length to obtain one of the page resources FormPackage; S107, parse FormPackage according to the option format to obtain one of the option resources OpHeader; S108. Obtain VarStoreId from the option resource OpHeader; obtain the name of the specific variable VarName in the Variable variable area in Nvram in steps S101 and S102 from VarStoreId; S109. Parse the OpHeader content according to the OpHeader type and obtain the option name GetPromptString. Based on the VarName obtained in step S108, obtain the unchanged option value ValueOrg from VarStoreDataOrg before saving the configuration. Obtain the changed option value ValueMod from VarStoreDataMod after saving the configuration. Use gRT->GetTime to obtain the current system time. Use GetSystemAccessLevel to obtain the execution permission for the current firmware configuration interface. S110. Obtain the data content before modification, ValueToStringOrg, and the data content after modification, ValueToStringMod, based on the unchanged option value, ValueOrg, before the configuration is saved, and the changed option value, ValueMod, after the configuration is saved. The option name, GetPromptString, the data content before modification, ValueToStringOrg, and the data content after modification, ValueToStringMod, as well as the current execution permission and the current system time, are recorded in the Flash memory. Simultaneously, these are sent to the out-of-band BMC via an IPMI communication OEM command for synchronous recording. S111. Search for the next option resource OpHeader. If it exists, execute S108. If not, execute S112. S112, search for the next page resource FormPackage, if it exists, execute S107, if not, proceed to the next step of starting or restarting.

2. The method for recording changes in BIOS firmware configuration options according to claim 1, wherein: In the above S106 , the EFI_HII_PACKAGE_HEADER format is used for parsing according to the offset of sizeof(EFI_HII_PACKAGE_LIST_HEADER).

3. The method for recording changes in BIOS firmware configuration options according to claim 1, wherein: In the above S107, the EFI_IFR_OP_HEADER format is used for parsing according to the offset of sizeof(EFI_HII_PACKAGE_HEADER).

4. The method for recording changes in BIOS firmware configuration options according to claim 1, wherein: In S108, for option resources that comply with the UEFI standard, the first two members of the structure definition are the same EFI_IFR_OP_HEADER and EFI_IFR_QUESTION_HEADER, wherein the VarStoreId in the EFI_IFR_QUESTION_HEADER can match the name VarName of the specific variable in the Variable variable area in Nvram in steps S101 and S102.

5. The method for recording changes in BIOS firmware configuration options according to claim 1, wherein: In S109, if the type of OpHeader is EFI_IFR_ONE_OF_OP, the OpHeader content is parsed according to the format of EFI_IFR_ONE_OF, and HiiGetString is used to obtain the option name GetPromptString from the Prompt in the EFI_IFR_STATEMENT_HEADER under the EFI_IFR_QUESTION_HEADER in the EFI_IFR_ONE_OF structure. According to the VarName obtained in step S108, the option value ValueOrg that has not been changed before saving the configuration is obtained from VarStoreDataOrg, and the option value ValueMod that has been changed after saving the configuration is obtained from VarStoreDataMod. The current system time is obtained using gRT->GetTime, and the execution permission of the current firmware configuration interface is obtained using GetSystemAccessLevel.

6. The method for recording changes in BIOS firmware configuration options according to claim 1, wherein: In S109, if the type of OpHeader is EFI_IFR_NUMERIC_OP type, the OpHeader content is parsed according to the EFI_IFR_NUMERIC format, and HiiGetString is used to obtain the option name GetPromptString from the Prompt in the EFI_IFR_STATEMENT_HEADER under the EFI_IFR_QUESTION_HEADER in the EFI_IFR_NUMERIC_OP structure. According to the VarName obtained in step S108, the option value ValueOrg that has not been changed before saving the configuration is obtained from VarStoreDataOrg, and the option value ValueMod that has been changed after saving the configuration is obtained from VarStoreDataMod. The current system time is obtained using gRT->GetTime, and the execution permission of the current firmware configuration interface is obtained using GetSystemAccessLevel.

7. The method for recording changes in BIOS firmware configuration options according to claim 1, wherein: In S109, if the type of OpHeader is EFI_IFR_STRING_OP, the OpHeader content is parsed according to the format of EFI_IFR_STRING, and HiiGetString is used to obtain the option name GetPromptString from the Prompt in the EFI_IFR_STATEMENT_HEADER under the EFI_IFR_QUESTION_HEADER in the EFI_IFR_STRING_OP structure. According to the VarName obtained in step S108, the option value ValueOrg that has not been changed before saving the configuration is obtained from VarStoreDataOrg, and the option value ValueMod that has been changed after saving the configuration is obtained from VarStoreDataMod. The ValueOrg and ValueMod are converted into CHAR16 string format, the current system time is obtained using gRT->GetTime, and the execution permission of the current firmware configuration interface is obtained using GetSystemAccessLevel.

8. The method for recording changes in BIOS firmware configuration options according to claim 1, wherein: In S109, if the type of OpHeader is EFI_IFR_CHECKBOX_OP, the OpHeader content is parsed according to the format of EFI_IFR_CHECKBOX, and HiiGetString is used to obtain the option name GetPromptString from the Prompt in the EFI_IFR_STATEMENT_HEADER under the EFI_IFR_QUESTION_HEADER in the EFI_IFR_CHECKBOX_OP structure. According to the VarName obtained in step S108, the option value ValueOrg that has not been changed before saving the configuration is obtained from VarStoreDataOrg, and the option value ValueMod that has been changed after saving the configuration is obtained from VarStoreDataMod. The current system time is obtained using gRT->GetTime, and the execution permission of the current firmware configuration interface is obtained using GetSystemAccessLevel.

9. The method for recording changes in BIOS firmware configuration options according to claim 1, wherein: In S110 , the Flash is the BIOS firmware Flash.

10. The method for recording changes in BIOS firmware configuration options according to claim 1, wherein: In S110, SendMessage is written and sent to the out-of-band BMC via IpmiOemCmd.

Citation Information

Patent Citations

  • BIOS (Basic Input / Output System) configuration information exporting method and importing method

    CN117785299A

  • Method and device for setting Setup option of BIOS (Basic Input / Output System) under operating system

    CN117785300A