BIOS (Basic Input / Output System) upgrading method, system and equipment and storage medium
By setting preset register identification upgrade status in the Open POWER server, separating the BIOS image file and upgrading it by BMC when the host restarts, the problems of Flash image corruption and inefficiency are solved, and a safe and efficient BIOS upgrade is achieved.
Patent Information
- Application Number
- CN202510584731.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, the in-band BIOS upgrade method of Open POWER server is prone to corruption of Flash images and is inefficient, so that the previous BIOS image cannot be restored when interrupted.
By setting the preset register to identify the upgrade status, separate the updated BIOS image file and the running BIOS image file, use BMC to upgrade when the host restarts, ensure that the Flash image is updated after the upgrade is completed, and provide a failed recovery mechanism.
It realizes the secure upgrade of BIOS images, avoids Flash image corruption, improves upgrade efficiency, and can easily restore to the previous BIOS images in case of failure.
Smart Images

Figure CN120406988A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of BIOS, and in particular to a BIOS upgrade method, system, device, and storage medium. Background Art
[0002] During the operation and maintenance of servers, it is often necessary to upgrade the BIOS (Basic Input Output System) image in - band.
[0003] Previously, the in - band BIOS upgrade method for Open POWER servers was mainly based on the ipmi (Intelligent Platform Management Interface) protocol. By sending the BIOS image in segments to the BMC (Baseboard Management Controller), the BMC then writes it into the BIOS image Flash (flash memory) to achieve BIOS image update. However, this method can only write to the Flash at a fixed segment length. If the writing is interrupted in the middle, it will cause the image in the Flash to be damaged. Once the image in the Flash is damaged, the previous BIOS image cannot be restored. Moreover, this method is complex to implement, and the refresh program cannot be exited until the BIOS image is completely written into the Flash, resulting in low efficiency. Summary of the Invention
[0004] In view of this, in order to overcome at least one aspect of the above problems, an embodiment of the present invention provides a BIOS upgrade method, including the following steps: In response to receiving an upgrade instruction, the host updates a preset register to a first state; In response to the BMC detecting that the preset register is in the first state, a temporary folder is created and the preset register is updated to a second state; In response to the host detecting that the preset register is in the second state, the BIOS file to be upgraded is sent to the temporary folder, and after the sending is completed, the preset register is updated to a third state; In response to the BMC detecting that the preset register is in the third state, the BMC upgrades the BIOS using the BIOS file to be upgraded in the temporary folder.
[0005] In some embodiments, the BMC upgrades the BIOS using the BIOS file to be upgraded in the temporary folder, further including: The BMC updates the preset register to a fourth state; In response to the host detecting that the preset register is in the fourth state, a restart is performed; When the host restarts, the BMC recombines the BIOS file to be upgraded in the temporary folder into a BIOS image file and writes it into the BIOS Flash.
[0006] In some embodiments, before the host updates the preset register to the first state, it further includes: Dividing the BIOS image file into multiple sub-files; Displaying the name and detailed information description of each of the sub-files.
[0007] In some embodiments, in response to the host detecting that the preset register is in the second state, when sending the BIOS file to be upgraded to the temporary folder, it further includes: According to the upgrade instruction, sending several sub-files to be upgraded selected by the user to the temporary folder.
[0008] In some embodiments, it further includes: In response to the host not detecting that the BMC updates the preset register to the second state within a preset time period, updating the preset register to the fifth state.
[0009] In some embodiments, it further includes: In response to the host not detecting that the BMC updates the preset register to the fourth state within a preset time period, updating the preset register to the fifth state.
[0010] In some embodiments, it further includes: In response to the BMC detecting that the preset register is in the fifth state, deleting the temporary folder.
[0011] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a BIOS upgrade system, including a host and a BMC, wherein: The host is configured to update the preset register to the first state in response to receiving an upgrade instruction; The BMC is configured to create a temporary folder and update the preset register to the second state in response to detecting that the preset register is in the first state; The host is further configured to send the BIOS file to be upgraded to the temporary folder in response to detecting that the preset register is in the second state, and update the preset register to the third state after the sending is completed; The BMC is further configured to upgrade the BIOS by using the BIOS file to be upgraded in the temporary folder in response to detecting that the preset register is in the third state.
[0012] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a computer device, including: at least one processor; and a memory storing a computer program that can run on the processor, and when the processor executes the program, it performs the steps of any one of the BIOS upgrade methods described above.
[0013] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, it performs the steps of any one of the BIOS upgrade methods described above.
[0014] One of the beneficial technical effects of the present invention is as follows: The solution proposed by the present invention sets a preset register for identifying the upgrade status, marks the current update status by modifying the value of the preset register, then separates the updated BIOS image file from the BIOS image file running in the BMC, and then the BMC upgrades the BIOS image file when the Host restarts. In this way, it can be determined whether the BIOS image has been upgraded. Only when the upgrade is completed, the BIOS image file is actually updated. In case of upgrade failure, the BMC can easily restore the previous BIOS image. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other embodiments can be obtained based on these drawings.
[0016] Figure 1 A flowchart of the BIOS upgrade method provided by the embodiment of the present invention; Figure 2 A flowchart block diagram of the BIOS upgrade method provided by the embodiment of the present invention; Figure 3 A schematic diagram of splitting and sending the BIOS file provided by the embodiment of the present invention; Figure 4 A schematic structural diagram of the BIOS upgrade system provided by the embodiment of the present invention; Figure 5 A schematic structural diagram of the computer device provided by the embodiment of the present invention; Figure 6 A schematic structural diagram of the computer-readable storage medium provided by the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0017] To make the objectives, technical solutions, and advantages of the present invention more clear and understandable, the following further elaborates on the embodiments of the present invention in detail with reference to specific embodiments and the accompanying drawings.
[0018] It should be noted that all the expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two entities or parameters with the same name but different identities. It can be seen that "first" and "second" are only for the convenience of expression and should not be construed as a limitation on the embodiments of the present invention. This will not be elaborated one by one in the subsequent embodiments.
[0019] According to one aspect of the present invention, an embodiment of the present invention provides a BIOS upgrade method, as Figure 1 shown, which may include the steps: S1. In response to receiving an upgrade instruction, the host updates a preset register to a first state; S2. In response to the BMC detecting that the preset register is in the first state, create a temporary folder and update the preset register to a second state; S3. In response to the host detecting that the preset register is in the second state, send the BIOS file to be upgraded to the temporary folder, and after the sending is completed, update the preset register to a third state; S4. In response to the BMC detecting that the preset register is in the third state, the BMC upgrades the BIOS using the BIOS file to be upgraded in the temporary folder.
[0020] The solution proposed by the present invention sets a preset register for identifying the upgrade status, marks the current update status by modifying the value of the preset register, and then separates the updated BIOS image file from the BIOS image file running in the BMC. When the Host restarts, the BMC upgrades the BIOS image file. In this way, it can be determined whether the BIOS image has been upgraded successfully. Only when the upgrade is completed, the BIOS image file is actually updated. In case of an upgrade failure, the BMC can easily restore the previous BIOS image.
[0021] In some embodiments, the BMC upgrades the BIOS using the BIOS file to be upgraded in the temporary folder, which further includes: The BMC updates the preset register to a fourth state; In response to the host detecting that the preset register is in the fourth state, perform a restart; When the host restarts, the BMC reorganizes the BIOS file to be upgraded in the temporary folder into a BIOS image file and writes it into the BIOS Flash.
[0022] Specifically, as Figure 2 shown, after receiving the upgrade instruction, the Host changes the state of the preset register to start the upgrade (the first state). After the BMC receives the change in the state of the preset register, it performs pre-upgrade preparation work, creates a temporary folder to store the upgraded BIOS file, and then changes the state of the preset register to start (the second state). After the host sends the BIOS file to be upgraded to the BMC, the BMC stores the received file in the temporary folder, and then the host updates the state of the preset register to sent complete (the third state). At this time, if the BMC detects that the state of the preset register is the third state, it updates it to end (the fourth state), indicating that the upgrade is complete. After the upgrade is complete, the BMC waits for the Host to restart. When the Host restarts, the BMC reorganizes the files in the temporary folder into a BIOS image and writes it to the BIOS Flash.
[0023] In some embodiments, before the host updates the preset register to the first state, it further includes: Dividing the BIOS image file into multiple sub-files; Displaying the name and detailed information description of each of the sub-files.
[0024] In some embodiments, in response to the host detecting that the preset register is in the second state and sending the BIOS file to be upgraded to the temporary folder, it further includes: Sending several sub-files to be upgraded selected by the user to the temporary folder according to the upgrade instruction.
[0025] Specifically, as Figure 3 shown, the BIOS Image can be split into multiple Parts according to its logical structure and placed in the database. After the splitting is completed, the help information of the split Parts is retrieved from the database, and the Part names and corresponding Help information of the BIOS Image to be upgraded this time are displayed. The user can choose which Parts to keep or refresh, and then send them to the BMC.
[0026] In some embodiments, the interaction between the host, the preset register, and the BMC can be implemented based on PLDM commands.
[0027] In some embodiments, it further includes: In response to the host not detecting that the BMC updates the preset register to the second state within a preset time period, updating the preset register to the fifth state.
[0028] In some embodiments, it further includes: In response to the host not detecting that the BMC updates the preset register to the fourth state within a preset time period, update the preset register to the fifth state.
[0029] Specifically, as Figure 2 shown, if the BMC fails to modify the state due to timeout, for example, fails to update the preset register to the second state due to timeout, or fails to update the preset register to the fourth state due to timeout, the host will update the preset register to ABORT (the fifth state).
[0030] In some embodiments, it further includes: In response to the BMC detecting that the preset register is in the fifth state, delete the temporary folder.
[0031] Specifically, if the upgrade process times out or fails, the BMC directly deletes the content in the Staging folder and waits for the next upgrade, so as not to affect the original un-upgraded image in the BIOS Flash. Or whether the Host shuts down during the upgrade process or there is a forced power-off, the current upgrade is terminated and the BMC does not retain the content in the Staging folder.
[0032] The solution proposed by the present invention sets a preset register for identifying the upgrade state, marks the current update state by modifying the value of the preset register, and then separates the updated BIOS image file from the BIOS image file running in the BMC. When the Host restarts, the BMC upgrades the BIOS image file again. In this way, it can be determined whether the BIOS image has been upgraded successfully. Only when the upgrade is completed, the BIOS image file is actually updated. In case of upgrade failure, the BMC can conveniently restore the previous BIOS image.
[0033] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a BIOS upgrade system 400, as Figure 4 shown, including a host 401 and a BMC 402, wherein: The host 401 is configured to update the preset register to the first state in response to receiving an upgrade instruction; The BMC 402 is configured to create a temporary folder and update the preset register to the second state in response to detecting that the preset register is in the first state; The host 401 is further configured to send the BIOS file to be upgraded to the temporary folder in response to detecting that the preset register is in the second state, and update the preset register to the third state after the sending is completed; The BMC 402 is further configured to upgrade the BIOS by using the BIOS file to be upgraded in the temporary folder in response to detecting that the preset register is in the third state.
[0034] The solution proposed by the present invention sets a preset register for identifying the upgrade status, marks the current update status by modifying the value of the preset register, and then separates the updated BIOS image file from the BIOS image file running in the BMC. When the Host restarts, the BMC upgrades the BIOS image file, so that it can be determined whether the BIOS image upgrade is completed. Only when the upgrade is completed, the BIOS image file is actually updated. In case of upgrade failure, the BMC can easily restore the previous BIOS image.
[0035] In some embodiments, the BMC upgrades the BIOS by using the BIOS file to be upgraded in the temporary folder, further including: The BMC updates the preset register to the fourth state; In response to the host detecting that the preset register is in the fourth state, it performs a restart; When the host restarts, the BMC reorganizes the BIOS file to be upgraded in the temporary folder into a BIOS image file and writes it into the BIOS Flash.
[0036] In some embodiments, before the host updates the preset register to the first state, it further includes: Dividing the BIOS image file into multiple sub-files; Displaying the name and detailed information description of each sub-file.
[0037] In some embodiments, in response to the host detecting that the preset register is in the second state, sending the BIOS file to be upgraded to the temporary folder, further including: According to the upgrade instruction, sending several sub-files selected by the user to be upgraded to the temporary folder.
[0038] In some embodiments, it further includes: In response to the host not detecting that the BMC updates the preset register to the second state within a preset time period, updating the preset register to the fifth state.
[0039] In some embodiments, it further includes: In response to the host not detecting that the BMC updates the preset register to the fourth state within a preset time period, updating the preset register to the fifth state.
[0040] In some embodiments, it further includes: In response to the BMC detecting that the preset register is in the fifth state, deleting the temporary folder.
[0041] The solution proposed by the present invention sets a preset register for identifying the upgrade status, marks the current update status by modifying the value of the preset register, and then separates the updated BIOS image file from the BIOS image file running in the BMC. When the Host restarts, the BMC upgrades the BIOS image file. In this way, it can be determined whether the BIOS image upgrade is completed, and only when the upgrade is completed, the BIOS image file is actually updated. In case of upgrade failure, the BMC can easily restore the previous BIOS image.
[0042] Based on the same inventive concept, according to another aspect of the present invention, as Figure 5 shown, an embodiment of the present invention further provides a computer device 501, including: at least one processor 520; and a memory 510, where the memory 510 stores a computer program 511 that can run on the processor. When the processor 520 executes the program, it executes the steps of any one of the above BIOS upgrade methods.
[0043] Based on the same inventive concept, according to another aspect of the present invention, as Figure 6 shown, an embodiment of the present invention further provides a computer-readable storage medium 601. The computer-readable storage medium 601 stores a computer program 610. When the computer program 610 is executed by a processor, it executes the steps of any one of the above BIOS upgrade methods.
[0044] Finally, it should be noted that those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods.
[0045] In addition, it should be understood that the computer-readable storage medium herein (for example, a memory) can be a volatile memory or a non-volatile memory, or can include both a volatile memory and a non-volatile memory.
[0046] Those skilled in the art will also understand that the various exemplary logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability of hardware and software, a general description of the functions of various illustrative components, blocks, modules, circuits, and steps has been given. Whether this function is implemented as software or as hardware depends on the specific application and the design constraints imposed on the overall system. The functions that those skilled in the art can implement in various ways for each specific application, but this implementation decision should not be construed as causing a departure from the scope of the disclosure of the embodiments of the present invention.
[0047] The foregoing are exemplary embodiments disclosed by the present invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the embodiments disclosed by the present invention as defined by the claims. The functions, steps, and / or actions of the method claims according to the disclosed embodiments herein need not be performed in any particular order. In addition, although the elements disclosed by the embodiments of the present invention may be described or claimed in individual form, they can also be understood as plural unless explicitly limited to the singular form.
[0048] It should be understood that, as used herein, unless the context clearly supports exceptions, the singular form "a" is also intended to include the plural form. It should also be understood that the "and / or" used herein refers to any and all possible combinations of one or more of the related listed items.
[0049] The serial numbers of the foregoing disclosed embodiments of the present invention are only for description and do not represent the superiority or inferiority of the embodiments.
[0050] Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, or can be completed by a program instructing the relevant hardware. The program can be stored in a computer-readable storage medium. The above-mentioned storage medium can be a read-only memory, a magnetic disk, an optical disc, or the like.
[0051] Those of ordinary skill in the art should understand that: the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the embodiments disclosed by the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features between the above embodiments or different embodiments can also be combined, and there are many other variations in different aspects of the above embodiments of the present invention, which are not provided in detail for the sake of brevity. Therefore, any omission, modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present invention shall be included in the protection scope of the embodiments of the present invention.
Claims
1. A BIOS upgrade method, characterized in that, It includes the following steps: In response to receiving an upgrade instruction, the host updates a preset register to a first state; In response to the BMC detecting that the preset register is in the first state, a temporary folder is created and the preset register is updated to a second state; In response to the host detecting that the preset register is in the second state, the BIOS file to be upgraded is sent to the temporary folder, and after the sending is completed, the preset register is updated to a third state; In response to the BMC detecting that the preset register is in the third state, the BMC upgrades the BIOS by using the BIOS file to be upgraded in the temporary folder.
2. The method according to claim 1, characterized in that The BMC upgrades the BIOS by using the BIOS file to be upgraded in the temporary folder, which further includes: The BMC updates the preset register to a fourth state; In response to the host detecting that the preset register is in the fourth state, a restart is performed; When the host restarts, the BMC recombines the BIOS file to be upgraded in the temporary folder into a BIOS image file and writes it into the BIOS Flash.
3. The method according to claim 1, wherein Before the host updates the preset register to the first state, it further includes: Dividing the BIOS image file into multiple sub-files; Displaying the name and detailed information description of each of the sub-files.
4. The method according to claim 3, wherein In response to the host detecting that the preset register is in the second state and sending the BIOS file to be upgraded to the temporary folder, it further includes: According to the upgrade instruction, several sub-files selected by the user are sent to the temporary folder.
5. The method according to claim 1, wherein It further includes: In response to the host not detecting that the BMC updates the preset register to the second state within a preset time period, the preset register is updated to a fifth state.
6. The method according to claim 2, wherein It further includes: In response to the host not detecting that the BMC updates the preset register to the fourth state within a preset time period, the preset register is updated to a fifth state.
7. The method according to claim 5 or 6, characterized in that It further includes: In response to the BMC detecting that the preset register is in the fifth state, the temporary folder is deleted.
8. A BIOS upgrade system, characterized in that, It includes a host and a BMC, wherein: The host is configured to update a preset register to a first state in response to receiving an upgrade instruction; The BMC is configured to create a temporary folder and update the preset register to a second state in response to detecting that the preset register is in the first state; The host is further configured to send the BIOS file to be upgraded to the temporary folder in response to detecting that the preset register is in the second state, and update the preset register to a third state after the sending is completed; The BMC is further configured to upgrade the BIOS by using the BIOS file to be upgraded in the temporary folder in response to detecting that the preset register is in the third state.
9. A computer device, including: At least one processor; And A memory, the memory stores a computer program that can be run on the processor, and is characterized in that when the processor executes the program, it executes the steps of the method according to any one of claims 1-7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it performs the steps of the method according to any one of claims 1-7.