Method for recording change of BIOS firmware configuration option
By reading and comparing the Nvram variable area in the BIOS configuration interface, using HiiDataBase to parse option resources, record changes in BIOS firmware configuration options, solving the problem of lack of convenience in the existing technology, and achieving convenience in changing BIOS firmware configuration options Recording and failure analysis.
Patent Information
- Application Number
- CN202411386216.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-09-30
AI Technical Summary
The prior art lacks convenience when recording changes in BIOS firmware configuration options. It is necessary to establish a non-standardized processing function for each option, and when adding or changing options, it is necessary to change the processing function accordingly.
By performing the save configuration operation in the BIOS configuration interface, reading the Variable variable area in Nvram, comparing the changes before and after the configuration, using HiiDataBase to load the EFI_HII_PACKAGE_FORMS type resource, parsing the option resource, obtaining the option name and value, recording it in Flash, and passing Ipmi Communications are synchronized to BMC.
It realizes convenient recording of changes in BIOS firmware configuration options, provides traceability basis for device operation and failure analysis, and simplifies the fault query process for IT staff and manufacturing supplies.
Smart Images

Figure CN119292695A_ABST
Abstract
Description
Technical Field
[0001] The 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, in which each option can configure the motherboard's underlying hardware devices, motherboard startup, operating system boot and other computer startup-related functions (such as enabling / disabling a certain device, adjusting the boot order, etc.). The modification of these options determines the execution of the hardware, driver and custom functions in each link of BIOS startup. The different settings of individual options and the associated settings of multiple options play a decisive role in the motherboard startup. Improper settings may even cause failures. Therefore, recording the changes to each option on the Setup interface is very beneficial to the normal operation of the device and fault tracing.
[0003] At present, 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 option code before modification on Flash. If the option changes, the variable save action occurs, and the option name and option data before and after the modification are compared, and the processing is performed in the program. The disadvantage of this method is the lack of convenience. Each option needs to establish a function processing branch, and the name, option data type, data range, etc. of this option are non-standardized parsed (that is, these contents of the option need to be known in the C language). Whenever the option changes (such as the old option modifies the content, data type or range) 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] (II) Technical solution
[0007] In order to solve the above technical problem, the present invention proposes a method for recording changes in BIOS firmware configuration options, the method comprising the following steps:
[0008] S101, execute the "Save Configuration" operation in the BIOS configuration interface, enter the processing flow of the ProcessAction function, and before the sub-function SubmitForm 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 the two are the same, that is, the BIOS option variable area has not changed, exit the configuration interface and proceed to the next step of starting or restarting; if the two are not the same, that is, the BIOS option variable area has changed, enter the BIOS configuration interface option change 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, parsing HiiPackageList according to a specific format and length to obtain one of the page resources FormPackage;
[0014] S107, parsing FormPackage according to the option format to obtain one of the option resources OpHeader;
[0015] S108, obtaining VarStoreId from the option resource OpHeader; matching VarStoreId to obtain the name VarName of the specific variable in the Variable variable area in Nvram in steps S101 and S102;
[0016] S109. Parse the OpHeader content according to the type of OpHeader, obtain the option name GetPromptString, obtain the option value ValueOrg that has not been changed before saving the configuration from VarStoreDataOrg according to the VarName obtained in step S108, obtain the option value ValueMod that has been changed after saving the configuration from VarStoreDataMod, use gRT->GetTime to obtain the current system time, and use GetSystemAccessLevel to obtain the execution permission of the current firmware configuration interface;
[0017] S110, obtaining the data content before modification ValueToStringOrg and the data content after modification ValueToStringMod according to the option value ValueOrg that has not been changed before the configuration is saved and the option value ValueMod that has been changed after the configuration is saved, recording 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; and sending them to the out-of-band BMC through the 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] (III) Beneficial effects
[0021] The present invention provides a method for recording changes in BIOS firmware configuration options, and the present invention has the following beneficial effects:
[0022] 1. For IT staff who operate and maintain the equipment, the information on options changed by all operators is recorded based on the administrator's authority and the time of option change operation, so as to facilitate regular inspection of the equipment's working status;
[0023] 2. For equipment manufacturers, suppliers and after-sales service providers, the firmware configuration option modification record provides basic setting modification queries required for 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 traceability basis for the equipment operation status and failure analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a flow chart 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 in conjunction with the drawings and examples.
[0027] During the compilation process of the UEFI firmware, the Setup option content defined by .uni and .vfr is compiled by the Vfrcompile tool into a binary file and stored in the firmware Flash. When the firmware is started, 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 UEFI specifications can be identified by category, and options that comply with UEFI specifications added in the future can be expanded for identification.
[0028] The present invention utilizes the feature that fonts, forms, strings, images and other related HII resources are uniformly packaged into Package when UEFI firmware is compiled, and loaded into HiiDatabase database for real-time call at runtime, and the option resources and related contents under the interface are separated from the HiiDatabase database at runtime. First, EFI_HII_PACKAGE_FORMS (i.e., page resources) are screened out by comparing the Package type in the UEFI standard definition. 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, the information such as the current running permission level, time and the content before and after the 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 custom 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, enter the processing flow of the ProcessAction function, and before the sub-function SubmitForm 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, that is, 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 not the same, that is, the BIOS option variable area has changed, the BIOS configuration interface option change processing function HT706LogBIOSAudit is entered;
[0037] S104, load EFI_HII_PACKAGE_FORMS type resource mHiiDatabase from HiiDataBase;
[0038] S105, through the ExportPackageLists operation, separate the Package resources in the mHiiDatabase into the package resource list HiiPackageList;
[0039] S106, parsing HiiPackageList according to a specific format and length to obtain one of the page resources FormPackage;
[0040] Preferably, in the EFI_HII_PACKAGE_HEADER format, the offset is parsed according to sizeof(EFI_HII_PACKAGE_LIST_HEADER).
[0041] S107, parsing FormPackage according to the option format to obtain one of the option resources OpHeader;
[0042] Preferably, the format is EFI_IFR_OP_HEADER and the offset is parsed according to sizeof(EFI_HII_PACKAGE_HEADER).
[0043] S108, obtaining VarStoreId from the option resource OpHeader; matching VarStoreId to obtain the name VarName of the specific variable in the Variable variable area in Nvram in steps S101 and S102;
[0044] For the 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 be matched to obtain the name VarName of the specific variable in the Variable variable area in Nvram in steps S101 and S102;
[0045] S109. Parse the OpHeader content according to the type of OpHeader, obtain the option name GetPromptString, obtain the option value ValueOrg that has not been changed before saving the configuration from VarStoreDataOrg according to the VarName obtained in step S108, obtain the option value ValueMod that has been changed after saving the configuration from VarStoreDataMod, use gRT->GetTime to obtain the current system time, and use GetSystemAccessLevel to obtain the execution permission of the current firmware configuration interface;
[0046] in,
[0047] If the type of OpHeader is EFI_IFR_ONE_OF_OP, parse the OpHeader content according to the format of EFI_IFR_ONE_OF, use HiiGetString 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, obtain the option value ValueOrg that has not been changed before saving the configuration from VarStoreDataOrg according to the VarName obtained in step S108, obtain the option value ValueMod that has been changed after saving the configuration from VarStoreDataMod, use gRT->GetTime to obtain the current system time, and use GetSystemAccessLevel to obtain the execution permission of the current firmware configuration interface;
[0048] If the type of OpHeader is EFI_IFR_NUMERIC_OP, parse the OpHeader content according to the format of EFI_IFR_NUMERIC, use HiiGetString 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, obtain the option value ValueOrg that has not been changed before saving the configuration from VarStoreDataOrg according to the VarName obtained in step S108, obtain the option value ValueMod that has been changed after saving the configuration from VarStoreDataMod, obtain the current system time using gRT->GetTime, and obtain the execution permission of the current firmware configuration interface using GetSystemAccessLevel;
[0049] If the type of OpHeader is EFI_IFR_STRING_OP, parse the OpHeader content according to the format of EFI_IFR_STRING, use HiiGetString 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, obtain the option value ValueOrg that has not been changed before saving the configuration from VarStoreDataOrg according to the VarName obtained in step S108, obtain the option value ValueMod that has been changed after saving the configuration from VarStoreDataMod, and convert ValueOrg and ValueMod into CHAR16 string format, use gRT->GetTime to obtain the current system time, and use GetSystemAccessLevel to obtain the execution permission of the current firmware configuration interface;
[0050] If the type of OpHeader is EFI_IFR_CHECKBOX_OP, parse the OpHeader content according to the format of EFI_IFR_CHECKBOX, use HiiGetString 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, obtain the option value ValueOrg that has not been changed before saving the configuration from VarStoreDataOrg according to the VarName obtained in step S108, obtain the option value ValueMod that has been changed after saving the configuration from VarStoreDataMod, use gRT->GetTime to obtain the current system time, and use GetSystemAccessLevel to obtain the execution permission of the current firmware configuration interface;
[0051] S110, according to the unchanged option value ValueOrg before saving the configuration and the changed option value ValueMod after saving the configuration, obtain the data content ValueToStringOrg before modification and the data content ValueToStringMod after modification, record the option name GetPromptString, the data content ValueToStringOrg before modification and the data content ValueToStringMod after modification, 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 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 BIOS firmware option modification processing node SubmitForm, read the Nvram variable in the Flash into the memory respectively, and determine whether the firmware configuration interface option has changed by comparing the contents of the two;
[0058] 2. Obtain the page and option resources in the BIOS firmware configuration interface by loading from the HiiDataBase database, gradually decompose the Package resources related to the page, further obtain the option resource OpHeader, and finally decompose each option by category in the option resource, and determine the option content before and after the option is modified 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-band to achieve in-band and out-band synchronous recording.
[0060] The present invention has the following beneficial effects:
[0061] 1. For IT staff who operate and maintain the equipment, the information on options changed by all operators is recorded based on the administrator's authority and the time of option change operation, so as to facilitate regular inspection of the equipment's working status;
[0062] 2. For equipment manufacturers, suppliers and after-sales service providers, the firmware configuration option modification record provides basic setting modification queries required for 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 traceability basis for the equipment operation status 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, enter the processing flow of the ProcessAction function, and read the Variable variable area in Nvram before the sub-function SubmitForm in the ProcessAction function, 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 the two are the same, that is, the BIOS option variable area has not changed, exit the configuration interface and proceed to the next step of starting or restarting; if the two are not the same, that is, the BIOS option variable area has changed, enter the BIOS configuration interface option change 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, parsing HiiPackageList according to a specific format and length to obtain one of the page resources FormPackage; S107, parsing FormPackage according to the option format to obtain one of the option resources OpHeader; S108, obtaining VarStoreId from the option resource OpHeader; matching VarStoreId to obtain the name VarName of the specific variable in the Variable variable area in Nvram in steps S101 and S102; S109. Parse the OpHeader content according to the type of OpHeader, obtain the option name GetPromptString, obtain the option value ValueOrg that has not been changed before saving the configuration from VarStoreDataOrg according to the VarName obtained in step S108, obtain the option value ValueMod that has been changed after saving the configuration from VarStoreDataMod, use gRT->GetTime to obtain the current system time, and use GetSystemAccessLevel to obtain the execution permission of the current firmware configuration interface; S110, obtaining the data content before modification ValueToStringOrg and the data content after modification ValueToStringMod according to the option value ValueOrg that has not been changed before the configuration is saved and the option value ValueMod that has been changed after the configuration is saved, recording 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; and sending them to the out-of-band BMC through the 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, characterized in that: 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, characterized in that: 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 the 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 type, the OpHeader content is parsed according to the format of EFI_IFR_ONE_OF, and the option name GetPromptString is obtained from the Prompt in the EFI_IFR_STATEMENT_HEADER under the EFI_IFR_QUESTION_HEADER in the EFI_IFR_ONE_OF structure using HiiGetString. The option value ValueOrg that has not been changed before saving the configuration is obtained from VarStoreDataOrg according to the VarName obtained in step S108, 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 format of EFI_IFR_NUMERIC, and the option name GetPromptString is obtained from the Prompt in the EFI_IFR_STATEMENT_HEADER under the EFI_IFR_QUESTION_HEADER in the EFI_IFR_NUMERIC_OP structure using HiiGetString. The option value ValueOrg that has not been changed before saving the configuration is obtained from VarStoreDataOrg according to the VarName obtained in step S108, 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, characterized in that: In S109, if the type of OpHeader is EFI_IFR_STRING_OP type, 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, and the option value ValueOrg that has not been changed before saving the configuration is obtained from VarStoreDataOrg according to the VarName obtained in step S108, and the option value ValueMod that has been changed after saving the configuration is obtained from VarStoreDataMod, and ValueOrg and ValueMod are converted into CHAR16 string format, and the current system time is obtained by gRT->GetTime, and the execution permission of the current firmware configuration interface is obtained by 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 type, 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, and the option value ValueOrg that has not been changed before saving the configuration is obtained from VarStoreDataOrg according to the VarName obtained in step S108, and the option value ValueMod that has been changed after saving the configuration is obtained from VarStoreDataMod, and the current system time is obtained by using gRT->GetTime, and the execution permission of the current firmware configuration interface is obtained by using GetSystemAccessLevel.
9. The method for recording changes in BIOS firmware configuration options according to claim 1, wherein: In S110, Flash is 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
System and Method for Mapping Platform Configuration Human Interface Infrastructure Data to System Attributes for Local and Remote System Management
US20120136888A1
Platform system, method for changing support hardware configuration of universal extensible firmware interface basic input output system and computer program product
US20150186161A1
Storing EFI variables in a BMC using an api
US20230251866A1
Cited By
Configuration method and device for customizing BIOS options based on GPIO
CN120762780A