Privileged program updating method and device, electronic equipment and readable storage medium

CN117111977BActive Publication Date: 2026-09-18INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310920144.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-25
Publication Date
2026-09-18
Estimated Expiration
2043-07-25

AI Technical Summary

Technical Problem

[0003]上述方案需要在系统重启后才能让新特权代码生效,导致更新特权代码的方式局限性较大,更新特权代码的效率较低

Benefits of technology

[0038] Fourthly, embodiments of this application also disclose a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the method described in the first aspect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117111977B_ABST
    Figure CN117111977B_ABST
Patent Text Reader

Abstract

The application provides a privileged program updating method and device, electronic equipment and readable storage medium. An upgrade parameter is acquired, the upgrade parameter including an interrupt number of a to-be-updated privileged program and address length information of a new privileged program; an operation is triggered in response to execution of a privilege upgrade program, the new privileged program is acquired through the privilege upgrade program; the new privileged program meeting the address length information is written into a physical memory address indicated by the interrupt number based on the interrupt number; and the new privileged program is written into a Flash memory of a basic input / output system. The physical memory address of the to-be-updated privileged program and the length information of the new privileged program are determined based on the acquired upgrade parameter, and the acquired new privileged program is written into the physical memory address where the to-be-updated privileged program is located based on the upgrade parameter. Since the new privileged program is located in the memory, the new privileged program takes effect immediately after the privilege upgrade program is exited, and online updating of the to-be-updated privileged program is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a privileged program update method, apparatus, electronic device, and readable storage medium. Background Technology

[0002] In computer systems, the processor has a high-privilege interrupt mechanism. The BIOS (Basic Input Output System) and the operating system (OS) enter privileged interrupt handlers by triggering high-privilege interrupts. For example, if the firmware image of the BIOS is being refreshed under the operating system, in order to ensure the security of the firmware image, the operating system cannot directly access the BIOS Flash memory. In this case, a high-privilege interrupt needs to be triggered under the operating system, and the firmware image is updated through the privileged code of the high-privilege interrupt.

[0003] The above solution requires a system restart for the new privilege codes to take effect, which limits the way privilege codes can be updated and makes the update process inefficient. Summary of the Invention

[0004] In view of the above problems, embodiments of the present invention are proposed to provide a privileged program update method, apparatus, electronic device, and readable storage medium that overcomes or at least partially solves the above problems.

[0005] In a first aspect, embodiments of this application disclose a privileged procedure update method, the method comprising:

[0006] Obtain upgrade parameters, which include the interrupt number of the privileged program to be updated and the address length information of the new privileged program;

[0007] In response to the execution trigger operation of the privilege escalation procedure, a new privilege procedure is obtained through the privilege escalation procedure;

[0008] Based on the interrupt number, the new privileged program that conforms to the address length information is written to the physical memory address indicated by the interrupt number;

[0009] The new privileged program is written into the Flash memory of the basic input / output system.

[0010] Optionally, before obtaining the upgrade parameters, the method further includes:

[0011] Establish a communication link between the central processing unit and the baseboard management controller;

[0012] Based on the communication connection and the upgrade program of the baseboard management controller, the upgrade parameters are written into the register of the central processing unit.

[0013] Optionally, obtaining the upgrade parameters includes:

[0014] In response to an update request for a privileged procedure to be updated, upgrade parameters are obtained from the registers of the central processing unit through the privilege upgrade procedure.

[0015] Optionally, before obtaining the upgrade parameters, the process includes:

[0016] Write the upgrade parameters into the header of the new privileged program;

[0017] The process of obtaining the interrupt number of the privileged program to be updated and the address length information of the new privileged program includes:

[0018] In response to an update request for a privileged program to be updated, the privilege upgrade procedure detects the file header of the new privileged program and obtains the upgrade parameters from the file header.

[0019] Optionally, the step of obtaining a new privileged procedure through the privilege escalation procedure in response to the execution trigger operation of the privilege escalation procedure includes:

[0020] In response to the execution trigger operation of the privilege upgrade procedure, the new privilege procedure is mapped to the communication connection link;

[0021] The new privileged procedure is obtained by accessing the communication connection link through the privilege escalation procedure.

[0022] Optionally, the step of writing the new privileged program conforming to the address length information to the physical memory address indicated by the interrupt number includes:

[0023] Based on the preset correspondence between the interrupt number and the address of the privileged program to be upgraded, the physical memory address indicated by the interrupt number is determined;

[0024] The new privileged program, conforming to the address length information, overwrites the privileged program to be upgraded at the physical memory address.

[0025] Optionally, the step of overwriting the privileged program to be upgraded at the physical memory address using the new privileged program that conforms to the address length information includes:

[0026] Determine the starting address of the physical memory address based on the physical memory address indicated by the interrupt number;

[0027] If the new privileged program's file header does not include upgrade parameters, the new privileged program is written to the starting address.

[0028] If the header of the new privileged program includes upgrade parameters, detect the address length occupied by the upgrade parameters in the header;

[0029] When writing the new privileged program to the physical memory address, skip the address length portion of the upgrade parameters in the file header of the new privileged program, and write the content other than the address length occupied by the upgrade parameters to the physical memory address.

[0030] After writing the new privileged program into the Flash memory of the basic input / output system, the method further includes:

[0031] In response to a device restart operation, the new privileged program stored in the Flash memory of the basic input / output system is written to a preset physical memory address.

[0032] Secondly, embodiments of this application disclose a privileged procedure update apparatus, the apparatus comprising:

[0033] The first acquisition module is used to acquire upgrade parameters, which include the interrupt number of the privileged program to be updated and the address length information of the new privileged program.

[0034] The second acquisition module is used to acquire a new privilege program in response to the execution trigger operation of the privilege upgrade program;

[0035] The first update module is used to write the new privileged program that conforms to the address length information into the physical memory address indicated by the interrupt number, based on the interrupt number.

[0036] The second update module is used to write the new privileged program into the Flash memory of the basic input / output system.

[0037] Thirdly, embodiments of this application also disclose an electronic device, including a processor and a memory, wherein the memory stores a program or instructions that can run on the processor, and the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.

[0038] Fourthly, embodiments of this application also disclose a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the method described in the first aspect.

[0039] In this embodiment, upgrade parameters are obtained, including the interrupt number of the privileged program to be updated and the address length information of the new privileged program; in response to the execution trigger operation of the privilege upgrade program, a new privileged program is obtained through the privilege upgrade program; based on the interrupt number, the new privileged program that conforms to the address length information is written to the physical memory address indicated by the interrupt number; and the new privileged program is written to the Flash memory of the basic input / output system. This application's solution determines the physical memory address of the privileged program to be upgraded and the length information of the new privileged program by obtaining upgrade parameters. Furthermore, the obtained new privileged program is written online to the physical memory address of the privileged program to be updated based on the upgrade parameters, updating the privileged program in the physical memory address to the new privileged program. Since the new privileged program is located in memory, it will take effect immediately after exiting the privilege upgrade process, achieving online updating of the privileged program to be updated. This ensures that when the program in the physical memory address is triggered subsequently, the new privileged program will be executed without a system restart, improving the updating efficiency of the privileged program to be updated. Furthermore, the new privileged program is also written to the Flash memory of the basic input / output system, so that after a system restart, the new privileged program in the Flash memory of the basic input / output system can be rewritten into memory for execution. Attached Figure Description

[0040] Figure 1 This is a privileged program update method provided in an embodiment of the present invention;

[0041] Figure 2 This is a schematic diagram illustrating the implementation of an update within a computing system according to an embodiment of the present invention;

[0042] Figure 3 This is yet another privileged procedure update method provided by an embodiment of the present invention;

[0043] Figure 4 This is a block diagram of a privileged procedure update device provided in an embodiment of the present invention;

[0044] Figure 5 This is an electronic device provided in an embodiment of the present invention;

[0045] Figure 6 This is yet another electronic device provided in the embodiments of the present invention. Detailed Implementation

[0046] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this invention will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.

[0047] The following is an explanation of the relevant concepts and background of this application.

[0048] BIOS is an abbreviation for "Basic Input Output System." On IBM PC-compatible systems, it's an industry-standard firmware interface. It's a set of programs embedded in a ROM chip on the computer's motherboard. It stores the computer's most important basic input / output programs, power-on self-test (POST) programs, and system boot programs. It can read and write specific system settings from the CMOS. Its main function is to provide the lowest-level, most direct hardware settings and control for the computer. In addition, the BIOS provides some system parameters to the operating system. Changes to system hardware are hidden by the BIOS; programs use BIOS functions rather than directly controlling the hardware. Modern operating systems often bypass the abstraction layer provided by the BIOS and directly control hardware components.

[0049] The CPU (Central Processing Unit) is the core of a computer system for computation and control, and is the final execution unit for information processing and program execution.

[0050] BMC stands for Baseboard Management Controller. It is a dedicated controller used to monitor and manage servers. Its four main functions are as follows: Device information management: Recording server information (model, manufacturer, date, production and technical information of each component, chassis information, motherboard information, etc.) and BMC information (server hostname, IP, BMC firmware version, etc.).

[0051] Server status monitoring and management: Monitors the health status of various server components (CPU, memory, hard drive, fans, chassis, etc.), including temperature and voltage. Adjusts fan speeds in real-time based on temperature data to prevent overheating and control overall power consumption. Reports any abnormalities to upper-level network administrators via industry-standard protocols such as SNMP, SMTP, and Redfish. Remote server control and management: Manages server power on / off, restart, maintenance, firmware updates, and system installation. Maintenance management: Includes log management, user management, BIOS management, and alarm management.

[0052] In related technologies, the processor in a computer system refreshes the BIOS firmware image through a high-privilege interrupt mechanism, and updates the BIOS Flash memory through privileged code of the high-privilege interrupt mechanism. However, the privileged code itself may have problems. Once the privileged code that processes high-privilege functions malfunctions, the system may experience serious problems such as crashes. Based on this, this invention proposes a method for updating privileged code online without shutting down the system.

[0053] refer to Figure 1 It illustrates a flowchart of a privileged procedure update method provided in an embodiment of this application, the method comprising:

[0054] Step 101: Obtain upgrade parameters, which include the interrupt number of the privileged program to be updated and the address length information of the new privileged program.

[0055] In this embodiment of the invention, the method can be applied to a computer system. The upgrade parameters include the interrupt number of the privileged program to be updated and the address length information of the new privileged program. The address length information represents the code length of the new privileged program. The upgrade parameters can be used to instruct the privilege upgrade program to update the privileged program to be updated. The privileged program to be updated represents the privileged program that needs to be upgraded, and the privilege upgrade program represents the program that implements the update to the privileged program to be updated.

[0056] Step 102: In response to the execution trigger operation of the privilege upgrade procedure, a new privilege procedure is obtained through the privilege upgrade procedure.

[0057] In this embodiment of the invention, in response to the execution trigger operation of the privilege upgrade program, the privilege upgrade program can obtain a new privileged program. The new privileged program is used to update the privileged program to be updated, overwriting the privileged program to be updated, so that the physical memory address of the privileged program to be updated is updated to the new privileged program.

[0058] Furthermore, the privilege upgrade program can be obtained from the BMC. Users can initiate an upgrade for the privilege program to be updated through the communication interface provided by the BMC. Users can upload the "new privilege program" to the BMC memory for storage, so that the privilege upgrade program can obtain the new privilege program through the BMC.

[0059] Step 103: Based on the interrupt number, write the new privileged program that conforms to the address length information into the physical memory address indicated by the interrupt number.

[0060] In this embodiment of the invention, the interrupt number corresponds one-to-one with the privileged program to be updated. Therefore, the physical memory address of the privileged program to be updated can be determined based on the interrupt number. Based on the new privileged program address length information, the privilege upgrade program can obtain a new privileged program that matches the address length information of the new privileged program from the BMC, and write the new privileged program with the address length to the physical memory address indicated by the interrupt number, thereby realizing the online update of the privileged program in the physical memory address. After the update, the new privileged program can be executed.

[0061] Step 104: Write the new privileged program into the Flash memory of the basic input / output system.

[0062] In this embodiment of the invention, since the new privileged program stored in the physical memory address will disappear after the system is shut down and restarted, the invention also writes the new privileged program into the Flash memory of the basic input / output system, so that after the system restarts, the new privileged program in the Flash memory of the basic input / output system can be written back into the preset physical memory address, and the new privileged program can be retrieved from the physical memory address for execution the next time it is executed.

[0063] refer to Figure 2 , Figure 2This diagram illustrates an update implementation within a computing system. This method can be applied to a computer system that includes modules such as a processor, BMC, physical memory, and BIOS Flash. The processor includes an interrupt controller and CPU registers. The CPU registers store upgrade parameters, the BMC stores the BMC upgrade program and the new privileged program, and the physical memory address stores the privileged program to be updated and the privilege upgrade program. The BMC upgrade program is connected to the CPU via a physical channel. It writes the upgrade parameters to the CPU registers through the controller accessing the CPU registers. The privilege upgrade program retrieves the interrupt number and code length information from the agreed-upon CPU registers. It then obtains the new privileged program from the BMC via a agreed-upon physical channel (USB, PCIe, etc.). The privilege upgrade program moves the new privileged program from the BMC to the physical memory address of the privileged program to be updated, according to its code length. Finally, the privilege upgrade program writes the new privileged program to the corresponding location in the BIOS Flash, thus achieving an online update of the privileged program to be updated.

[0064] In this embodiment, upgrade parameters are obtained, including the interrupt number of the privileged program to be updated and the address length information of the new privileged program; in response to the execution trigger operation of the privilege upgrade program, a new privileged program is obtained through the privilege upgrade program; based on the interrupt number, the new privileged program that conforms to the address length information is written to the physical memory address indicated by the interrupt number; and the new privileged program is written to the Flash memory of the basic input / output system. This application's solution determines the physical memory address of the privileged program to be upgraded and the length information of the new privileged program by obtaining upgrade parameters. Furthermore, the obtained new privileged program is written online to the physical memory address of the privileged program to be updated based on the upgrade parameters, updating the privileged program in the physical memory address to the new privileged program. Since the new privileged program is located in memory, it will take effect immediately after exiting the privilege upgrade process, achieving online updating of the privileged program to be updated. This ensures that when the program in the physical memory address is triggered subsequently, the new privileged program will be executed without a system restart, improving the updating efficiency of the privileged program to be updated. Furthermore, the new privileged program is also written to the Flash memory of the basic input / output system, so that after a system restart, the new privileged program in the Flash memory of the basic input / output system can be rewritten into memory for execution.

[0065] refer to Figure 3 It illustrates a flowchart of another privileged procedure update method provided in this application embodiment, the method comprising:

[0066] Step 201: Obtain upgrade parameters, which include the interrupt number of the privileged program to be updated and the address length information of the new privileged program.

[0067] This step can be referred to in step 101, and will not be repeated here.

[0068] Optionally, prior to step 201, the method further includes;

[0069] Step S1: Establish a communication link between the central processing unit and the baseboard management controller;

[0070] Step S2: Based on the communication connection and the upgrade program of the baseboard management controller, the upgrade parameters are written into the register of the central processing unit.

[0071] In this embodiment of the invention, for steps S1 and S2, the BMC initiates an upgrade process by starting an upgrade program. The upgrade parameters can be transmitted as follows: the BMC upgrade program (used to interact with the privileged upgrade program and provide a new privileged program to it) connects to the CPU via a "physical channel." A controller accessing CPU registers writes the upgrade parameters into the CPU registers. These parameters include the interrupt number corresponding to the privileged program to be updated and the code length of the new privileged program. This interrupt number corresponds one-to-one with the "privileged program to be updated," used to locate the program during the upgrade. The "physical channel" can be specifically designed according to different CPU types, such as Intel's PECI (Platform Environment Control Interface) or the general standard PCIe (Peripheral Component Interconnect Express), etc. This embodiment of the invention does not limit the specific design of the "physical channel."

[0072] Optionally, step 201 specifically includes:

[0073] Sub-step 2011: In response to an update request for the privileged program to be updated, upgrade parameters are obtained from the registers of the central processing unit through the privilege upgrade program.

[0074] In this embodiment of the invention, the privilege upgrade program obtains upgrade parameters by accessing registers in the CPU. The upgrade parameters include the interrupt number corresponding to the privileged program to be updated and the code length information of the new privileged program.

[0075] Optionally, before obtaining the upgrade parameters, the method further includes:

[0076] Step S3: Write the upgrade parameters into the header of the new privileged program.

[0077] In this embodiment of the invention, the BMC initiates an upgrade procedure to initiate an update process. The upgrade parameters can also be passed in the following way: the BMC does not pass parameters; the new privileged program contains the upgrade parameters, which include the interrupt number corresponding to the privileged program to be updated and the code length information of the new privileged program. The interrupt number triggered by the BMC interrupt handling corresponds one-to-one with the "privilege upgrade procedure." After receiving the interrupt, the interrupt controller will enter a high-level interrupt handling mode to execute the "privilege upgrade procedure."

[0078] Specifically, a recognizable file header can be set for the new privileged program, for example, by using a fixed hash field as an identifier, and the file header contains the interrupt number corresponding to the privileged program to be updated and the address length information of the new privileged program.

[0079] Optionally, step 201 specifically includes:

[0080] Sub-step 2012: In response to an update request for a privileged program to be updated, the upgrade parameters are obtained from the file header of the new privileged program by detecting the file header of the new privileged program through the privilege upgrade program.

[0081] In this embodiment of the invention, the "privilege upgrade procedure" first checks the file header of the new privileged program. Upon identification, it extracts the interrupt number of the privileged program to be updated and the address length information of the new three-dimensional privileged program from the file header, which are then used for subsequent update operations on the privileged program to be updated. This application provides multiple forms of upgrade parameter transmission methods, enabling online upgrades of the privileged program to be updated and improving the upgrade efficiency.

[0082] Step 202: In response to the execution trigger operation of the privilege upgrade procedure, a new privilege procedure is obtained through the privilege upgrade procedure.

[0083] In this embodiment of the invention, the BMC upgrade procedure can trigger an interrupt PIN (an interrupt PIN is a GPIO agreed upon between the BMC and the CPU, which triggers an interrupt handler through signal changes) to allow the processor to execute a "privilege upgrade procedure".

[0084] Specifically, the privilege escalation program is used to upgrade other privileged programs. It is written into the Flash memory when the computer leaves the factory. After the BIOS boots up, it moves the privilege escalation program to a fixed location in the fixed privileged mode address space of memory. This privilege escalation program is configured with a fixed interrupt number. During the BIOS boot process, the association between this specific interrupt number and the privilege escalation program is written into the interrupt controller. That is, when the interrupt controller recognizes the privileged interrupt number, it temporarily triggers the processor to execute the privilege escalation program. The interrupt triggered by the upgrade program triggered by the BMC matches this interrupt number.

[0085] Optionally, step 202 specifically includes:

[0086] Sub-step 2021: In response to the execution trigger operation of the privilege upgrade procedure, the new privilege procedure is mapped to the communication connection link;

[0087] Sub-step 2022: Obtain the new privileged procedure by accessing the communication connection link through the privilege upgrade procedure.

[0088] In this embodiment of the invention, for steps 2021 and 2022, upgrade parameters are transmitted via CPU registers: the "privilege upgrade program" obtains the interrupt number corresponding to the privileged program to be updated and the address length information of the new privileged program from the agreed CPU registers. The interrupt number corresponds one-to-one with the location of the privileged program to be updated in Flash and the location of the privileged program to be updated in physical memory. The "privilege upgrade program" obtains the "new privileged program" from the BMC side through an agreed communication connection link (physical channel such as USB, PCIe, etc.). The BMC-side upgrade program starts a service to listen for download requests for new privileged programs sent by the processor to the physical channel. The "privilege upgrade program," acting as a client, sends the agreed download request for the new privileged program to the BMC server. The BMC responds to the client's request and maps the "new privileged program" to the communication connection link. The client accesses and obtains the "new privileged program" through the communication connection link.

[0089] Step 203: Based on the preset correspondence between the interrupt number and the address of the privileged program to be upgraded, determine the physical memory address indicated by the interrupt number;

[0090] Step 204: The new privileged program that conforms to the address length information overwrites the privileged program to be upgraded at the physical memory address.

[0091] In this embodiment of the invention, for steps 203 and 204, since the interrupt number corresponds one-to-one with the privileged program to be updated, the physical memory address of the privileged program to be updated can be determined based on the interrupt number. Based on the new privileged program address length information, the privilege upgrade program can obtain a new privileged program that matches the address length information of the new privileged program from the BMC, and write the new privileged program that matches the address length to the physical memory address indicated by the interrupt number, thereby realizing the online update of the privileged program in the physical memory address. After the update, the new privileged program can be executed.

[0092] This application's solution determines the physical memory address of the privileged program to be upgraded and the length information of the new privileged program by obtaining upgrade parameters. The obtained new privileged program is then written online to the physical memory address where the privileged program to be updated is located, based on the upgrade parameters. The privileged program to be updated in the physical memory address is then updated to the new privileged program. Since the new privileged program is located in memory, it will take effect immediately after exiting the privilege upgrade program, realizing online updating of the privileged program to be updated. This ensures that when the program in the physical memory address is triggered subsequently, the new privileged program will be executed without a system restart, improving the updating efficiency of the privileged program to be updated. Furthermore, the new privileged program is also written to the Flash memory of the basic input / output system, so that after a system restart, the new privileged program in the Flash memory of the basic input / output system can be rewritten into memory for execution.

[0093] Optionally, step 204 specifically includes:

[0094] Sub-step 2041: Determine the starting address of the physical memory address based on the physical memory address indicated by the interrupt number;

[0095] Sub-step 2042: If the header of the new privileged program does not include upgrade parameters, write the new privileged program according to the starting address.

[0096] In this embodiment of the invention, for sub-steps 2041 and 2042, the starting address of the physical memory address can be determined according to the physical memory address indicated by the interrupt number; when writing the privileged program, the new privileged program can be written starting from the starting address according to the starting address.

[0097] Furthermore, if the header of the new privileged program does not include upgrade parameters, the new privileged program can be directly written into the physical memory address of the privileged program to be updated.

[0098] Sub-step 2043: If the header of the new privileged program includes upgrade parameters, detect the address length occupied by the upgrade parameters in the header;

[0099] Sub-step 2044: When writing the new privileged program to the physical memory address, skip the address length portion occupied by the upgrade parameters in the file header of the new privileged program, and write the content other than the address length occupied by the upgrade parameters to the physical memory address.

[0100] In this embodiment of the invention, for sub-steps 2043 and 2044, the "privilege upgrade program" maps the interrupt number of the privileged program to be updated to the location of the privileged program to be updated in the physical memory address, skipping the file header and moving the code portion of the "new privileged program" to the physical memory address of the "privileged program to be updated," thus completing the update operation of the privileged program to be updated. After the upgrade is completed, the physical memory will be replaced with the "new privileged program." Since this new privileged code is stored in memory, it will take effect immediately after exiting the interrupt handler (i.e., the privilege upgrade program). Subsequently, when the interrupt corresponding to the "new privileged program" is triggered under the operating system, the processor will be triggered to execute the "new privileged program," realizing online updating of the privileged program to be updated and improving the flexibility of privileged program updates.

[0101] Step 205: Write the new privileged program into the Flash memory of the basic input / output system.

[0102] This step can be referred to in step 104, and will not be repeated here.

[0103] Optionally, after step 205, the method further includes:

[0104] Step 206: In response to the device restart operation, the new privileged program stored in the Flash memory of the basic input / output system is written into a preset physical memory address.

[0105] In this embodiment of the invention, the "privilege upgrade procedure" moves the "new privileged program" to the corresponding location in the BIOS Flash (by finding the agreed-upon interrupt handler location in the Flash using the interrupt number). The BIOS Flash is then updated with the latest code, achieving non-volatile preservation of the interrupt handling code (i.e., it is not lost when power is off). This ensures that during subsequent system startup, the BIOS will write the "new privileged program" from the Flash back to the physical memory address during the boot process.

[0106] This application discloses the architecture of the whole system upgrade logic, including the BMC upgrade program, upgrade memory privilege code, and upgrade privilege code in the BIOS Flash. The BMC transmits upgrade parameters through a physical channel that interacts with the CPU, or transmits parameters through a recognizable file header contained in the program to be upgraded. By upgrading the privilege level interrupt handler through the privilege upgrade program, online updates of other privileged programs are achieved.

[0107] In this embodiment, upgrade parameters are obtained, including the interrupt number of the privileged program to be updated and the address length information of the new privileged program; in response to the execution trigger operation of the privilege upgrade program, a new privileged program is obtained through the privilege upgrade program; based on the interrupt number, the new privileged program that conforms to the address length information is written to the physical memory address indicated by the interrupt number; and the new privileged program is written to the Flash memory of the basic input / output system. This application's solution determines the physical memory address of the privileged program to be upgraded and the length information of the new privileged program by obtaining upgrade parameters. Furthermore, the obtained new privileged program is written online to the physical memory address of the privileged program to be updated based on the upgrade parameters, updating the privileged program in the physical memory address to the new privileged program. Since the new privileged program is located in memory, it will take effect immediately after exiting the privilege upgrade process, achieving online updating of the privileged program to be updated. This ensures that when the program in the physical memory address is triggered subsequently, the new privileged program will be executed without a system restart, improving the updating efficiency of the privileged program to be updated. Furthermore, the new privileged program is also written to the Flash memory of the basic input / output system, so that after a system restart, the new privileged program in the Flash memory of the basic input / output system can be rewritten into memory for execution.

[0108] refer to Figure 4 The diagram illustrates a block diagram of a privileged procedure update apparatus provided in an embodiment of this application, wherein the apparatus 30 includes:

[0109] The first acquisition module 301 is used to acquire upgrade parameters, which include the interrupt number of the privileged program to be updated and the address length information of the new privileged program.

[0110] The second acquisition module 302 is used to acquire a new privilege program in response to the execution trigger operation of the privilege upgrade program;

[0111] The first update module 303 is used to write the new privileged program that conforms to the address length information into the physical memory address indicated by the interrupt number, based on the interrupt number.

[0112] The second update module 304 is used to write the new privileged program into the Flash memory of the basic input / output system.

[0113] Optionally, the device further includes:

[0114] The communication establishment module is used to establish a communication connection link between the central processing unit and the baseboard management controller;

[0115] The first writing module is used to write the upgrade parameters into the register of the central processing unit based on the communication connection and the upgrade program of the baseboard management controller.

[0116] Optionally, the first acquisition module includes:

[0117] The first acquisition submodule is used to acquire upgrade parameters from the registers of the central processing unit in response to an update request from the privilege upgrade program.

[0118] Optionally, the device further includes:

[0119] The second writing module is used to write the upgrade parameters into the file header of the new privileged program;

[0120] The first acquisition module includes:

[0121] The second acquisition submodule is used to, in response to an update request for a privileged program to be updated, obtain the upgrade parameters from the file header of the new privileged program by detecting the file header of the new privileged program through the privilege upgrade program.

[0122] Optionally, the second acquisition module includes:

[0123] The mapping submodule is used to map the new privileged program onto the communication connection link in response to the execution trigger operation of the privilege upgrade program;

[0124] The third acquisition submodule is used to acquire the new privileged program by accessing the communication connection link through the privilege upgrade program.

[0125] Optionally, the first update module includes:

[0126] The determination submodule is used to determine the physical memory address indicated by the interrupt number based on a preset correspondence between the interrupt number and the address of the privileged program to be upgraded;

[0127] The overwrite submodule is used to overwrite the privileged program to be upgraded at the physical memory address using the new privileged program that conforms to the address length information.

[0128] Optionally, the coverage submodule includes:

[0129] The first submodule is used to determine the starting address of the physical memory address based on the physical memory address indicated by the interrupt number;

[0130] The second submodule is used to write the new privileged program according to the starting address if the file header of the new privileged program does not include upgrade parameters.

[0131] The third submodule is used to detect the address length occupied by the upgrade parameters in the file header when the file header of the new privileged program includes upgrade parameters;

[0132] The fourth submodule is used to skip the address length portion of the upgrade parameters in the file header of the new privileged program when writing the new privileged program to the physical memory address, and write the content other than the address length occupied by the upgrade parameters to the physical memory address.

[0133] The device further includes:

[0134] The restart module is used to write the new privileged program stored in the Flash memory of the basic input / output system into a preset physical memory address in response to the device restart operation.

[0135] In this embodiment, upgrade parameters are obtained, including the interrupt number of the privileged program to be updated and the address length information of the new privileged program; in response to the execution trigger operation of the privilege upgrade program, a new privileged program is obtained through the privilege upgrade program; based on the interrupt number, the new privileged program that conforms to the address length information is written to the physical memory address indicated by the interrupt number; and the new privileged program is written to the Flash memory of the basic input / output system. This application's solution determines the physical memory address of the privileged program to be upgraded and the length information of the new privileged program by obtaining upgrade parameters. Furthermore, the obtained new privileged program is written online to the physical memory address of the privileged program to be updated based on the upgrade parameters, updating the privileged program in the physical memory address to the new privileged program. Since the new privileged program is located in memory, it will take effect immediately after exiting the privilege upgrade process, achieving online updating of the privileged program to be updated. This ensures that when the program in the physical memory address is triggered subsequently, the new privileged program will be executed without a system restart, improving the updating efficiency of the privileged program to be updated. Furthermore, the new privileged program is also written to the Flash memory of the basic input / output system, so that after a system restart, the new privileged program in the Flash memory of the basic input / output system can be rewritten into memory for execution.

[0136] Figure 5 This is a block diagram illustrating an electronic device 600 according to an exemplary embodiment. For example, the electronic device 600 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0137] Reference Figure 5The electronic device 600 may include one or more of the following components: a processing component 602, a memory 604, a power supply component 606, a multimedia component 608, an audio component 610, an input / output (I / O) interface 612, a sensor component 614, and a communication component 616.

[0138] Processing component 602 typically controls the overall operation of electronic device 600, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 602 may include one or more processors 620 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 602 may include one or more modules to facilitate interaction between processing component 602 and other components. For example, processing component 602 may include a multimedia module to facilitate interaction between multimedia component 608 and processing component 602.

[0139] Memory 604 is used to store various types of data to support the operation of electronic device 600. Examples of such data include instructions for any application or method operating on electronic device 600, contact data, phonebook data, messages, pictures, multimedia, etc. Memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0140] Power supply component 606 provides power to various components of electronic device 600. Power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 600.

[0141] Multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 608 includes a front-facing camera and / or a rear-facing camera. When the electronic device 600 is in an operating mode, such as a shooting mode or a multimedia mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0142] Audio component 610 is used to output and / or input audio signals. For example, audio component 610 includes a microphone (MIC) used to receive external audio signals when electronic device 600 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 604 or transmitted via communication component 616. In some embodiments, audio component 610 also includes a speaker for outputting audio signals.

[0143] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0144] Sensor assembly 614 includes one or more sensors for providing state assessments of various aspects of electronic device 600. For example, sensor assembly 614 can detect the on / off state of electronic device 600, the relative positioning of components such as the display and keypad of electronic device 600, changes in position of electronic device 600 or a component of electronic device 600, the presence or absence of user contact with electronic device 600, orientation or acceleration / deceleration of electronic device 600, and temperature changes of electronic device 600. Sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 614 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.

[0145] Communication component 616 facilitates wired or wireless communication between electronic device 600 and other devices. Electronic device 600 can access wireless networks based on communication standards, such as WiFi, carrier networks (such as 2G, 3G, 4G, or 5G), or combinations thereof. In one exemplary embodiment, communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 616 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0146] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to implement a privileged program update method provided in the embodiments of this application.

[0147] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, which can be executed by a processor 620 of an electronic device 600 to perform the above-described method. For example, the non-transitory storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0148] Figure 6 This is a block diagram illustrating an electronic device 700 according to an exemplary embodiment. For example, the electronic device 700 may be provided as a server. (Refer to...) Figure 6 The electronic device 700 includes a processing component 722, which further includes one or more processors, and memory resources represented by memory 732 for storing instructions, such as application programs, that can be executed by the processing component 722. The application programs stored in memory 732 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 722 is configured to execute instructions to perform a privileged program update method provided in embodiments of this application.

[0149] Electronic device 700 may also include a power supply component 726 configured to perform power management of electronic device 700, a wired or wireless network interface 750 configured to connect electronic device 700 to a network, and an input / output (I / O) interface 758. Electronic device 700 may operate on an operating system stored in memory 732, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or similar.

[0150] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the privileged program update method.

[0151] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0152] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A privileged procedure update method, characterized in that, The method includes: Obtain upgrade parameters, which include the interrupt number of the privileged program to be updated and the address length information of the new privileged program; In response to the execution trigger operation of the privilege escalation procedure, a new privilege procedure is obtained through the privilege escalation procedure; Based on the interrupt number, the new privileged program that conforms to the address length information is written to the physical memory address indicated by the interrupt number; Write the new privileged program into the Flash memory of the basic input / output system; Before obtaining the upgrade parameters, the method further includes: Establish a communication link between the central processing unit and the baseboard management controller; Based on the communication connection and the upgrade program of the baseboard management controller, the upgrade parameters are written into the register of the central processing unit; The operation triggered by the execution of the privilege escalation procedure, which involves obtaining a new privilege procedure through the privilege escalation procedure, includes: In response to the execution trigger operation of the privilege upgrade procedure, the new privilege procedure is mapped to the communication connection link; The new privileged procedure is obtained by accessing the communication connection link through the privilege escalation procedure.

2. The method according to claim 1, characterized in that, The process of obtaining upgrade parameters includes: In response to an update request for a privileged procedure to be updated, upgrade parameters are obtained from the registers of the central processing unit through the privilege upgrade procedure.

3. The method according to claim 1, characterized in that, Before obtaining the upgrade parameters, the method further includes: Write the upgrade parameters into the header of the new privileged program; The process of obtaining upgrade parameters includes: In response to an update request for a privileged program to be updated, the privilege upgrade procedure detects the file header of the new privileged program and obtains the upgrade parameters from the file header.

4. The method according to claim 1, characterized in that, The step of writing the new privileged program, which conforms to the address length information, to the physical memory address indicated by the interrupt number, based on the interrupt number, includes: Based on the preset correspondence between the interrupt number and the address of the privileged program to be upgraded, the physical memory address indicated by the interrupt number is determined; The new privileged program, conforming to the address length information, overwrites the privileged program to be upgraded at the physical memory address.

5. The method according to claim 4, characterized in that, The step of overwriting the privileged program to be upgraded at the physical memory address using the new privileged program that conforms to the address length information includes: Determine the starting address of the physical memory address based on the physical memory address indicated by the interrupt number; If the new privileged program's file header does not include upgrade parameters, the new privileged program is written to the starting address. If the header of the new privileged program includes upgrade parameters, detect the address length occupied by the upgrade parameters in the header; When writing the new privileged program to the physical memory address, skip the address length portion of the upgrade parameters in the file header of the new privileged program, and write the content other than the address length occupied by the upgrade parameters to the physical memory address. After writing the new privileged program into the Flash memory of the basic input / output system, the method further includes: In response to a device restart operation, the new privileged program stored in the Flash memory of the basic input / output system is written to a preset physical memory address.

6. A privileged procedure update device, characterized in that, The device includes: The first acquisition module is used to acquire upgrade parameters, which include the interrupt number of the privileged program to be updated and the address length information of the new privileged program. The second acquisition module is used to acquire a new privilege program in response to the execution trigger operation of the privilege upgrade program; The first update module is used to write the new privileged program that conforms to the address length information into the physical memory address indicated by the interrupt number, based on the interrupt number. The second update module is used to write the new privileged program into the Flash memory of the basic input / output system; The device further includes: The communication establishment module is used to establish a communication connection link between the central processing unit and the baseboard management controller; The first writing module is used to write the upgrade parameters into the register of the central processing unit based on the communication connection and the upgrade program of the baseboard management controller; The second acquisition module includes: The mapping submodule is used to map the new privileged program onto the communication connection link in response to the execution trigger operation of the privilege upgrade program; The third acquisition submodule is used to acquire the new privileged program by accessing the communication connection link through the privilege upgrade program.

7. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can be executed on the processor, the program or instructions, when executed by the processor, implement the steps of the method as described in any one of claims 1 to 5.

8. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Simulator hot upgrade method and related device

    CN116302006A

  • Delivering interrupts to user-level applications

    US20160179721A1