BIOS firmware adaptation method and device, electronic equipment and readable medium

By entering the information configuration mode when the configuration information status of the BIOS program is invalid, obtaining and applying the configuration information entered by the user, the problem of low BIOS firmware adaptation efficiency is solved, and efficient configuration adjustment is achieved without recompiling and burning.

CN120723318APending Publication Date: 2025-09-30LOONGSON TECH CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510669523.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2025-09-30

AI Technical Summary

Technical Problem

In the prior art, BIOS firmware adaptation efficiency is low, and source code needs to be modified and recompiled and burned to adjust configuration information.

Method used

When it is detected that the configuration information state of the BIOS program is in an invalid state, the information configuration mode is entered, the target configuration information input by the user is obtained, and the target configuration information is set to a valid state to modify the configuration information of the BIOS program.

Benefits of technology

There is no need to modify the source code or recompile, which improves the adaptation efficiency of the BIOS firmware and enables flexible adjustment of the BIOS configuration information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120723318A_ABST
    Figure CN120723318A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a BIOS firmware adaptation method and device, electronic equipment and a readable medium, and relates to the technical field of computers, in the method, when it is detected that the configuration information state of a BIOS program in a target board card is an invalid state, an information configuration mode is entered; wherein the configuration information state is set as an invalid state after a reconfiguration instruction of a user is received. And obtaining target configuration information input by the user based on the information configuration mode. And setting the state of the configuration information as an effective state, and modifying the configuration information of the BIOS program based on the target configuration information. Thus, a user sets the configuration information state to be the invalid state based on the reconfiguration instruction, namely, new configuration information can be input in the information configuration mode, adjustment of the BIOS configuration information is achieved, and due to the fact that source codes do not need to be modified, recompiled and burnt, the BIOS firmware adaptation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a BIOS firmware adaptation method, device, electronic device, and readable medium. Background Art

[0002] At present, motherboards are used more and more widely as an important component of electronic devices. Motherboards usually use BIOS (Basic Input / Output System) program to control the device to start up, so as to initialize hardware devices, perform power-on self-test, and boot the operating system.

[0003] In the prior art, BIOS programs are usually compiled into binary files and then burned into electronic devices. When the configuration information of the BIOS program needs to be adjusted, the source code needs to be modified, and then recompiled and burned into the firmware, resulting in low BIOS firmware adaptation efficiency. Summary of the Invention

[0004] Embodiments of the present invention provide a BIOS firmware adaptation method, device, electronic device, and readable medium, which can solve the problem of low BIOS firmware adaptation efficiency.

[0005] In order to solve the above problems, an embodiment of the present invention discloses a BIOS firmware adaptation method, which includes:

[0006] Entering an information configuration mode when detecting that the configuration information state of the BIOS program in the target board is in an invalid state; wherein the configuration information state is set to an invalid state after receiving a reconfiguration instruction from the user;

[0007] Obtain target configuration information input by the user based on the information configuration mode;

[0008] The configuration information state is set to a valid state, and the configuration information of the BIOS program is modified based on the target configuration information.

[0009] On the other hand, an embodiment of the present invention discloses a BIOS firmware adaptation device, the device comprising:

[0010] An entry module, configured to enter an information configuration mode when detecting that the configuration information state of the BIOS program in the target board is in an invalid state; wherein the configuration information state is set to an invalid state after receiving a reconfiguration instruction from a user;

[0011] An acquisition module, configured to acquire target configuration information input by a user in the information configuration mode;

[0012] The first processing module is configured to set the configuration information state to a valid state and modify the configuration information of the BIOS program based on the target configuration information.

[0013] On the other hand, an embodiment of the present invention discloses an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the aforementioned method.

[0014] An embodiment of the present invention further discloses a machine-readable medium having instructions stored thereon. When executed by one or more processors, the processors are enabled to execute the method described above.

[0015] The embodiment of the present invention includes the following advantages: the BIOS firmware adaptation method provided by the embodiment of the present invention enters the information configuration mode when it is detected that the configuration information status of the BIOS program in the target board is in an invalid state; wherein the configuration information status is set to an invalid state after receiving the user's reconfiguration instruction. The target configuration information input by the user in the information configuration mode is obtained. The configuration information status is set to a valid state, and the configuration information of the BIOS program is modified based on the target configuration information. In this way, the user can set the configuration information status to an invalid state based on the reconfiguration instruction, and can enter new configuration information in the information configuration mode to adjust the BIOS configuration information. Since there is no need to modify the source code and recompile and burn it, the adaptation efficiency of the BIOS firmware is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0017] Figure 1 This is a flowchart of the steps of a BIOS firmware adaptation method provided by an embodiment of the present invention;

[0018] Figure 2 This is a schematic diagram of a processing flow provided by an embodiment of the present invention;

[0019] Figure 3 This is a state setting diagram provided by an embodiment of the present invention;

[0020] Figure 4 This is a configuration diagram provided by an embodiment of the present invention;

[0021] Figure 5 This is another configuration diagram provided by an embodiment of the present invention;

[0022] Figure 6 This is a block diagram of a BIOS firmware adaptation device provided by an embodiment of the present invention;

[0023] Figure 7 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0024] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0025] Figure 1 This is a flowchart of a BIOS firmware adaptation method provided by an embodiment of the present invention. Figure 1 As shown, the BIOS firmware adaptation method may include the following steps:

[0026] Step 101: Entering an information configuration mode when it is detected that the configuration information status of the BIOS program in the target board is invalid; wherein the configuration information status is set to invalid after receiving a reconfiguration instruction from the user.

[0027] Step 102: Obtain target configuration information input by the user in the information configuration mode.

[0028] Step 103: Set the configuration information status to a valid state, and modify the configuration information of the BIOS program based on the target configuration information.

[0029] The execution subject of the processing method provided in the embodiment of the present invention can be a target board or an electronic device equipped with the target board, and the target board can be the motherboard of the electronic device. The BIOS program can be a BIOS program developed for multiple boards, and these multiple boards use the same or different processors with the same architecture. For example, it can be a BIOS program developed for boards with different hardware designs using the same processor using the Loongson architecture. Accordingly, the target board can be any of these multiple boards. The BIOS program in the target board is pre-burned to the target board, and the BIOS program can be a binary file written into the storage area of ​​the target board.

[0030] The configuration information status indicates whether the current configuration information of the BIOS program in the target board is valid. That is, whether the current configuration information is valid or invalid is recorded in the target board and stored in the form of an array. For example, a row in the array represents the configuration information for a configuration item. The first column in the array represents the configuration item, and the second column represents the configuration information for the configuration item. The BIOS program configuration information can be stored in the target board. The BIOS program configuration information refers to various configuration parameters in the BIOS program. For example, the BIOS program configuration information may include central processing unit (CPU) main frequency, memory parameters, device resource parameters, and so on. Memory parameters may include memory frequency, memory timing, and memory voltage. Memory frequency refers to the operating frequency of the memory module. A higher memory frequency results in faster data transmission speeds. Excessively high memory frequency may cause memory module instability. Memory timing refers to the delay parameter when the memory module performs an operation. A lower memory timing results in faster memory response speeds. Excessively low memory timing may cause memory module instability. Memory voltage refers to the operating voltage of the memory module. Excessively high memory voltage may damage the memory module. In an embodiment of the present invention, the device resource parameters may include the interrupt request number, input / output port number, memory address range, and startup parameters allocated to the device in the board, etc. The memory address range is used to store data of the device, and the startup parameters are used to indicate whether to enable or disable the device.

[0031] Accordingly, the BIOS program will use the various configuration parameters in the configuration information to perform corresponding operations during operation. For example, the processor frequency is adjusted according to the CPU main frequency in the configuration information, and the memory frequency, memory timing and memory voltage of the memory module are set according to the memory parameters. In addition, according to the device configuration parameters of each device, the device is enabled or disabled, and the corresponding interrupt request number, input / output port number and memory address range are assigned to the device. If the configuration parameters set in the BIOS program do not match the actual working parameters corresponding to the hardware, it may cause the hardware to malfunction or fail to start. It should be noted that the configuration information can also include a startup sequence. Accordingly, the BIOS will detect and start the devices (for example, start the hard disk, Universal Serial Bus (USB), optical drive and other devices) in sequence according to the startup sequence. Furthermore, the BIOS program will also execute the operation of loading the boot program of the operating system and starting the operating system.

[0032] Among them, the reconfiguration instruction can be sent by the developer when the configuration information of the BIOS program needs to be adjusted. The reconfiguration instruction is used to instruct the configuration information status to be set to an invalid state in order to reconfigure the configuration information of the BIOS program. Accordingly, if the configuration information status is detected to be an invalid state, it means that the user has previously sent a reconfiguration instruction and the configuration information of the BIOS program needs to be adjusted. Accordingly, the information configuration mode can be entered in the invalid state. Among them, the configuration information of the BIOS program can be reconfigured in the information configuration mode. Specifically, the information configuration mode can also be called an interactive mode. The BIOS setting interactive interface will be displayed in the information configuration mode to facilitate the developer to reconfigure the configuration information through the reconfiguration instruction.

[0033] Furthermore, the configuration information input by the user in the information configuration mode is the configuration information reconfigured by the user in the information configuration mode. The configuration information reconfigured by the user in the information configuration mode can be obtained as the target configuration information, and the configuration information of the BIOS program can be modified based on the target configuration information. At the same time, the configuration information status is set to the valid state to ensure that the reconfigured target configuration information can be used subsequently.

[0034] In summary, the BIOS firmware adaptation method provided by the embodiment of the present invention enters the information configuration mode when it is detected that the configuration information status of the BIOS program in the target board is in an invalid state; wherein the configuration information status is set to an invalid state after receiving the user's reconfiguration instruction. The target configuration information input by the user in the information configuration mode is obtained. The configuration information status is set to a valid state, and the configuration information of the BIOS program is modified based on the target configuration information. In this way, the user can set the configuration information status to an invalid state based on the reconfiguration instruction, and can enter new configuration information in the information configuration mode to adjust the BIOS configuration information. Since there is no need to modify the source code and recompile and burn it, the adaptation efficiency of the BIOS firmware is improved.

[0035] Optionally, after starting the target board, the configuration information status of the BIOS program in the target board may be detected. The detection of the configuration information status may specifically include:

[0036] Step S21: Read the content at the first designated location as the target content.

[0037] Step S22: When the target content is a preset value, determine that the configuration information status is a valid status.

[0038] Step S23: Otherwise, determine that the configuration information status is invalid.

[0039] The BIOS firmware adaptation method provided in the embodiment of the present invention can be implemented in the form of a preset program. Specifically, the preset program is located on the target board. The preset program can be a startup program, that is, a program that is executed immediately after the computer is turned on. The preset program is used to implement the implementation logic of the BIOS firmware adaptation method in the embodiment of the present invention. Specifically, the preset program can be a part of the BIOS program. The preset program can be located at the head position of the BIOS. The preset program is first stored in the default storage location for immediate loading upon power-on, so that the preset program is executed immediately after power-on. For example, assuming that the default storage location for immediate loading upon power-on is 0x1000, the size of the preset program is 0x0500, and the size of the BIOS program is 0x2000. Then the preset program can be stored starting from 0x1000, and accordingly, the preset program is stored to 0x1000~0x1500. Then, the preset program BIOS program is stored starting from 0x1501 and stored to 0x1501-0x3500.

[0040] Specifically, in an embodiment of the present invention, the BIOS startup process may include first powering on the target board (i.e., booting the target board), then executing a preset program, and starting from step S21. Specifically, the first designated location may be used as an input parameter of a read command, and the read command may be executed to read the contents of the first designated location as the target content. The first designated location satisfies the requirements of being a non-volatile storage location on the target board and being a fixed location pre-specified by the developer. In an embodiment of the present invention, the content stored in the first designated location indicates whether the BIOS program configuration information is currently valid or invalid. Specifically, if the content stored in the first designated location is a preset value, the BIOS program configuration information is currently valid. Conversely, if the content stored in the first designated location is not a preset value, the BIOS program configuration information is currently invalid. The format and specific content of the preset value may be pre-set by the developer. For example, the preset value serves as a flag indicating a valid state, and the data structure of the preset value may be a numeric value or a string. For example, the preset value may be a fixed numeric value or a fixed string, but this embodiment of the present invention does not impose any limitation thereto.

[0041] Accordingly, the target content read this time can be compared with the preset value using a keyword. If the two match, the configuration information status is determined to be valid. Conversely, if the two do not match, the configuration information status is determined to be invalid. For example, the preset program predefines the specific values ​​of a first designated location and a preset value. Assuming the first designated location is 0x6000 and the preset value is a fixed value: 1111, the preset program can first read the first designated location parameter in memory to obtain 0x6000. Then, it reads from 0x6000 to obtain the target content. The preset value parameter is read to obtain the preset value: 1111. The preset value is then used as a keyword and keyword-matched with the target content. If the match is successful (i.e., the target content contains the keyword and the length of the target content is the same as the preset value), a first flag (e.g., TRUE) is generated to indicate that the configuration information status is valid. Otherwise, a second flag (e.g., FALSE) is generated to indicate that the configuration information status is invalid. For example, if the target content read this time is also 1111, the configuration information status is determined to be valid. On the contrary, if the target content read this time is empty or a number other than 1111, the configuration information status is determined to be invalid.

[0042] In the embodiment of the present invention, the configuration information state is represented by the content of the first designated position. Accordingly, when determining the current configuration information state, only the target content needs to be compared with the preset value. Therefore, the configuration information state determination efficiency is high.

[0043] Optionally, in the embodiment of the present invention, after the above step of detecting the configuration information status of the BIOS program in the target board, the following step may be further included:

[0044] Step S31: When it is detected that the configuration information is in a valid state, start the BIOS program.

[0045] In an embodiment of the present invention, the following step may also be included: starting the BIOS program based on the modified configuration information of the BIOS program.

[0046] In an embodiment of the present invention, if the configuration information status is detected to be valid, it indicates that the user does not need to adjust the configuration information of the BIOS program. Accordingly, in the valid state, the BIOS program can be directly started based on the current configuration information. The current configuration information of the BIOS program may be the configuration information previously configured for the BIOS program. Starting the BIOS program based on the current configuration information means executing the BIOS program to perform corresponding operations according to the configuration parameters in the current configuration information.

[0047] In the case where the configuration information is modified to the target configuration information, the BIOS program is started based on the modified configuration information to ensure that the configuration information modified by the user is used in this startup. Herein, starting the BIOS program with the modified configuration information refers to executing the BIOS program to perform corresponding operations according to the various configuration parameters in the modified configuration information. That is, in an embodiment of the present invention, after the configuration information status is set to a valid state and the configuration information is modified based on the target configuration information, the BIOS program is started based on the modified configuration information. For example, assuming that the various configuration parameters in the current configuration information are: CPU main frequency configuration item = 2.1GHz, memory frequency configuration item = 2000MHz, memory voltage configuration item = 1.1V, then when the first flag: TRUE is generated, that is, when it is detected that the configuration information status is a valid state, processing can be performed based on the CPU main frequency configuration item = 2.1GHz, memory frequency configuration item = 2000MHz, memory voltage configuration item = 1.1V. If the second flag is FALSE, i.e., the configuration information is detected to be invalid, the BIOS configuration information is modified based on the target configuration information. For example, after modification, the CPU main frequency configuration item is set to 2.2 GHz, the memory frequency configuration item is set to 2400 MHz, and the memory voltage configuration item is set to 1.2 V. Processing can then be performed based on the CPU main frequency configuration item being 2.2 GHz, the memory frequency configuration item being 2400 MHz, and the memory voltage configuration item being 1.2 V.

[0048] Take the default program as startup program S as an example, Figure 2 This is a schematic diagram of a processing flow provided by an embodiment of the present invention. Figure 2 As shown, in an embodiment of the present invention, the current configuration information of the BIOS program can be first obtained by starting the program S. Exemplarily, the configuration information of the BIOS program in the target board can be read from the second specified location. The second specified location is a predefined fixed location for storing the configuration information of the BIOS program. Then, it is determined whether the configuration information status is in a valid state, that is, the configuration information status of the BIOS program in the target board is detected by comparing the target content with the preset value. If the return value is the first flag, the configuration information status is in a valid state, and the BIOS program is started based on the current configuration information. If the configuration information status is in an invalid state, the information configuration mode is entered by displaying the target configuration item to reconfigure and obtain the target configuration information. The BIOS program is started based on the target configuration information. Specifically, after modifying the configuration information of the BIOS program based on the target configuration information, a startup command is called to start the BIOS program based on the modified configuration information.

[0049] In an embodiment of the present invention, each time the BIOS program is reconfigured with new configuration information, the newly configured configuration information (i.e., the modified configuration information) will be used to start the BIOS program. That is, the corresponding operations will be performed using the various configuration parameters in the newly configured configuration information. Accordingly, an operation can be performed to set the newly configured configuration information to a valid state to ensure that the target configuration information of subsequent new configurations is used. Furthermore, after starting the BIOS program, the configuration information state can be set to a valid state, and the configuration information of the BIOS program can be modified based on the target configuration information.

[0050] Optionally, the step of setting the configuration information status to a valid state may specifically include:

[0051] Step 1041: In response to the received setting instruction, set the content of the first designated location to the preset value.

[0052] The set instruction is used to set the content of the first designated location to a preset value. The specific type of the set instruction can be predefined by the developer and is not limited in this embodiment of the present invention. For example, the set instruction can be a write instruction, an assignment instruction, or the like. A set instruction can be sent by a user to modify the state of configuration information. Specifically, a set instruction is sent when a user needs to change the state of configuration information from an invalid state to a valid state. In this embodiment of the present invention, a user can set the state of configuration information to a valid state by writing the preset value to the first designated location via a set command, resulting in high setting efficiency. For example, the first designated location can be used as the address parameter (i.e., the destination address) of the set instruction, and the preset value can be used as the numerical parameter of the set instruction. The set instruction can then be invoked and executed to write the preset value to the first designated location. For example, if the first designated location is 0x6000 and the preset value is 1111, the set instruction can be MOV WORD PTR [0x6000], 1111. WORD PTR represents the size of the data stored at the destination address. By executing the setting instruction, the value stored in the first designated location 0x6000 can be set to the preset value 1111.

[0053] Optionally, the embodiment of the present invention may further include the following step: temporarily storing the acquired target configuration information in a buffer zone.

[0054] Accordingly, the step of modifying the configuration information of the BIOS program based on the target configuration information may specifically include:

[0055] Step 1042: Write the target configuration information in the buffer into a second designated location; the second designated location is used to store the configuration information of the BIOS program.

[0056] The buffer is a storage area in the memory or hardware register of the target board, and is used to store temporary data. The specific location of the buffer can be pre-set by the developer, and the embodiments of the present invention do not impose any restrictions on this. After the user reconfigures the configuration information, the target configuration information configured by the user can be temporarily stored in the buffer. After booting into the BIOS based on the target configuration information, it is detected whether the user needs to modify the configuration information status. In other words, it is detected whether the setting instruction sent by the user has been received. If so, the configuration information status is set to a valid state.

[0057] Accordingly, if the configuration information status is detected as valid, it indicates that the user has determined to enable the target configuration information set this time. Therefore, the target configuration information in the buffer can be written to the second designated location, that is, the target configuration information in the buffer can be saved to the second designated location. Conversely, if the configuration information status is detected as invalid, it indicates that the user does not enable the target configuration information set this time. Therefore, the target configuration information in the buffer can be discarded.

[0058] Since the second designated location is a location for storing the configuration information of the BIOS program, the configuration information of the BIOS program can be modified to the target configuration information by writing the target configuration information in the buffer into the second designated location. The second designated location meets the requirements: it is a non-volatile storage location in the target board and is different from the first designated location. The data in the second designated location is stored in the form of array data. For example, a row in the array represents the configuration information of a configuration item. The first column in the array represents the configuration item, and the second column represents the configuration information of the configuration item. At the same time, in an embodiment of the present invention, the configuration information status is set to a valid state only after the BIOS program is started based on the modified configuration information. In this way, it is possible to avoid setting the modified configuration information with the configuration information of the BIOS program in the case where the modified configuration information cannot start the BIOS program normally, thereby ensuring the reliability of the configuration information of the set BIOS program.

[0059] Optionally, the embodiment of the present invention may further include the following steps:

[0060] Step S61: In response to the received reconfiguration instruction, set the content of the first designated location to a non-preset value.

[0061] A reconfiguration instruction is an instruction for setting the contents of a first designated location to a non-preset value. The specific type of reconfiguration instruction can be predefined by the developer and is not limited in this embodiment of the present invention. For example, the reconfiguration instruction can be an erase instruction or a modify instruction. Accordingly, in response to the reconfiguration instruction, the contents of the first designated location can be erased or modified to a non-preset value, thereby setting the configuration information status to an invalid state. For example, the first designated location can be used as the address parameter (i.e., the destination address) of the modify instruction, and the default value can be used as the value parameter of the modify instruction. The modify instruction is called, and by executing the modify instruction, the default value is written to the first designated location, i.e., the value of the first designated location is changed to a non-preset value. The default value is a value different from the preset value. For example, if the first designated location is 0x6000 and the default value is 2222, the instruction can be MOV WORD PTR [0x6000], 2222. By executing this modify instruction, the value stored at 0x6000 can be set to 2222, thereby setting the configuration information status to an invalid state.

[0062] It should be noted that, when the BIOS program is burned to the target board for the first time, the configuration information state can be set to an invalid state by default. Accordingly, the user can send a setting instruction to set the configuration information state to a valid state, thereby enabling the configuration information of the BIOS program.

[0063] Furthermore, the reconfiguration instruction can be sent by the user when the user needs to modify the configuration information status. Specifically, the reconfiguration instruction is sent by the user when the user needs to change the configuration information status from a valid state to an invalid state. For example, after setting the configuration information status to a valid state and modifying the BIOS program configuration information based on the target configuration information, if the user needs to modify the status, step S61 above can be executed. In this embodiment of the present invention, the user can set the configuration information status to an invalid state using a reconfiguration instruction, which is highly efficient.

[0064] In an embodiment of the present invention, a reconfiguration instruction can be sent by a user when the configuration information of the BIOS needs to be adjusted. For example, when the target board fails the test, the user can determine that the current BIOS program is not compatible with the target board and needs to continue to adjust the configuration information of the BIOS. For example, the developer can perform a stability or functional test on the target board. If the target board fails the test and is unstable or malfunctioning, it is necessary to readjust certain configuration parameters. The developer can then send a reconfiguration instruction to set the configuration information status to an invalid state. For example, if the continuous operation time of the target board is less than the preset time, an abnormal power outage occurs, or the interface output of the target board is inconsistent with the expected output defined in the test file. For example, the output of the audio interface has no sound, and the expected output is the preset audio, so it can be determined that the test has not passed. Accordingly, the developer can select configuration parameters different from the current configuration parameters based on experience and input the reselected configuration parameters in the information configuration mode.

[0065] In this way, when the target board is started up next time, the configuration information status of the BIOS program in the target board is detected. If the configuration information status is detected to be invalid, the system enters the information configuration mode, allowing the developer to reconfigure the configuration information of the BIOS program. Of course, the developer can also send reconfiguration instructions in other situations. For example, the reconfiguration instructions may be sent when the target board has been adjusted, but this embodiment of the present invention does not limit this.

[0066] Figure 3 This is a state setting diagram provided by an embodiment of the present invention, such as Figure 3 As shown, after starting the BIOS program, it can be determined whether the user (for example, a developer) needs to modify the configuration information status. Specifically, when a reconfiguration instruction or a setting instruction is received, it is determined that modification is required. Otherwise, it is determined that modification is not required. Accordingly, in the case where no modification is required, the BIOS program can continue to be executed. In the case where modification is required, the modification mode of this time can be determined. Specifically, in the case where a reconfiguration instruction is received, it is determined that the modification mode of this time is an invalid mode, and accordingly, a clear operation can be performed to clear the content of the first designated storage location, so as to set the configuration information status to an invalid state. In the case where a setting instruction is received, it is determined that the modification mode of this time is a valid mode, and accordingly, a write operation can be performed to set the content of the first designated storage location to a preset value, so as to set the configuration information status to a valid state. Accordingly, the target configuration information saved in the buffer can be written to the second designated storage location to set the target configuration information as the configuration information of the BIOS program.

[0067] Optionally, in the embodiment of the present invention, the step of entering the information configuration mode may specifically include:

[0068] Step 1021: Use the first preset BIOS configuration item as the target configuration item.

[0069] Step 1022: Receive the configuration value set by the user for the target configuration item based on the candidate configuration value, and obtain target configuration information corresponding to the target configuration item.

[0070] Step 1023: If the configuration is successful, the next BIOS configuration item of the target configuration item is used as a new target configuration item until all configuration items are configured.

[0071] In an embodiment of the present invention, when the configuration information status is invalid, an interactive mode will be entered, and the user will be waited for input of the configuration value set for the BIOS configuration item at the configuration node of each BIOS configuration item. Specifically, in an embodiment of the present invention, a BIOS configuration item can be used to set a configuration parameter. The number of preset BIOS configuration items, the display order, and the candidate configuration values ​​of the BIOS configuration items can be pre-set by the developer. For example, the developer can set it based on the processor of the target board and the supported peripheral devices. The embodiment of the present invention does not limit this. Exemplarily, the BIOS configuration items can be stored in a tree structure. When the configuration is successful, a command to traverse the tree structure can be triggered. In response to the command, the next BIOS configuration item of the target configuration item (for example, a child node of the target configuration item) can be determined as a new target configuration item in the order of the tree traversal, thereby assisting the user in configuration.

[0072] The BIOS configuration item with the highest display order can be selected as the target configuration item. For example, the preset BIOS configuration items may include a CPU frequency configuration item, a memory parameter configuration item, and a device resource parameter configuration item. The device resource parameter configuration items include a device 1 resource parameter configuration item, a device 2 resource parameter configuration item, ..., and a device N resource parameter configuration item. The specific value of N is determined by the number of peripheral devices supported by the target board. The display order can be: CPU frequency configuration item - memory parameter configuration item - device 1 resource parameter configuration item - device 2 resource parameter configuration item - ..., and finally, device N resource parameter configuration item. In this case, the CPU frequency configuration item can be selected as the target configuration item. The CPU frequency configuration item and its candidate configuration values ​​are then displayed in the BIOS setup interactive interface. In this embodiment of the present invention, the candidate configuration values ​​for each BIOS configuration item are pre-verified and debugged to minimize the possibility of candidate configuration values ​​that could cause board abnormalities. The candidate configuration values ​​for each BIOS configuration item can be pre-programmed into a preset program, which can then display the candidate configuration values ​​for the BIOS configuration item to the user. The candidate configuration value can be a few fixed values ​​listed, or it can be a value range, and the user can select a value from the value range and input it. Furthermore, the configuration value set by the user for the target configuration item based on the candidate configuration value can be used as the configuration parameter represented by the target configuration item, thereby completing the configuration of the target configuration item. It should be noted that a skip option can also be displayed for each target configuration item. Accordingly, when the user selects the skip option, it can be determined that the user does not need to set the target configuration item this time. Accordingly, the target configuration information of the target configuration item is empty. When subsequent modifications are made, the target configuration items with empty target configuration information are not modified, that is, after the modification is completed, the configuration values ​​of these target configuration items remain unchanged.

[0073] For example, the CPU main frequency configuration item and the selected configuration value may be displayed as follows:

[0074] Choose the processor clock speed you want:

[0075] 1. 2.0GHz

[0076] 2.21GHz

[0077] 3. 2.2GHz

[0078] 4. 2.3GHz

[0079] 5. 2.4GHz

[0080] 6. 2.5GHz

[0081] Among them, "Choose the processor clock speed you want" represents the CPU main frequency configuration item, and 6 configuration values ​​are provided for this CPU main frequency configuration item. Accordingly, the user can enter the number of the frequency to be set. For example, if the user enters 3, 2.2GHz can be used as the CPU main frequency. Accordingly, when the BIOS program is subsequently executed, the processor frequency will be configured to 2.2GHz. For example, the BIOS program can modify the control register of the CPU and set the processor frequency to 2.2GHz, thereby causing the CPU to start working at a main frequency of 2.2GHz. It should be noted that in an embodiment of the present invention, after receiving the configuration value set by the user for the target configuration item, the configuration value set by the user can be used as the configuration parameter represented by the target configuration item, and the corresponding operation is performed according to the configuration parameter. For example, the operation of setting the CPU main frequency to 2.2GHz is executed. Among them, these 6 configuration values ​​to be selected are pre-set based on the processor used by the target board. It is assumed that the processor main frequency range defined in the user manual of the processor used by the target board is 2.0GHz-2.5GHz. Then, the developer can write 2.0GHz, 2.1GHz, 2.2GHz, 2.3GHz, 2.4GHz, and 2.5GHz in the preset program. In this way, when the preset program displays the CPU main frequency configuration item, it can directly display the six pre-written candidate configuration values.

[0082] After completing the configuration of the target configuration item, a determination is made as to whether the configuration was successful (i.e., whether the target configuration information caused an anomaly). Specifically, if no board anomaly occurs and the configuration value entered by the user does not exceed the candidate configuration value, the configuration is determined to be successful. Otherwise, a configuration anomaly is determined. A board anomaly may be caused by the board hardware design. For example, the board hardware may prevent the processor frequency from being set too high, but the user may enter a high processor frequency during actual configuration. This may result in an activation anomaly, such as a freezing issue. Optionally, the present invention may further include the following steps: Step S71: If the configuration fails, re-execute the step of entering the information configuration mode. Specifically, the preset program may be restarted and re-executed from step 101 to re-enter the information configuration mode and begin reconfiguration. Accordingly, when re-entering the information configuration mode, the user may enter other configuration values, for example, a lower processor frequency than the previous one to avoid configuration anomalies. In this way, by re-executing the step of entering the information configuration mode in the event of a configuration anomaly, the success rate of the user's self-configuration of the BIOS program's configuration information can be improved to a certain extent.

[0083] In an embodiment of the present invention, the target configuration information of a target configuration item may be written into the buffer once each time the target configuration information of the target configuration item is obtained. Alternatively, the target configuration information of all target configuration items may be written into the buffer at once when all configuration items have been configured.

[0084] Accordingly, when making modifications based on the target configuration information, for any target configuration item, if the target configuration information of the target configuration item is not empty, the configuration parameters of the target configuration item stored in the second designated location can be modified to the target configuration information of the target configuration item. Specifically, the modification can be performed multiple times as a single attribute modification operation, that is, after writing the target configuration information of a target configuration item into the buffer, a modification operation is performed to modify the configuration parameters of the target configuration item to the target configuration information of the target configuration item. For example, assume that the target configuration information set by the user for the CPU main frequency configuration item, memory frequency configuration item, and memory voltage configuration item are: 2.2GHz, 2400MHz, and 1.2V respectively. Then, the CPU main frequency configuration item = 2.2GHz can be written into the buffer first, and then based on the content written into the buffer, the CPU main frequency configuration item in the second designated location can be modified to 2.2GHz. Next, the memory frequency configuration item = 2400MHz can be written into the buffer first, and then based on the content written into the buffer, the memory frequency configuration item in the second designated location can be modified to 2400MHz. Next, the memory voltage configuration item = 1.2V is first written into the buffer, and then based on the content written into the buffer, the memory voltage configuration item in the second designated position is modified to 1.2V.

[0085] Alternatively, in other embodiments, a one-time multi-attribute modification operation may be performed, that is, after the target configuration information of all target configuration items is written to the buffer, the target configuration information of all target configuration items is uniformly modified. For example, the CPU main frequency configuration item = 2.2GHz, the memory frequency configuration item = 2400MHz, and the memory voltage configuration item = 1.2V are written to the buffer at one time, and then based on the content written in the buffer, the CPU main frequency configuration item in the second designated position is modified to 2.2GHz, the memory frequency configuration item is modified to 2400MHz, and the memory voltage configuration item is modified to 1.2V.

[0086] Figure 4 This is a configuration diagram provided by an embodiment of the present invention, such as Figure 4As shown, after the user inputs the processor main frequency, it can be determined whether it is abnormal, that is, whether the configuration is abnormal. If so, the preset program can be restarted. On the contrary, if there is no abnormality, the configuration of the next item can be continued. For example, the configuration of the memory parameter configuration item is performed. Specifically, the next BIOS configuration item that is located after the target configuration item in the display order can be used as the new target configuration item, and then the execution can be restarted from the above step 1022. That is, after the current target configuration item is successfully configured, the next item is configured. In this way, by using the BIOS configuration items as target configuration items in the display order, the configuration of each BIOS configuration item can be achieved.

[0087] Take N=2 as an example, Figure 5 This is another configuration diagram provided by an embodiment of the present invention, such as Figure 5 As shown, after the user enters the processor's main frequency, it can be determined whether it is abnormal, that is, whether the configuration is abnormal. If so, the preset program can be restarted. Otherwise, the memory parameter configuration items can be continued to be configured. After the user enters the memory parameters, it can be determined whether it is abnormal. If there is no abnormality, the device 1 resource configuration items can be continued to be configured. Specifically, after the user enters the configuration value set for the device 1 resource item, it can be determined whether it is abnormal. If there is no abnormality, the device 2 resource configuration items can be continued to be configured until the configuration of the device 2 resource configuration items is completed. Accordingly, after successfully configuring all configuration items, it can be booted into the BIOS. Among them, booting into the BIOS refers to performing corresponding operations based on the configuration values ​​entered by the user for each configuration item.

[0088] In the embodiment of the present invention, configuration is performed in the information configuration mode, and after completing one configuration item, the next configuration item is performed. If a configuration anomaly occurs, the configuration is re-performed. In this way, the problem of the configured parameters causing the board to be abnormal can be avoided as much as possible.

[0089] In one application scenario, an embodiment of the present invention can be applied to the board debugging stage. In one prior art, only debugged boards are supported, and this method has high limitations. In another prior art, the source code of the BIOS program needs to be compiled to generate a binary file, which is then burned to all target devices. The target device is an electronic device that uses a target board. Then, the board is tested to verify whether the burned BIOS program is normal. If an abnormality occurs, the parameters in the source code are readjusted and recompiled, and then the recompiled BIOS program is re-burned to the target device, and the code adjustment and recompilation are repeated until the board passes the test.

[0090] In an embodiment of the present invention, when the configuration information of the current BIOS is set to an invalid state, the system will enter an information setting mode, which allows users to configure the system as needed, and has high scalability. Specifically, when the BIOS program in the board is not compatible with the board, the user can set the configuration information of the BIOS to invalid information, so that after starting the board, the system can enter the information setting mode, allowing the user to set new configuration information for the BIOS program, which is equivalent to adjusting the BIOS program, thereby making the BIOS program compatible with the board. In this way, there is no need to repeatedly adjust and recompile the source code, which reduces the software development cycle, and the adaptation of the BIOS program to the current board can be achieved by directly adjusting the set configuration information on the current board, which has lower overhead and higher flexibility, scalability and convenience.

[0091] For any target board, the BIOS firmware adaptation method provided by the embodiment of the present invention can be used to achieve the adaptation of the BIOS program to these multiple target boards, ensuring that the BIOS program ultimately retained on each board in the multiple target boards can adapt to the target board. For example, it is assumed that BIOS program A is developed for all boards (board 1 and board 2) of a fixed model of processor. When program A is applied to board 1, the above-mentioned BIOS firmware adaptation method can be used for processing, so that the program A in board 1 is adjusted to the state of adapting to board 1. Further, board 2 can be used as a new target board and processed using the above-mentioned BIOS firmware adaptation method, so that the program A in the new board is adjusted to the state of adapting to board 2. In this way, the adaptation of different boards can be completed using the same BIOS binary file.

[0092] For example, assume that the default configuration parameters in the configuration information of BIOS program A are: CPU main frequency configuration item = 2.1GHz, memory frequency configuration item = 2000MHz, and memory voltage configuration item = 1.1V. With board 1 as the target board, the user sets the target configuration information as follows: CPU main frequency configuration item = 2.2GHz, memory frequency configuration item = 2400MHz, and memory voltage configuration item = 1.2V. After modifying the configuration information of BIOS program A in board 1 based on the target configuration information, board 1 can pass the board test. Therefore, the configuration information of BIOS program A in board 1 can be adjusted to CPU main frequency configuration item = 2.2GHz, memory frequency configuration item = 2400MHz, and memory voltage configuration item = 1.2V.

[0093] For example, if Board 2 is the target board, and the user sets the target configuration information as follows: CPU frequency = 2.4 GHz, memory frequency = 2200 MHz, and memory voltage = 1.3 V, and Board 2 passes the board test after modifying the configuration information of BIOS program A based on the target configuration information, then the configuration information of BIOS program A in Board 2 can be adjusted to CPU frequency = 2.4 GHz, memory frequency = 2200 MHz, and memory voltage = 1.3 V. In this way, by adaptively adjusting the configuration information, BIOS program A is fully compatible with both Boards 1 and 2.

[0094] In the event of hardware resource changes or BIOS startup anomalies, the prior art requires software recompilation and burning of the BIOS program. BIOS startup anomalies can be caused by BIOS configuration. In embodiments of the present invention, the existing BIOS configuration information can be disabled and readjusted through an information configuration mode to accommodate hardware resource changes or eliminate program startup anomalies, thereby enabling the target board to adapt to the BIOS program.

[0095] Reference Figure 6 , shows a block diagram of a BIOS firmware adaptation device provided by an embodiment of the present invention, such as Figure 6 As shown, the BIOS firmware adaptation device may specifically include:

[0096] Entering module 201, for entering information configuration mode when detecting that the configuration information status of the BIOS program in the target board is in an invalid state; wherein the configuration information status is set to an invalid state after receiving a reconfiguration instruction from the user;

[0097] An acquisition module 202 is configured to acquire target configuration information input by a user in the information configuration mode;

[0098] The first processing module 203 is configured to set the configuration information status to a valid status, and modify the configuration information of the BIOS program based on the target configuration information.

[0099] Optionally, the device further comprises:

[0100] A reading module, configured to read the content at the first designated location as target content;

[0101] The determination module is configured to determine that the configuration information state is a valid state when the target content is a preset value; otherwise, determine that the configuration information state is an invalid state.

[0102] Optionally, the device further comprises:

[0103] a second processing module, configured to set the content of the first designated location to a non-preset value in response to the received reconfiguration instruction;

[0104] The first processing module 203 is specifically configured to set the content of the first designated location to the preset value in response to the received setting instruction.

[0105] Optionally, the entry module 201 is specifically configured to:

[0106] Set the first preset BIOS configuration item as the target configuration item;

[0107] receiving a configuration value set by a user for the target configuration item based on the candidate configuration value, and obtaining target configuration information corresponding to the target configuration item;

[0108] If the configuration is successful, the next BIOS configuration item of the target configuration item is used as a new target configuration item until all configuration items are configured.

[0109] Optionally, the device further includes: a third processing module, configured to re-execute the step of entering the information configuration mode in case of configuration failure.

[0110] Optionally, the device further comprises: a storage module, configured to temporarily store the acquired target configuration information in a buffer zone;

[0111] The first processing module 203 is further configured to:

[0112] The target configuration information in the buffer is written into a second designated location; the second designated location is used to store the configuration information of the BIOS program.

[0113] Optionally, the device further comprises: a first startup module, configured to start the BIOS program when detecting that the configuration information state is a valid state;

[0114] The second startup module is configured to start the BIOS program based on the modified configuration information of the BIOS program.

[0115] In summary, in the BIOS firmware adaptation device provided by the embodiment of the present invention, when it is detected that the configuration information status of the BIOS program in the target board is in an invalid state, the information configuration mode is entered; wherein, the configuration information status is set to an invalid state after receiving the user's reconfiguration instruction. The target configuration information input by the user in the information configuration mode is obtained. The configuration information status is set to a valid state, and the configuration information of the BIOS program is modified based on the target configuration information. In this way, the user can set the configuration information status to an invalid state based on the reconfiguration instruction, and can enter new configuration information in the information configuration mode to adjust the BIOS configuration information. Since there is no need to modify the source code and recompile and burn it, the adaptation efficiency of the BIOS firmware is improved.

[0116] Reference Figure 7 Schematic diagram of the structure of the electronic device provided by the embodiment of the present invention. Figure 7 As shown, the electronic device includes: a processor, a memory, a communication interface and a communication bus.

[0117] The processor, the memory, and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, which enables the processor to execute the BIOS firmware adaptation method of the above embodiment. The executable instruction can form a program.

[0118] An embodiment of the present invention provides a machine-readable medium having instructions stored thereon. When executed by one or more processors, the processors are enabled to execute the BIOS firmware adaptation method of the aforementioned embodiment.

[0119] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0120] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, apparatus, or computer program products. Thus, embodiments of the present invention may take the form of a fully hardware embodiment, a fully software embodiment, or an embodiment combining software and hardware. Furthermore, embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0121] It should be noted that all actions of acquiring signals, information or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.

[0122] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the process in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0123] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a predictable manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0124] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0125] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0126] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.

[0127] Moreover, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or terminal device that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not preclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.

[0128] The above describes in detail a BIOS firmware adaptation method, a BIOS firmware adaptation device, an electronic device, and one or more readable media provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only intended to help understand the method and core ideas of the present invention. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.

Claims

1. A BIOS firmware adaptation method, characterized in that: The method comprises: Entering an information configuration mode when detecting that the configuration information state of the BIOS program in the target board is in an invalid state; wherein the configuration information state is set to an invalid state after receiving a reconfiguration instruction from the user; Obtain target configuration information input by the user based on the information configuration mode; The configuration information state is set to a valid state, and the configuration information of the BIOS program is modified based on the target configuration information.

2. The method according to claim 1, characterized in that The method further comprises: Read the content at the first specified location as the target content; In a case where the target content is a preset value, the configuration information state is determined to be a valid state; otherwise, the configuration information state is determined to be an invalid state.

3. The method according to claim 2, characterized in that The method further comprises: In response to the received reconfiguration instruction, setting the content of the first designated location to a non-preset value; Setting the configuration information state to a valid state includes: setting the content of the first designated location to the preset value in response to a received setting instruction.

4. The method according to claim 1, wherein Entering the information configuration mode includes: Set the first preset BIOS configuration item as the target configuration item; receiving a configuration value set by a user for the target configuration item based on the candidate configuration value, and obtaining target configuration information corresponding to the target configuration item; If the configuration is successful, the next BIOS configuration item of the target configuration item is used as a new target configuration item until all configuration items are configured.

5. The method according to claim 4, characterized in that The method further comprises: if the configuration fails, re-executing the step of entering the information configuration mode.

6. The method according to any one of claims 1 to 5, characterized in that The method further includes: temporarily storing the acquired target configuration information in a buffer; The modifying the configuration information of the BIOS program based on the target configuration information includes: The target configuration information in the buffer is written into a second designated location; the second designated location is used to store the configuration information of the BIOS program.

7. The method according to any one of claims 1 to 5, characterized in that The method further includes: starting the BIOS program when detecting that the configuration information status is a valid state; The method further comprises: The BIOS program is started based on the modified configuration information of the BIOS program.

8. A BIOS firmware adapter device, characterized in that: The device comprises: An entry module, configured to enter an information configuration mode when detecting that the configuration information state of the BIOS program in the target board is in an invalid state; wherein the configuration information state is set to an invalid state after receiving a reconfiguration instruction from a user; An acquisition module, configured to acquire target configuration information input by a user in the information configuration mode; The first processing module is configured to set the configuration information state to a valid state and modify the configuration information of the BIOS program based on the target configuration information.

9. An electronic device, characterized in that: include: A processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; The memory is used to store executable instructions, and the executable instructions enable the processor to execute the method according to any one of claims 1 to 7.

10. One or more machine-readable media, characterized in that Instructions are stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1 to 7.