Register setting method and device, equipment and storage medium

The method and device allow for flexible register settings in servers by modifying firmware permissions and parameter options, addressing the inflexibility of existing systems and enhancing security and customization.

CN119127216APending Publication Date: 2024-12-13INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411319952.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

Existing server systems lack flexibility in setting low-level ARM registers, limiting customization and security enhancements.

Method used

A method and device for modifying the read and write permissions of registers in the security firmware, allowing for customized parameter value options through the basic input/output system, enabling flexible and convenient register setting.

Benefits of technology

Enables flexible and customizable register settings in servers with open security firmware, enhancing security and meeting user-specific requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127216A_ABST
    Figure CN119127216A_ABST
Patent Text Reader

Abstract

The invention provides a register setting method and device, equipment and a storage medium, and relates to the technical field of computers, the register setting method and device are applied to a target server, the target server is a server of an open security firmware source code, and the register setting method comprises the steps that a to-be-set target register is determined, determining an initial source file corresponding to the target register according to a source code directory of initial security firmware corresponding to the target server; modifying a flag bit of the read-write permission in the initial source file to obtain a target source file, and compiling security firmware containing the target source file to obtain target security firmware; starting a basic input / output system of the target server, and acquiring a target parameter value for the target register, so as to set the current working state of the target register by using the target parameter value; the target parameter value represents a parameter value of any one working state in a plurality of working states corresponding to the target register. Therefore, the register can be flexibly and conveniently set, and the customization requirement of a user can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a register setting method, device, equipment and storage medium. Background Art

[0002] ATF (ARM Trust Firmware, a source code of open source security firmware) is responsible for managing the entire system startup process on the ARM (Advanced RISCMachine) server, including loading and initializing the lowest-level boot firmware (BL1, the first stage of system startup) to the operating system (BL33). ATF also supports secure boot, ensuring that the system is verified at each stage of the boot process to prevent malware injection and tampering. Only ATF has the authority to set the registers on the ARM server. Based on this situation, manufacturers cannot do some actions in ATF to flexibly set some low-level ARM registers and can only use their default settings.

[0003] It can be seen that how to freely and flexibly set the registers in the server is a problem that those skilled in the art need to solve. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide a register setting method, device, equipment and storage medium, which can solve the problem of flexibly setting registers in a server.

[0005] In order to solve the above technical problems, in a first aspect, an embodiment of the present invention provides a register setting method, which is applied to a target server, wherein the target server is a server with an open security firmware source code, comprising:

[0006] Determine a target register to be set, and determine an initial source file corresponding to the target register according to a source code directory of the initial security firmware corresponding to the target server;

[0007] Modify the flag bit corresponding to the read and write permissions of the target register in the initial source file to obtain a modified target source file, and compile the security firmware including the target source file to obtain the target security firmware corresponding to the target server;

[0008] The basic input / output system of the target server is started, and a target parameter value for the target register is obtained through the basic input / output system, so as to set the current working state of the target register using the target parameter value; the target parameter value represents a parameter value corresponding to any one of the several working states corresponding to the target register.

[0009] Optionally, determining the target register to be set, and determining the initial source file corresponding to the target register according to the source code directory of the initial security firmware corresponding to the target server, includes:

[0010] The target register to be set is determined according to the register manual corresponding to the target server, and the target directory corresponding to the target register is determined from the source code directory of the initial security firmware corresponding to the target server, so as to retrieve the initial source file corresponding to the target directory from the initial security firmware.

[0011] Optionally, modifying the flag bit corresponding to the read and write permission of the target register in the initial source file to obtain a modified target source file includes:

[0012] The target function for setting the target register in the initial source file is determined according to the register manual corresponding to the target server, and the flag position of the read and write permission of the target register is set to a preset value in the target function to obtain a modified target source file.

[0013] Optionally, compiling the security firmware including the target source file to obtain the target security firmware corresponding to the target server includes:

[0014] Installing dependencies for compiling the security firmware on the target server using a command line tool for managing software packages, and downloading a compilation tool chain for compiling the security firmware using a distributed version control tool;

[0015] Based on the dependency and the compilation tool chain, the first security firmware including the target source file is compiled to obtain the compiled second security firmware, and the first security firmware in the initial security firmware is replaced with the second security firmware to obtain the target security firmware corresponding to the target server.

[0016] Optionally, before starting the basic input / output system of the target server and obtaining the target parameter value for the target register through the basic input / output system, the method further includes:

[0017] Acquire an option configuration instruction for the target register through a preset human-computer interaction interface, and create a name option corresponding to the target register and parameter value options under different working states based on the option configuration instruction;

[0018] A first selection instruction for the parameter value option is obtained through the preset human-computer interaction interface, and the parameter value corresponding to the first selection instruction is set as a default parameter value of the target register, so that when the basic input and output system of the target server is started, the target register is initialized using the default parameter value.

[0019] Optionally, starting a basic input / output system of the target server and obtaining a target parameter value for the target register through the basic input / output system to set a current working state of the target register using the target parameter value includes:

[0020] Starting the basic input and output system of the server, reading the name option and the parameter value option corresponding to each of the target registers in the system initialization phase, and initializing the relevant target registers using the default parameter values ​​in the parameter value options to obtain the current working status of the target registers;

[0021] Reading the current working state of each of the target registers, and displaying each of the name options corresponding to the target register and each of the parameter value options including the current parameter value corresponding to the current working state through a preset human-computer interaction interface, so as to obtain a second selection instruction for a parameter value option of a single target register through the preset human-computer interaction interface;

[0022] A target parameter value matching the second selection instruction is determined from the parameter value options corresponding to the single target register, and the current parameter value corresponding to the current working state of the single register is modified using the target parameter value, so as to set the current working state of the single target register using the target parameter value.

[0023] Optionally, after setting the current working state of the target register by using the target parameter value, the method further includes:

[0024] Reading a current parameter value representing the working state of the target register at the current moment, and determining whether the read current parameter value is the same as the target parameter value;

[0025] If the current parameter value read is the same as the target parameter value, it is determined that the register is set successfully;

[0026] If the current parameter value read is different from the target parameter value, an alarm message for the working state of the target register is triggered so as to re-acquire a selection instruction for the parameter value option of the target register.

[0027] In a second aspect, the present application discloses a register setting device, which is applied to a target server, wherein the target server is a server with open security firmware source code, comprising:

[0028] A source file determination module, used to determine a target register to be set, and determine an initial source file corresponding to the target register according to a source code directory of an initial security firmware corresponding to the target server;

[0029] A firmware compiling module, used to modify the flag bit corresponding to the read and write permissions of the target register in the initial source file to obtain a modified target source file, and compile the security firmware including the target source file to obtain the target security firmware corresponding to the target server;

[0030] A register setting module is used to start the basic input and output system of the target server, and obtain a target parameter value for the target register through the basic input and output system, so as to set the current working state of the target register using the target parameter value; the target parameter value represents a parameter value corresponding to any one of the several working states corresponding to the target register.

[0031] In a third aspect, the present application discloses an electronic device, comprising:

[0032] Memory for storing computer programs;

[0033] A processor is used to execute the computer program to implement the steps of the register setting method as described above.

[0034] In a fourth aspect, the present application discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the register setting method as described above are implemented.

[0035] It can be seen that the target server in the present application is a server with open security firmware source code. In the process of setting the register, the target register to be set is first determined, and the initial source file corresponding to the target register is determined according to the source code directory of the initial security firmware corresponding to the target server; the flag bit corresponding to the read and write permissions of the target register in the initial source file is modified to obtain the modified target source file, and the security firmware containing the target source file is compiled to obtain the target security firmware corresponding to the target server; then the basic input and output system of the target server is started, and the target parameter value for the target register is obtained through the basic input and output system, so as to use the target parameter value to set the current working state of the target register; the target parameter value represents the parameter value corresponding to any one of the several working states corresponding to the target register.

[0036] It can be seen from the above technical solution that in the server with open security firmware source code, the present application updates the security firmware by modifying the read and write permission flag of the register in the security firmware, obtains the customized parameter value option for the register through the basic input and output system, and then modifies the parameter value corresponding to the register to achieve the setting of the register; in this way, the register can be set flexibly and conveniently to meet the customization needs of users. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0038] Figure 1 A flow chart of a register setting method disclosed in this application;

[0039] Figure 2 A specific register file location diagram disclosed in this application;

[0040] Figure 3 A schematic diagram of a specific functional part disclosed in this application;

[0041] Figure 4 A specific firmware compilation flow chart disclosed in this application;

[0042] Figure 5 A flow chart of a specific register setting method disclosed in this application;

[0043] Figure 6 A flowchart of a specific register option reading method disclosed in this application;

[0044] Figure 7 A schematic diagram of the structure of a register setting device disclosed in this application;

[0045] Figure 8 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] The terms "including" and "having" in the specification of the present invention and the above-mentioned drawings, as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.

[0048] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0049] like Figure 1 As shown, an embodiment of the present application provides a register setting method, which is applied to a target server, wherein the target server is a server with an open security firmware source code, including:

[0050] Step S11, determining a target register to be set, and determining an initial source file corresponding to the target register according to a source code directory of the initial security firmware corresponding to the target server.

[0051] In the embodiment of the present application, several target registers to be set in the server must first be determined, and the target registers to be modified can be sorted out based on specific usage requirements; taking the parameter value PF_MODE as an example, it belongs to the register AArch64_imp_cpuectlr2_el1, which occupies 4 bits (11-14), such as Figure 2 As shown, PF_MODE: PrefetcherAggressiveness Modes, mode 0 represents the most aggressive mode, and mode 3 represents the most conservative mode. TXREQ_MIN: Minimum number of TXREQ, the minimum number of outstanding TXREQ transactions in the L2 transaction queue. CBUSY_FILTER_WINDOW: The number of CBusy responses within a sampling window. CBUSY_FILTER_THRESHOLD: The percentage of CBusy responses in the sampling window that are considered to be valid samples of the CBusy value. TXREQ_LIMIT_DEC: Control the speed of dynamic TXREQ limit. TXREQ LIMIT INC: Dynamic TXREQ limit increment. TXREQ_LIMIT_DYNAMIC: Static or dynamic control of TXREQ limit. TXREQ_MAX: The maximum number of outstanding TXREQ transactions in the L2 transaction queue. RES0 refers to the reserved part, and no modification or setting options are performed. Through the above process, the initial source file related to the target register can be determined in the secure firmware of the server to modify the initial source file. It should be noted that the server needs to have open secure firmware source (ATF), such as the Nvidia Grace platform server.

[0052] In a specific embodiment, the determination of the target register to be set, and the determination of the initial source file corresponding to the target register according to the source code directory of the initial security firmware corresponding to the target server, may include: determining the target register to be set according to the register manual corresponding to the target server, and determining the target directory corresponding to the target register from the source code directory of the initial security firmware corresponding to the target server, so as to retrieve the initial source file corresponding to the target directory from the initial security firmware. Specifically, the process of combing the target registers may be carried out in conjunction with the register manual related to the server, and then in conjunction with the usage requirements, several target registers that need to be modified may be screened out; further, the source files related to the target register setting may be determined through the source code directory of the security firmware, firstly determining the target directory corresponding to the target register from the source code target of the initial security firmware, and then retrieving the initial source file corresponding to the target from the initial security firmware, so that these initial source files can be modified later.

[0053] Step S12: modify the flag bit corresponding to the read and write permissions of the target register in the initial source file to obtain a modified target source file, and compile the security firmware including the target source file to obtain the target security firmware corresponding to the target server.

[0054] In an embodiment of the present application, after obtaining the initial source file corresponding to the target register through the above steps, the flag bit corresponding to the read and write permissions of the target register in the initial source file is modified; it can be understood that the present application needs to release the read and write permissions of the register so that reading and writing can be performed during the startup process.

[0055] In a specific embodiment, the modification of the flag bit corresponding to the read and write permission of the target register in the initial source file to obtain the modified target source file may include: determining the target function for setting the target register in the initial source file according to the register manual corresponding to the target server, and setting the flag bit of the read and write permission of the target register to a preset value in the target function to obtain the modified target source file. Specifically, in the process of modifying the source file, the target function for setting the read and write permission of the target register in the initial source file is determined according to the register manual of the server, and the flag bit of the read and write permission is set to a preset value in the target function, such as setting the flag bit to 1, to obtain the modified target source file.

[0056] In another specific embodiment, the compiling of the security firmware including the target source file to obtain the target security firmware corresponding to the target server may include: installing the dependency for compiling the security firmware on the target server through a command line tool for managing software packages, and downloading the compilation tool chain for compiling the security firmware using a distributed version control tool; compiling the first security firmware including the target source file based on the dependency and the compilation tool chain to obtain the compiled second security firmware, and replacing the first security firmware in the initial security firmware with the second security firmware to obtain the target security firmware corresponding to the target server. Specifically, it is understandable that the security firmware source code needs to install the necessary dependency packages before compiling, and install the dependency for compiling the security firmware in the server through a command line tool (apt command, Advanced Packaging Tool); such as device-tree-compiler and libssl-dev. Furthermore, it is also necessary to download the compilation tool chain or source required for compiling the security firmware through a distributed version control tool (git tool); such as specified gcc, prebuilts and additional. Then, the first security firmware including the target source file is compiled to obtain the compiled second security firmware, and the second security firmware is used to replace the first security firmware in the initial security firmware, and finally the target security firmware after the security firmware is replaced is obtained.

[0057] In a specific embodiment, Figure 3 As shown, in the process of compiling ATF firmware, first install the required dependencies, download the gcc (GNU Compiler Collection, multi-language compiler) compilation tool and related sources; then you need to decompress the ATF source code, modify the files in it, set the read and write properties of the registers and write the corresponding default parameter values. Then run the compilation script to compile and generate a new ATF firmware, and replace the original related ATF firmware in the BIOS (Basic InputOutput System).

[0058] Step S13, starting the basic input and output system of the target server, and obtaining a target parameter value for the target register through the basic input and output system, so as to set the current working state of the target register using the target parameter value; the target parameter value represents a parameter value corresponding to any one of the several working states corresponding to the target register.

[0059] Furthermore, after modifying the registers in the server through the above steps, the modified target security firmware can be obtained; further, the target parameter value for the target register can be obtained in the server's basic input and output system (BIOS), specifically, the value set by the user or staff is read in the DXE (Driver Execution Environment, which performs most of the system initialization work) stage; and then the working state of the relevant register is set using the target parameter value. It can be understood that after the read and write permissions are modified, the user or staff can modify the value of the target register by entering the target parameter value and set the register's parameters or mode; the target parameter value is the parameter value corresponding to any one of the several working states supported by the target register.

[0060] In a specific embodiment, Figure 4 As shown, the technical solution of the present application is roughly divided into three functional parts. First, in the data storage layer, it is necessary to release the read and write permissions of the relevant registers in the security firmware source code, allowing UEFI (Unified Extensible Firmware Interface) to read and write during the startup process, and create corresponding register options for the name and function parameter options; then in the data reading and parsing layer, the server reads the register options in the initialization phase of the basic input and output system, parses the options and obtains the selection instructions issued by the relevant personnel, so as to convert the various parameter options of the register according to the selection instructions and obtain the target parameter value that needs to be set; further, in the register processing layer, it is necessary to write the target parameter value into the register, and check whether the parameter value of the register is written successfully.

[0061] It can be seen that in the server with open security firmware source code, the present application first modifies the read and write permission flag of the register in the security firmware, updates the security firmware, and sets option information such as parameter value options for the target register; when starting the basic input and output system of the server, a custom parameter value selection instruction for the register can be obtained, and then the parameter value corresponding to the register can be modified based on the selection instruction to achieve the setting of the register; in this way, the register can be set flexibly and conveniently to meet the user's customization needs.

[0062] like Figure 5 As shown, an embodiment of the present application provides a register setting method, which is applied to a target server, wherein the target server is a server with an open security firmware source code, including:

[0063] Step S21, determining a target register to be set, and determining an initial source file corresponding to the target register according to a source code directory of the initial security firmware corresponding to the target server.

[0064] Step S22, modify the flag bit corresponding to the read and write permissions of the target register in the initial source file to obtain a modified target source file, and compile the security firmware containing the target source file to obtain the target security firmware corresponding to the target server.

[0065] Step S23: obtaining an option configuration instruction for the target register through a preset human-computer interaction interface, and creating a name option corresponding to the target register and parameter value options under different working states based on the option configuration instruction.

[0066] In an embodiment of the present application, the above steps can be used to determine a number of target registers that need to be set, and relevant personnel can create corresponding name options and parameter value options for the target registers through a preset human-computer interaction interface for the working parameters of the registers under different working states; it can be understood that a matching name option can be selected based on the description of the register, so that the user can correspond to a specific register; and the parameter value option is convenient for the user to select during subsequent use.

[0067] Step S24: obtaining a first selection instruction for the parameter value option through the preset human-computer interaction interface, and setting the parameter value corresponding to the first selection instruction as a default parameter value of the target register, so that when the basic input and output system of the target server is started, the target register is initialized using the default parameter value.

[0068] Furthermore, after creating name options corresponding to the target registers and parameter value options under different working states, relevant personnel can also issue default parameters for each target register through a preset human-computer interaction interface, that is, set one of several parameter value options as the default parameter value for the target register through a first selection instruction, so that when starting the basic input and output system of the target server, the default parameter value can be used to initialize the relevant target registers.

[0069] Step S25, starting the basic input and output system of the server, reading the name options and parameter value options corresponding to each of the target registers in the system initialization phase, and initializing the relevant target registers using the default parameter values ​​in the parameter value options to obtain the current working status of the target registers.

[0070] In an embodiment of the present application, after starting the basic input and output system of the target server, during the initialization phase of the system, that is, when the BIOS boots to the DXE phase, the name options and parameter value options corresponding to each target register can be read, and initialized using the pre-set default parameter values ​​of the target registers to obtain the current working status of the target registers.

[0071] Step S26, read the current working status of each of the target registers, and display the name options corresponding to the target register and the parameter value options including the current parameter values ​​corresponding to the current working status through a preset human-computer interaction interface, so as to obtain a second selection instruction for the parameter value option of a single target register through the preset human-computer interaction interface.

[0072] Furthermore, the target server can use this to read the current working status of each target register, and display the name options corresponding to each target register and the parameter value options containing the current parameter values ​​corresponding to the current working status through a preset human-computer interaction interface; relevant personnel can issue modification instructions to certain target registers based on the name options and the corresponding parameter value options, that is, issue a second selection instruction for the parameter value options of a single target register through the preset human-computer interaction interface.

[0073] Step S27, determine the target parameter value that matches the second selection instruction from the parameter value options corresponding to the single target register, and use the target parameter value to modify the current parameter value corresponding to the current working state of the single register, so as to use the target parameter value to set the current working state of the single target register.

[0074] In an embodiment of the present application, a second selection instruction for modifying the target register can be issued through the basic input and output system of the target server, so that the current parameter value corresponding to the current working state of the relevant target register can be modified using the target parameter value matching the second selection instruction from each parameter value option. In this way, the target register can be set using the corresponding target parameter value in combination with specific usage requirements.

[0075] In a specific embodiment, after the current working state of the target register is set by using the target parameter value, it can also include: reading the current parameter value representing the working state of the target register at the current moment, and judging whether the current parameter value read is the same as the target parameter value; if the current parameter value read is the same as the target parameter value, it is determined that the register is set successfully; if the current parameter value read is not the same as the target parameter value, an alarm message for the working state of the target register is triggered, so as to re-acquire the selection instruction for the parameter value option of the target register. Specifically, after setting the parameter value of the target register, the current parameter value representing the working state of the target register can be read again to judge whether the latest parameter value read is the same as the parameter value written to the register, that is, to judge whether the latest parameter value read from the target register is the parameter value modified before, and to judge whether the modification of the parameter value is correct; if the latest parameter value read is different from the target parameter value corresponding to the second selection instruction, it means that the modification fails, and the corresponding alarm message can be triggered; correspondingly, if the latest parameter value read is the same as the target parameter value corresponding to the second selection instruction, it means that the modification is successful. Furthermore, in a specific embodiment, if the latest parameter value read is different from the target parameter value corresponding to the second selection instruction, the server can repeatedly write the parameter value according to a preset number of retries; after each write, determine whether the modification is successful, and if successful, terminate the retry operation; if unsuccessful, trigger a corresponding alarm message after the number of repeated writes reaches the preset number of retries, so that relevant personnel can manually handle the situation.

[0076] In another specific embodiment, Figure 6 As shown, in the DXE stage of BIOS, the option values ​​set by the relevant personnel in the registers are read in turn, and the parameters / modes corresponding to the registers to be set are parsed according to the option values, that is, the pre-set name options and the corresponding parameter value options are displayed; and each register is read in turn to obtain the default parameters / modes currently set for each register. Then, according to the target parameter values ​​sent by the user, the current parameters / modes of each register are modified, specifically, the modified parameters / modes are written back to the corresponding registers; after the target parameter values ​​are written into the corresponding registers, the value of the register is read again and compared with that before writing to confirm whether the written parameter values ​​are correct to ensure successful writing.

[0077] In another specific embodiment, in the process of creating parameter value options corresponding to the target register, the parameter value that meets the usage requirements for the next period of time can be directly set as the default parameter value of the target register; in this way, when the basic input and output system of the server is subsequently started, there is no need to issue the selection instruction again, and the default parameter value of each target register can already support the subsequent usage requirements, which can improve efficiency.

[0078] It can be seen that in the server with open security firmware source code, the present application updates the security firmware by modifying the read and write permission flags of the registers in the security firmware, and obtains the customized parameter value options for the registers through the basic input and output system. Then, in the initialization stage of the basic input and output system, the parameter values ​​corresponding to the registers can be modified by issuing selection instructions for the parameter value options, and the registers can be set so that the set registers meet the actual usage requirements. In this way, the registers can be set flexibly and conveniently to meet the customization needs of users.

[0079] like Figure 7 As shown, an embodiment of the present application provides a register setting device, which is applied to a target server, and the target server is a server with an open security firmware source code, including:

[0080] A source file determination module 11 is used to determine a target register to be set, and determine an initial source file corresponding to the target register according to a source code directory of the initial security firmware corresponding to the target server;

[0081] The firmware compiling module 12 is used to modify the flag bit corresponding to the read and write permissions of the target register in the initial source file to obtain a modified target source file, and compile the security firmware including the target source file to obtain the target security firmware corresponding to the target server;

[0082] The register setting module 13 is used to start the basic input and output system of the target server, and obtain the target parameter value for the target register through the basic input and output system, so as to set the current working state of the target register using the target parameter value; the target parameter value represents the parameter value corresponding to any one of the several working states corresponding to the target register.

[0083] It can be seen that in the server with open security firmware source code, the present application updates the security firmware by modifying the read and write permission flags of the registers in the security firmware, obtains the customized parameter value options for the registers through the basic input and output system, and then modifies the parameter values ​​corresponding to the registers to achieve the setting of the registers; this allows the registers to be set flexibly and conveniently to meet the user's customization needs.

[0084] In a specific embodiment, the source file determination module 11 may include:

[0085] A source file determination unit is used to determine the target register to be set according to the register manual corresponding to the target server, and determine the target directory corresponding to the target register from the source code directory of the initial security firmware corresponding to the target server, so as to retrieve the initial source file corresponding to the target directory from the initial security firmware.

[0086] In a specific embodiment, the firmware compiling module 12 may include:

[0087] The permission modification unit is used to determine the target function for setting the target register in the initial source file according to the register manual corresponding to the target server, and to set the flag position of the read and write permission of the target register to a preset value in the target function to obtain a modified target source file.

[0088] In a specific embodiment, the firmware compiling module 12 may include:

[0089] A firmware compilation preparation unit, used to install dependencies for compiling secure firmware on the target server through a command line tool for managing software packages, and to download a compilation tool chain for compiling secure firmware using a distributed version control tool;

[0090] A firmware compilation unit is used to compile the first security firmware containing the target source file based on the dependency and the compilation tool chain to obtain the compiled second security firmware, and use the second security firmware to replace the first security firmware in the initial security firmware to obtain the target security firmware corresponding to the target server.

[0091] In a specific embodiment, the device may further include:

[0092] An option configuration module, used to obtain an option configuration instruction for the target register through a preset human-computer interaction interface, and create a name option corresponding to the target register and parameter value options under different working states based on the option configuration instruction;

[0093] A default parameter value setting module is used to obtain a first selection instruction for the parameter value option through the preset human-computer interaction interface, and set the parameter value corresponding to the first selection instruction as the default parameter value of the target register, so that when the basic input and output system of the target server is started, the target register is initialized using the default parameter value.

[0094] In a specific embodiment, the register setting module 13 may include:

[0095] an initialization unit, used to start the basic input and output system of the server, read the name option and the parameter value option corresponding to each of the target registers in the system initialization stage, and initialize the relevant target registers using the default parameter values ​​in the parameter value options to obtain the current working state of the target registers;

[0096] an option display unit, configured to read the current working state of each of the target registers, and display each of the name options corresponding to the target register and each of the parameter value options including the current parameter value corresponding to the current working state through a preset human-computer interaction interface, so as to obtain a second selection instruction for a parameter value option of a single target register through the preset human-computer interaction interface;

[0097] A parameter value modification unit is used to determine a target parameter value that matches the second selection instruction from the parameter value options corresponding to the single target register, and use the target parameter value to modify the current parameter value corresponding to the current working state of the single register, so as to use the target parameter value to set the current working state of the single target register.

[0098] In a specific embodiment, the device may further include:

[0099] A parameter value reading module, used to read a current parameter value representing a working state of the target register at a current moment, and determine whether the read current parameter value is the same as the target parameter value;

[0100] A first determination module, configured to determine that the register is set successfully when the current parameter value read is the same as the target parameter value;

[0101] The second determination module is used to trigger the warning information for the working state of the target register when the read current parameter value is different from the target parameter value, so as to re-acquire the selection instruction for the parameter value option of the target register.

[0102] The present application also provides a computer program product, including a computer program / instruction, which implements the steps of the above register setting method when executed by a processor.

[0103] Furthermore, the present application also discloses an electronic device. Figure 8It is a structural diagram of an electronic device according to an exemplary embodiment, and the content in the figure cannot be regarded as any limitation on the scope of use of this application. The electronic device may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input and output interface 25 and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the register setting method disclosed in any of the aforementioned embodiments. In addition, the electronic device in this embodiment may specifically be an electronic computer.

[0104] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0105] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0106] The operating system 221 is used to manage and control various hardware devices on the electronic device and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the register setting method performed by the electronic device disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0107] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the register setting method disclosed above. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the above embodiments, and no further description will be given here.

[0108] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0109] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0110] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0111] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0112] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A register setting method, characterized in that: Applied to a target server, the target server is a server with open security firmware source code, including: Determine a target register to be set, and determine an initial source file corresponding to the target register according to a source code directory of the initial security firmware corresponding to the target server; Modify the flag bit corresponding to the read and write permissions of the target register in the initial source file to obtain a modified target source file, and compile the security firmware including the target source file to obtain the target security firmware corresponding to the target server; The basic input / output system of the target server is started, and a target parameter value for the target register is obtained through the basic input / output system, so as to set the current working state of the target register using the target parameter value; the target parameter value represents a parameter value corresponding to any one of the several working states corresponding to the target register.

2. The register setting method according to claim 1, characterized in that: The determining of the target register to be set, and determining the initial source file corresponding to the target register according to the source code directory of the initial security firmware corresponding to the target server, includes: The target register to be set is determined according to the register manual corresponding to the target server, and the target directory corresponding to the target register is determined from the source code directory of the initial security firmware corresponding to the target server, so as to retrieve the initial source file corresponding to the target directory from the initial security firmware.

3. The register setting method according to claim 1, characterized in that: The step of modifying the flag bit corresponding to the read and write permission of the target register in the initial source file to obtain a modified target source file includes: The target function for setting the target register in the initial source file is determined according to the register manual corresponding to the target server, and the flag position of the read and write permission of the target register is set to a preset value in the target function to obtain a modified target source file.

4. The register setting method according to claim 1, characterized in that: The compiling the security firmware including the target source file to obtain the target security firmware corresponding to the target server includes: Installing dependencies for compiling the secure firmware on the target server using a command line tool for managing software packages, and downloading a compilation tool chain for compiling the secure firmware using a distributed version control tool; Based on the dependency and the compilation tool chain, the first security firmware including the target source file is compiled to obtain the compiled second security firmware, and the first security firmware in the initial security firmware is replaced with the second security firmware to obtain the target security firmware corresponding to the target server.

5. The register setting method according to claim 1, characterized in that: Before starting the basic input and output system of the target server and obtaining the target parameter value for the target register through the basic input and output system, the method further includes: Acquire an option configuration instruction for the target register through a preset human-computer interaction interface, and create a name option corresponding to the target register and parameter value options under different working states based on the option configuration instruction; A first selection instruction for the parameter value option is obtained through the preset human-computer interaction interface, and the parameter value corresponding to the first selection instruction is set as the default parameter value of the target register, so that when the basic input and output system of the target server is started, the target register is initialized using the default parameter value.

6. The register setting method according to claim 5, characterized in that: The starting of the basic input / output system of the target server and obtaining the target parameter value for the target register through the basic input / output system to set the current working state of the target register by using the target parameter value includes: Starting the basic input and output system of the server, reading the name option and the parameter value option corresponding to each of the target registers in the system initialization phase, and initializing the relevant target registers using the default parameter values ​​in the parameter value options to obtain the current working status of the target registers; Reading the current working state of each of the target registers, and displaying each of the name options corresponding to the target register and each of the parameter value options including the current parameter value corresponding to the current working state through a preset human-computer interaction interface, so as to obtain a second selection instruction for a parameter value option of a single target register through the preset human-computer interaction interface; A target parameter value matching the second selection instruction is determined from the parameter value options corresponding to the single target register, and the current parameter value corresponding to the current working state of the single register is modified using the target parameter value, so as to set the current working state of the single target register using the target parameter value.

7. The register setting method according to any one of claims 1 to 6, characterized in that: After the current working state of the target register is set by using the target parameter value, the method further includes: Reading a current parameter value representing the working state of the target register at the current moment, and determining whether the read current parameter value is the same as the target parameter value; If the current parameter value read is the same as the target parameter value, it is determined that the register is set successfully; If the current parameter value read is different from the target parameter value, an alarm message for the working state of the target register is triggered so as to re-acquire a selection instruction for the parameter value option of the target register.

8. A register setting device, characterized in that: Applied to a target server, the target server is a server with open security firmware source code, including: A source file determination module, used to determine a target register to be set, and determine an initial source file corresponding to the target register according to a source code directory of an initial security firmware corresponding to the target server; A firmware compiling module, used to modify the flag bit corresponding to the read and write permissions of the target register in the initial source file to obtain a modified target source file, and compile the security firmware including the target source file to obtain the target security firmware corresponding to the target server; A register setting module is used to start the basic input and output system of the target server, and obtain a target parameter value for the target register through the basic input and output system, so as to set the current working state of the target register using the target parameter value; the target parameter value represents a parameter value corresponding to any one of the several working states corresponding to the target register.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the register setting method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the register setting method according to any one of claims 1 to 7 are implemented.