Firmware upgrading method and device, server and storage medium
By constructing and analyzing the upgrade form, the upgrade preparation of the BIOS firmware is triggered, and the problem of poor compatibility and high maintenance costs in the existing technology to solve the problem of poor compatibility and high maintenance costs in the existing technology, and realize the efficient firmware upgrade process.
Patent Information
- Application Number
- CN202411151151.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2025-01-28
AI Technical Summary
When using the flash tool, the existing BIOS firmware upgrade method has poor adaptability and high maintenance costs, which affects the firmware upgrade efficiency.
By constructing the initial upgrade form, register the interface parameters of the firmware to be upgraded, resolve the firmware upgrade table, trigger the upgrade preparation action, and obtain the latest version information to achieve the firmware upgrade.
It reduces the maintenance cost of developers, improves the efficiency of firmware upgrades, blocks the needs of the operating system for upgrade details, and is compatible with the existing upgrade method.
Smart Images

Figure CN119376770A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a firmware upgrade method, device, server and storage medium. Background Art
[0002] When upgrading the Basic Input Output System (BIOS) firmware, flash tools such as Amibios upgrade tool and Aflash upgrade tool are usually used to realize the interaction between the operating system and BIOS, complete the reading and writing of the BIOS's own flash area, and thus realize the BIOS firmware upgrade. This upgrade method requires BIOS to adapt and cross-compile the corresponding flash tools based on the release versions of each operating system when developing the upgrade tool, resulting in poor adaptation and compatibility of the flash tool. Since the update of the flash tool needs to be maintained for multiple branches, the maintenance cost of the developer is high. In addition, the use of the flash tool by technical service personnel is prone to errors, which affects the efficiency of the firmware upgrade. Summary of the invention
[0003] The present invention provides a firmware upgrade method, device, server and storage medium, which are used to solve the defects of poor adaptation compatibility, high maintenance cost and influence on firmware upgrade efficiency in the method of realizing BIOS firmware upgrade by means of flash tool.
[0004] The present invention provides a firmware upgrade method, comprising: Constructing an initial upgrade table, wherein the initial upgrade table includes configuration interface fields, length and description information; Register the initial upgrade table during the startup phase of the firmware to be upgraded, fill the initial upgrade table with the interface parameters of the firmware to be upgraded according to the configuration interface field, length and description information, and obtain a firmware upgrade table; The firmware upgrade table is parsed, an upgrade preparation action of the firmware to be upgraded is triggered, the firmware to be upgraded is notified to trigger the upgrade, and the latest version information of the firmware to be upgraded is obtained from the corresponding interface in the firmware upgrade table.
[0005] According to the firmware upgrade method provided by the present invention, the configuration interface field includes a standard configuration interface field, and the standard configuration interface field includes table header information, total length information, firmware version information and field data checksum; The table header information is used by the operating system to identify the upgrade table; The total length information is used to represent the space occupied by the table; The firmware version information is used to identify whether the firmware version is forward compatible and whether it supports new functions; The field data checksum is used to detect whether the data in the upgrade table is normal.
[0006] According to the firmware upgrade method provided by the present invention, the configuration interface field includes a firmware configuration interface field to be upgraded, the firmware to be upgraded is a basic input and output system, and the basic input and output system configuration interface field includes: A configuration interface quantity field and a firmware upgrade interface definition field, wherein the firmware upgrade interface definition field is of variable length, and the length of the firmware upgrade interface definition field is adjusted according to the field value of the configuration interface quantity field; The firmware upgrade interface definition field includes a firmware upgrade interface action field, an execution operation indication field, a buffer field for exchange parameters, and an operating system incoming data parameter field; The firmware upgrade interface action field is used to define the basic input and output system upgrade preparation action; The execution operation indication field includes the flow direction of the operating system data access and the read / write memory status after the basic input / output system upgrade preparation action is completed, and distinguishes the operating system reading data from the read register or writing data to the memory address in the write register according to the operation code, and the written data is defined by the operating system incoming data parameter field; The buffer field of the exchange parameters includes memory address parameters, data input / output address parameters, address bit number, address high-order part and address low-order part. The data information stored in the memory address parameters, data input / output address parameters, address bit number, address high-order part and address low-order part is obtained from the basic input / output system according to the description information of the firmware upgrade interface action field.
[0007] According to the firmware upgrade method provided by the present invention, the basic input and output system upgrade preparation action includes: Obtaining a basic input / output system upgrade-allowed state action, wherein the state value of the basic input / output system upgrade-allowed state action is read and obtained from the first specified memory address of the buffer field of the exchange parameter; Obtaining a firmware memory mapping start address action, wherein a status value of the firmware memory mapping start address action is read from a second specified memory address of a buffer field of the exchange parameter; Obtaining a basic input / output system firmware upgrade status action, wherein the status value of the basic input / output system firmware upgrade status action is read from the third designated memory address of the buffer field of the exchange parameter; A firmware version upgrade action is triggered, wherein the state value of the firmware version upgrade action is used to notify the firmware to be upgraded to trigger the upgrade.
[0008] According to the firmware upgrade method provided by the present invention, the triggering of the firmware upgrade preparation action to be upgraded includes: querying the firmware upgrade table, executing the action of obtaining the basic input and output system upgrade permission status through the read register, and reading from the first designated memory address whether the basic input and output system is in the upgrade permission status; If the upgrade is allowed, the firmware memory mapping start address action is executed by reading the register, and the start address of the memory mapping of the basic input and output system is obtained from the second designated memory address; Mapping the basic input and output system firmware file content to the starting address of the memory mapping; Query the firmware upgrade table, execute the triggering firmware version upgrade action through the write register, switch the current control mode to the system management mode, so that the basic input and output system completes the firmware upgrade operation in the system management mode; The firmware upgrade table is queried, the action of obtaining the firmware upgrade status of the basic input / output system is performed through the read register, and the upgrade status of the basic input / output system is read from the third designated memory address.
[0009] According to the firmware upgrade method provided by the present invention, the switching of the current control mode to the system management mode includes: By writing the input and output values to the input and output register addresses, the current control mode is switched to the system management mode; By writing the input and output values to the memory-mapped register address, the current control mode is switched to the system management mode; By changing the input and output pin level values, the current control mode is switched to the system management mode.
[0010] According to the firmware upgrade method provided by the present invention, the memory space of the first designated memory address, the second designated memory address and the third designated memory address is reserved at the startup time of the basic input and output system, and the starting address of the reserved memory space is added to the initial upgrade table during the startup phase of the firmware to be upgraded.
[0011] According to the firmware upgrade method provided by the present invention, the written data is data encrypted by a security key provided by a trusted platform.
[0012] The firmware upgrade method provided by the present invention also includes: When there is no update requirement for the firmware to be upgraded, the corresponding upgrade interface in the firmware upgrade table is closed.
[0013] The present invention also provides a firmware upgrade device, comprising: A construction module, used to construct an initial upgrade table, wherein the initial upgrade table includes configuration interface fields, length and description information; A filling module, used to register the initial upgrade table during the startup phase of the firmware to be upgraded, fill the initial upgrade table with the interface parameters of the firmware to be upgraded according to the configuration interface field, length and description information, and obtain a firmware upgrade table; The trigger module is used to parse the firmware upgrade table, trigger the upgrade preparation action of the firmware to be upgraded, notify the firmware to be upgraded to trigger the upgrade, and obtain the latest version information of the firmware to be upgraded from the corresponding interface in the firmware upgrade table.
[0014] The present invention also provides a server, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the firmware upgrade method as described in any one of the above items when executing the program.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program implements any of the above-mentioned firmware upgrade methods when executed by a processor.
[0016] The firmware upgrade method, device, server and storage medium provided by the present invention construct an initial upgrade table, wherein the initial upgrade table includes configuration interface fields, lengths and description information; register the initial upgrade table in the startup phase of the firmware to be upgraded, fill the initial upgrade table with the self-interface parameters of the firmware to be upgraded according to the configuration interface fields, lengths and description information, and obtain the firmware upgrade table; parse the firmware upgrade table, trigger the upgrade preparation action of the firmware to be upgraded, notify the firmware to be upgraded to trigger the upgrade, and obtain the latest version information of the firmware to be upgraded from the corresponding interface in the firmware upgrade table, register and bind the upgrade interface of the firmware itself in the startup phase through the advanced configuration and power management interface, the upgrade content is completely defined by the firmware itself, and the interface is passed to the operating system in the form of a standardized table, the operating system uses a unified method, the developer does not need to additionally develop and maintain the corresponding flash tool, when the product firmware is updated and iterated, the upgrade details are shielded from the operating system, the existing upgrade method can be compatible, and the firmware upgrade efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 is a flowchart of a firmware upgrade method provided by an embodiment of the present invention; Figure 2 is a functional structure diagram of a firmware upgrade device provided by an embodiment of the present invention; Figure 3 It is a functional structure diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0019] Figure 1 A flowchart of a firmware upgrade method provided by an embodiment of the present invention, such as Figure 1 As shown, the firmware upgrade method includes: Step 101: construct an initial upgrade table, wherein the initial upgrade table includes configuration interface fields, length and description information; Step 102: register the initial upgrade table during the startup phase of the firmware to be upgraded, fill the initial upgrade table with the interface parameters of the firmware to be upgraded according to the configuration interface field, length and description information, and obtain a firmware upgrade table; Step 103: parse the firmware upgrade table, trigger the upgrade preparation action of the firmware to be upgraded, notify the firmware to be upgraded to trigger the upgrade, and obtain the latest version information of the firmware to be upgraded from the corresponding interface in the firmware upgrade table.
[0020] In an embodiment of the present invention, based on the Advanced Configuration and Power Interface (ACPI), the relevant interface of BIOS flash upgrade is defined, and the upgrade table is filled at the time of BIOS startup, and then the upgrade table is placed in the corresponding memory area according to the Unified Extensible Firmware Interface (UEFI), and parsed by the operating system startup phase. The operating system does not need to know any details of the BIOS upgrade, and only needs to read and write the memory space or IO space according to the operations specified in the upgrade table. When upgrading the BIOS, it only needs to be triggered through the index node provided by the ACPI driver. As for how the BIOS is completely upgraded in the end, it is completely defined by the BIOS firmware code itself, and no additional flash tool intervention and operating system interference are required in the middle.
[0021] The traditional basic input and output system upgrade method requires BIOS to adapt and cross-compile the corresponding flash tool based on the release version of each operating system when developing the upgrade tool. This upgrade method will result in poor adaptation and compatibility of the flash tool. Since the update of the flash tool needs to be maintained for multiple branches, the maintenance cost of the developer is high. In addition, technical service personnel are prone to errors in using the flash tool, which affects the efficiency of firmware upgrades.
[0022] The firmware upgrade method provided by the embodiment of the present invention constructs an initial upgrade table, wherein the initial upgrade table includes configuration interface fields, lengths and description information; registers the initial upgrade table in the startup phase of the firmware to be upgraded, fills the initial upgrade table with the interface parameters of the firmware to be upgraded according to the configuration interface fields, lengths and description information, and obtains the firmware upgrade table; parses the firmware upgrade table, triggers the upgrade preparation action of the firmware to be upgraded, notifies the firmware to be upgraded to trigger the upgrade, and obtains the latest version information of the firmware to be upgraded from the corresponding interface in the firmware upgrade table, registers and binds the upgrade interface of its own firmware in the startup phase through the advanced configuration and power management interface, the upgrade content is completely defined by the firmware itself, and the interface is passed to the operating system in the form of a standardized table, the operating system uses a unified method, the developer does not need to additionally develop and maintain the corresponding flash tool, and when the product firmware is updated and iterated, the upgrade details are shielded from the operating system, which is compatible with the existing upgrade method and improves the firmware upgrade efficiency.
[0023] Based on any of the above embodiments, the configuration interface field includes a standard configuration interface field, and the standard configuration interface field includes table header information, total length information, firmware version information and field data checksum; The table header information is used by the operating system to identify the upgrade table; The total length information is used to represent the space occupied by the table; The firmware version information is used to identify whether the firmware version is forward compatible and whether it supports new functions; The field data checksum is used to detect whether the data in the upgrade table is normal.
[0024] In the embodiment of the present invention, the standard configuration interface fields are shown in Table 1.
[0025] Table 1 Standard configuration interface fields
[0026] The Header Signature field is fixed to 'FLASH', which should be unique in all ACPI tables. The Revision field identifies the current structure version definition. When the BIOS is subsequently updated, if the interface needs to be updated, only the Instruction entries field needs to be modified. The ACPI Standard Header and BIOS Flash Header structures remain unchanged.
[0027] Based on any of the above embodiments, the configuration interface field includes a firmware configuration interface field to be upgraded, the firmware to be upgraded is a basic input and output system, and the basic input and output system configuration interface field includes: A configuration interface quantity field and a firmware upgrade interface definition field, wherein the firmware upgrade interface definition field is of variable length, and the length of the firmware upgrade interface definition field is adjusted according to the field value of the configuration interface quantity field; The firmware upgrade interface definition field includes a firmware upgrade interface action field, an execution operation indication field, a buffer field for exchange parameters, and an operating system incoming data parameter field; In the embodiment of the present invention, the firmware configuration interface fields to be upgraded are shown in Table 2.
[0028] Table 2 Fields of the firmware configuration interface to be upgraded
[0029] The firmware upgrade interface action field is used to define the basic input and output system upgrade preparation action; The execution operation indication field includes the flow direction of the operating system data access and the read / write memory status after the basic input / output system upgrade preparation action is completed, and distinguishes the operating system reading data from the read register or writing data to the memory address in the write register according to the operation code, and the written data is defined by the operating system incoming data parameter field; In the embodiment of the present invention, the execution operation indication field is shown in Table 3.
[0030] Table 3 Execution Operation Instruction Field
[0031] In the embodiment of the present invention, the written data is data encrypted by a security key provided by a trusted platform. Considering the parameter security when the operating system and BIOS are input / output, the security key provided by the platform, such as the security key provided by the Trusted Platform Module (TPM) chip, is used to encrypt the data before transmission, further ensuring the security and reliability of the upgrade.
[0032] The buffer field of the exchange parameters includes memory address parameters, data input / output address parameters, address bit number, address high-order part and address low-order part. The data information stored in the memory address parameters, data input / output address parameters, address bit number, address high-order part and address low-order part is obtained from the basic input / output system according to the description information of the firmware upgrade interface action field.
[0033] In the embodiment of the present invention, the firmware upgrade interface action field is shown in Table 4.
[0034] Table 4 Firmware upgrade interface action fields
[0035] In the embodiment of the present invention, the basic input and output system upgrade preparation action includes: Obtaining a basic input / output system upgrade-allowed state action, wherein the state value of the basic input / output system upgrade-allowed state action is read and obtained from the first specified memory address of the buffer field of the exchange parameter; Obtaining a firmware memory mapping start address action, wherein a status value of the firmware memory mapping start address action is read from a second specified memory address of a buffer field of the exchange parameter; Obtaining a basic input / output system firmware upgrade status action, wherein the status value of the basic input / output system firmware upgrade status action is read from the third designated memory address of the buffer field of the exchange parameter; A firmware version upgrade action is triggered, wherein the state value of the firmware version upgrade action is used to notify the firmware to be upgraded to trigger the upgrade.
[0036] In the embodiment of the present invention, the basic input and output system upgrade preparation actions are shown in Table 5.
[0037] Table 5 Basic input and output system upgrade preparation actions
[0038] In the embodiment of the present invention, since the BIOS flash chip allows whole-chip write protection or area write protection, the GET_BIOS_FLASH_PERMISSION interface is used to obtain the current BIOS flash erasable status. When the BIOS flash chip is write-protected or in other situations, BIOS upgrade is not allowed.
[0039] In an embodiment of the present invention, the memory space of the first designated memory address, the second designated memory address and the third designated memory address is reserved at the startup time of the basic input and output system, and the starting address of the reserved memory space is added to the initial upgrade table during the startup phase of the firmware to be upgraded.
[0040] In the embodiment of the present invention, the analysis of the ACPI table filled by the BIOS has been completed during the kernel startup phase. When upgrading within the OS, it is only necessary to trigger the actions in the table in sequence. The specific implementation process is as follows: The triggering of the firmware upgrade preparation action to be upgraded includes: querying the firmware upgrade table, executing the action of obtaining the basic input and output system upgrade permission status through the read register, and reading from the first designated memory address whether the basic input and output system is in the upgrade permission status; In the embodiment of the present invention, the OS queries the ACPI upgrade table and executes the GET_BIOS_FLASH_PERMISSION action, which is completed by READ_REGISTER, that is, reading from the memory address 0 specified in the table whether the BIOS flash chip is in a write-protected state that does not allow upgrades; If the upgrade is allowed, the firmware memory mapping start address action is executed by reading the register, and the start address of the memory mapping of the basic input and output system is obtained from the second designated memory address; In the embodiment of the present invention, if it is found that the BIOS currently allows upgrading, the OS executes the GET_BIOS_FW_MAPPING action, which is completed by READ_REGISTER, that is, obtaining the starting address of the BIOS firmware memory mapping from the memory address 1 specified in the table, and the memory space is reserved by the BIOS when it is started; Mapping the basic input and output system firmware file content to the starting address of the memory mapping; Query the firmware upgrade table, execute the triggering firmware version upgrade action through the write register, switch the current control mode to the system management mode, so that the basic input and output system completes the firmware upgrade operation in the system management mode; In the embodiment of the present invention, the OS queries the firmware upgrade table and executes TRIGGER_BIOS_UPGRADE, which is completed by WRITE_REGSTER_WITH_VALUE, that is, triggering the platform to switch the CPU to SMM mode; In the embodiment of the present invention, the BIOS checks whether the upgrade environment is safe, and the write protection status of the flash chip, and then reads the mapped firmware content to be upgraded, and checks and verifies the security and integrity of the BIOS firmware. After all checks are passed, the BIOS flash chip erase and write operation begins. After the BIOS upgrade is completed, the upgrade result is filled into the memory address 2 according to the actual upgrade situation; The firmware upgrade table is queried, the action of obtaining the firmware upgrade status of the basic input / output system is performed through the read register, and the upgrade status of the basic input / output system is read from the third designated memory address.
[0041] In the embodiment of the present invention, the operating system queries the firmware upgrade table and executes GET_BIOS_FLASH_STATUS, which is completed by READ_REGISTER, that is, reading the upgrade status of the BIOS from memory address 2.
[0042] Based on any of the above embodiments, switching the current control mode to the system management mode includes: By writing the input and output values to the input and output register addresses, the current control mode is switched to the system management mode; By writing the input and output values to the memory-mapped register address, the current control mode is switched to the system management mode; By changing the input and output pin level values, the current control mode is switched to the system management mode.
[0043] In the embodiment of the present invention, when the BIOS firmware is upgraded, the CPU needs to switch to the system management mode. Taking writing the IO Port register as an example, the switch is realized by writing the IO value to the IO address. Each platform has a different switching method. For example, other platforms may write the register of the MMIO address, or may provide GPIO pins. The BIOS can update the corresponding table definition accordingly.
[0044] In an embodiment of the present invention, the initial upgrade table is filled with the interface parameters of the firmware to be upgraded according to the configuration interface field, length and description information, and obtaining the firmware upgrade table means filling the Instructionsentries field in Table 2, as follows: {
[0045] {GET_BIOS_FLASH_PERMISSION, READ_REGISTER, MEM address 0, 0},
[0046] {GET_BIOS_FW_MAPPING, READ_REGISTER, MEM address 1, 0},
[0047] {GET_BIOS_FLASH_STATUS, READ_REGISTER, MEM address 2, 0},
[0048] {TRIGGER_BIOS_UPGRADE, WRITE_REGSTER_WITH_VALUE, IO address, IO value},
[0049] }; Among them, the MEM address is the memory space reserved by the BIOS when it is started, and then the starting addresses of each space are filled in one by one. The other fields in the table are fixed, and the length, checksum and other fields are filled in after calculation based on the actual situation.
[0050] Based on any of the above embodiments, the firmware upgrade method further includes: When there is no update requirement for the firmware to be upgraded, the corresponding upgrade interface in the firmware upgrade table is closed.
[0051] In the embodiment of the present invention, the ACPI table structure for BIOS flash chip upgrade is defined, the ACPI table is filled in the BIOS startup phase and placed in the ACPI memory space, the operating system parses the ACPI table for BIOS upgrade, and triggers the interface actions such as GET_BIOS_FLASH_PERMISSION, GET_BIOS_FW_MAPPING and TRIGGER_BIOS_UPGRADE in sequence according to user needs to trigger the upgrade of BIOS firmware; the BIOS checks the current system operating environment, flash chip status, etc. one by one, and then verifies the firmware security and integrity. After all checks are passed, the flash chip is refreshed automatically, and the status is updated to the specified memory address after the refresh is completed; the operating system triggers the GET_BIOS_FLASH_STATUS action to obtain the status of the BIOS firmware update; the BIOS Setup provides a configuration option, which can close the corresponding ACPI upgrade interface when the BIOS firmware update is not required to protect the BIOS firmware from malicious damage.
[0052] In the embodiment of the present invention, there is no need to use a flash tool, which can prevent the BIOS flash chip from being exposed to the outside, thereby improving the security of the BIOS firmware. In addition, the platform can turn off the ACPI upgrade switch out of band or in other ways. When the OS calls the GET_BIOS_FLASH_PERMISSION interface to query the BIOS upgrade permission, if the ACPI upgrade switch is turned off, the interface directly returns "not allowed", thereby avoiding further actions of the operating system and further reducing the risk of the BIOS flash chip being maliciously damaged.
[0053] The firmware upgrade method provided by the embodiment of the present invention can achieve compatibility and adaptation between multiple operating system distribution platforms or multiple distribution versions in the scenario of upgrading the BIOS firmware version in the operating system, without the need to develop, cross-compile and maintain multiple branches of BIOS flash upgrade tools, thereby reducing the development and maintenance work time of developers and reducing the operational complexity of technical service personnel. At the same time, the operating system can use the existing ACPI driver framework to complete the BIOS upgrade, without the need for too much additional development, and the specific upgrade details of the BIOS are completely shielded from the operating system. When the BIOS firmware is updated and iterated, the operating system does not need to be updated synchronously, further reducing the workload of operating system development and adaptation and reducing coupling.
[0054] The firmware upgrade device provided by the present invention is described below. The firmware upgrade device described below and the firmware upgrade method described above can be referenced to each other.
[0055] Figure 2 A functional structural diagram of a firmware upgrade device provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, the firmware upgrade device includes: A construction module 201 is used to construct an initial upgrade table, wherein the initial upgrade table includes configuration interface fields, length and description information; Filling module 202, used to register the initial upgrade table in the startup phase of the firmware to be upgraded, fill the initial upgrade table with the interface parameters of the firmware to be upgraded according to the configuration interface field, length and description information, and obtain a firmware upgrade table; The trigger module 203 is used to parse the firmware upgrade table, trigger the upgrade preparation action of the firmware to be upgraded, notify the firmware to be upgraded to trigger the upgrade, and obtain the latest version information of the firmware to be upgraded from the corresponding interface in the firmware upgrade table.
[0056] The firmware upgrade device provided by the present invention constructs an initial upgrade table, wherein the initial upgrade table includes configuration interface fields, lengths and description information; registers the initial upgrade table in the startup phase of the firmware to be upgraded, fills the initial upgrade table with the self-interface parameters of the firmware to be upgraded according to the configuration interface fields, lengths and description information, and obtains the firmware upgrade table; parses the firmware upgrade table, triggers the upgrade preparation action of the firmware to be upgraded, notifies the firmware to be upgraded to trigger the upgrade, and obtains the latest version information of the firmware to be upgraded from the corresponding interface in the firmware upgrade table, registers and binds the upgrade interface of the own firmware in the startup phase through the advanced configuration and power management interface, the upgrade content is completely defined by the firmware itself, and the interface is passed to the operating system in the form of a standardized table, the operating system uses a unified method, the developer does not need to additionally develop and maintain the corresponding flash tool, and when the product firmware is updated and iterated, the upgrade details are shielded from the operating system, the existing upgrade method can be compatible, and the firmware upgrade efficiency is improved.
[0057] Figure 3 An example of a server physical structure diagram is shown below: Figure 3 As shown, the server may include: a processor 310, a communication interface 320, a firmware upgrade device (memory) 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the firmware upgrade device 330 complete mutual communication through the communication bus 340. The firmware upgrade device 330 includes a computer program, an operating system and acquired data, and the processor 310 can call the logic instructions in the firmware upgrade device 330 to execute the firmware upgrade method, which includes: constructing an initial upgrade table, the initial upgrade table includes configuration interface fields, lengths and description information; registering the initial upgrade table in the startup phase of the firmware to be upgraded, filling the initial upgrade table with the interface parameters of the firmware to be upgraded according to the configuration interface fields, lengths and description information, and obtaining the firmware upgrade table; parsing the firmware upgrade table, triggering the upgrade preparation action of the firmware to be upgraded, notifying the firmware to be upgraded to trigger the upgrade, and obtaining the latest version information of the firmware to be upgraded from the corresponding interface in the firmware upgrade table.
[0058] In addition, the logic instructions in the above-mentioned firmware upgrade device 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the relevant technology or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only firmware upgrade device (ROM, Read-Only Memory), random access firmware upgrade device (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0059] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the firmware upgrade method provided by the above-mentioned methods, the method comprising: constructing an initial upgrade table, the initial upgrade table including configuration interface fields, lengths and description information; registering the initial upgrade table during the startup phase of the firmware to be upgraded, filling the initial upgrade table with the interface parameters of the firmware to be upgraded according to the configuration interface fields, lengths and description information, to obtain a firmware upgrade table; parsing the firmware upgrade table, triggering the upgrade preparation action of the firmware to be upgraded, notifying the firmware to be upgraded to trigger the upgrade, and obtaining the latest version information of the firmware to be upgraded from the corresponding interface in the firmware upgrade table.
[0060] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0061] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.
[0062] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A firmware upgrade method, characterized in that: include: Constructing an initial upgrade table, wherein the initial upgrade table includes configuration interface fields, length and description information; Register the initial upgrade table during the startup phase of the firmware to be upgraded, fill the initial upgrade table with the interface parameters of the firmware to be upgraded according to the configuration interface field, length and description information, and obtain a firmware upgrade table; The firmware upgrade table is parsed, an upgrade preparation action of the firmware to be upgraded is triggered, the firmware to be upgraded is notified to trigger the upgrade, and the latest version information of the firmware to be upgraded is obtained from the corresponding interface in the firmware upgrade table.
2. The firmware upgrade method according to claim 1, characterized in that: The configuration interface field includes a standard configuration interface field, and the standard configuration interface field includes table header information, total length information, firmware version information and field data checksum; The table header information is used by the operating system to identify the upgrade table; The total length information is used to represent the space occupied by the table; The firmware version information is used to identify whether the firmware version is forward compatible and whether it supports new functions; The field data checksum is used to detect whether the data in the upgrade table is normal.
3. The firmware upgrade method according to claim 1, characterized in that: The configuration interface field includes a firmware configuration interface field to be upgraded, the firmware to be upgraded is a basic input and output system, and the basic input and output system configuration interface field includes: A configuration interface quantity field and a firmware upgrade interface definition field, wherein the firmware upgrade interface definition field is of variable length, and the length of the firmware upgrade interface definition field is adjusted according to the field value of the configuration interface quantity field; The firmware upgrade interface definition field includes a firmware upgrade interface action field, an execution operation indication field, a buffer field for exchange parameters, and an operating system incoming data parameter field; The firmware upgrade interface action field is used to define the basic input and output system upgrade preparation action; The execution operation indication field includes the flow direction of the operating system data access and the read and write memory status, and distinguishes the operating system reading data from the read register or writing data to the memory address in the write register according to the operation code, and the written data is defined by the operating system input data parameter field; The buffer field of the exchange parameters includes memory address parameters, data input / output address parameters, address bit numbers, address high-order parts and address low-order parts. The data information stored in the memory address parameters, data input / output address parameters, address bit numbers, address high-order parts and address low-order parts is obtained from the basic input / output system based on the description information of the firmware upgrade interface action field.
4. The firmware upgrade method according to claim 3, characterized in that: The basic input and output system upgrade preparation action includes: Obtaining a basic input / output system upgrade-allowed state action, wherein the state value of the basic input / output system upgrade-allowed state action is read and obtained from the first designated memory address of the buffer field of the exchange parameter; Obtaining a firmware memory mapping start address action, wherein a status value of the firmware memory mapping start address action is read from a second specified memory address of a buffer field of the exchange parameter; Obtaining a basic input / output system firmware upgrade status action, wherein the status value of the basic input / output system firmware upgrade status action is read from the third designated memory address of the buffer field of the exchange parameter; A firmware version upgrade action is triggered, wherein the state value of the firmware version upgrade action is used to notify the firmware to be upgraded to trigger the upgrade.
5. The firmware upgrade method according to claim 4, characterized in that: The triggering of the firmware upgrade preparation action to be upgraded includes: querying the firmware upgrade table, executing the action of obtaining the basic input and output system upgrade permission status through the read register, and reading from the first designated memory address whether the basic input and output system is in the upgrade permission status; If the upgrade is allowed, the firmware memory mapping start address action is executed by reading the register, and the start address of the memory mapping of the basic input and output system is obtained from the second designated memory address; Mapping the basic input and output system firmware file content to the starting address of the memory mapping; Query the firmware upgrade table, execute the triggering firmware version upgrade action through the write register, switch the current control mode to the system management mode, so that the basic input and output system completes the firmware upgrade operation in the system management mode; The firmware upgrade table is queried, the action of obtaining the firmware upgrade status of the basic input / output system is performed through the read register, and the upgrade status of the basic input / output system is read from the third designated memory address.
6. The firmware upgrade method according to claim 5, characterized in that: The switching of the current control mode to the system management mode includes: By writing the input and output values to the input and output register addresses, the current control mode is switched to the system management mode; By writing the input and output values to the memory-mapped register address, the current control mode is switched to the system management mode; By changing the input and output pin level values, the current control mode is switched to the system management mode.
7. The firmware upgrade method according to claim 4 or 5, characterized in that: The memory spaces of the first designated memory address, the second designated memory address and the third designated memory address are reserved at the startup time of the basic input and output system, and the starting addresses of the reserved memory spaces are added to the initial upgrade table during the startup phase of the firmware to be upgraded.
8. The firmware upgrade method according to claim 3, characterized in that: The written data is data encrypted by a security key provided by the trusted platform.
9. The firmware upgrade method according to claim 1, characterized in that: Also includes: When there is no update requirement for the firmware to be upgraded, the corresponding upgrade interface in the firmware upgrade table is closed.
10. A firmware upgrade device, characterized in that: include: A construction module, used to construct an initial upgrade table, wherein the initial upgrade table includes configuration interface fields, length and description information; A filling module, used to register the initial upgrade table during the startup phase of the firmware to be upgraded, fill the initial upgrade table with the interface parameters of the firmware to be upgraded according to the configuration interface field, length and description information, and obtain a firmware upgrade table; The trigger module is used to parse the firmware upgrade table, trigger the upgrade preparation action of the firmware to be upgraded, notify the firmware to be upgraded to trigger the upgrade, and obtain the latest version information of the firmware to be upgraded from the corresponding interface in the firmware upgrade table.
11. A server comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the firmware upgrade method according to any one of claims 1 to 9 is implemented.
12. A non-transitory readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the firmware upgrade method according to any one of claims 1 to 9 is implemented.
Citation Information
Cited By
Upgrade progress display method and electronic equipment
CN121143839A