Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
The embodiment of the present invention provides a memory sharing application method for a motherboard system, as shown in fig. 2, where the method is applied to a controller 10 disposed on a motherboard 1, and a memory 20 and an embedded controller 30 that are in communication connection with the controller 10 are further disposed on the motherboard 1. The controller 10 executes the stored software program to implement the memory sharing application method for the motherboard system, wherein the motherboard 1 may be mounted in a terminal device such as a desktop computer, a notebook computer, a tablet computer, an all-in-one machine, and the like. The controller 10 may be a BIOS (Basic Input Output System ) component, and is independent of a central processing unit (Central Processing Unit, CPU) mounted on the motherboard and implements control over various interface functions of the motherboard, the memory 20 is a RAM (Random Access Memory ) mounted on the motherboard, the embedded controller 30 is an EC component, and the EC component is a 16-bit single-chip microcomputer, and the EC component is always in an operating state no matter in an on or off state.
As shown in FIG. 1, the method includes steps S110 to S160.
S110, executing a pre-stored memory sharing instruction to set the memory as a sharing mode.
The controller may first obtain a pre-stored memory sharing instruction for execution, and configure the control information of the memory by executing the memory sharing instruction. The control information of the memory is the parameter information for controlling the whole memory, the control information of the memory comprises the mode information and the authority parameter information corresponding to each component, and the authority parameter information of the component comprises the specific authority (such as read, modify, write and the like) of the component for accessing the data information in the memory. The mode information of the component comprises a mode option and an option parameter for the memory to share data of the component, the mode information of the component can control the component to access the data information in the memory, the mode option comprises hiding or sharing and the like, the option parameter is specific parameter information for selecting a certain mode option, if the 'hiding' in the mode option of the component is selected, the memory is hidden for the component, the component cannot access the memory and share the memory, and if the 'sharing' in the mode option of the component is selected, the memory is shared for the component, and the component can access the memory and acquire the data information stored in the memory for sharing.
Specifically, the controller executes the memory sharing instruction, reads a default parameter value corresponding to the mapping information in the memory according to the mapping information in the memory sharing instruction, and performs parameter configuration on control information of the memory through the default parameter value to set the memory as a sharing mode. The method comprises the steps of adding a shared mode option in control information of a memory and mode information corresponding to a controller, modifying the shared mode option to be selected, modifying authority parameter information corresponding to the controller to be read, modified and written, namely, setting the shared mode of the memory for the controller, and distributing a storage area special for the controller to the controller in the memory, so that the controller can access the distributed storage area in the memory and acquire data information stored in the storage area for use, and the controller can access and read the data information stored in the storage area and modify and write the data information stored in the storage area.
S120, reading a basic file corresponding to the embedded controller in the memory.
The base file corresponding to the embedded controller in the memory is further read, and the base file is an EC file, wherein the EC file refers to a firmware file of an EC assembly (EC chip) and comprises program codes for controlling the operation of the EC assembly, and the codes realize various functions of the EC assembly, such as power management, keyboard input processing, fan rotation speed control and the like. The EC file is the core of the EC component for realizing the specific functions, and determines which tasks can be executed by the EC component and how to interact with other hardware components, the EC file needs to ensure the integrity and correctness of codes to ensure that the EC component can stably and reliably run, and the EC file has different versions which possibly contain repair, performance optimization or new functions aiming at specific problems.
In a specific embodiment, step S120 includes the substeps of sending a memory information sharing instruction to the embedded controller to control the embedded controller to perform memory sharing setting, and reading a corresponding base file from the memory according to a base address of the embedded controller.
The embedded controller can send the memory information sharing instruction to the embedded controller so as to control the embedded controller to perform memory sharing setting, namely the embedded controller can share the memory and share the base address stored in the memory after finishing setting according to the memory information sharing instruction. After the memory sharing is set, a storage area special for the embedded controller is allocated in the memory for the embedded controller, so that the embedded controller can access the allocated storage area in the memory and acquire the data information stored in the storage area for use, and meanwhile, other components (such as the controller) can acquire the shared base address of the embedded controller in the memory.
After the memory sharing setting is completed, the controller can acquire the base address of the embedded controller, and based on the base address, the base file corresponding to the storage position of the base address is read from the memory.
And S130, integrating the basic file and the configuration file of the embedded controller to obtain a corresponding integrated file.
After the base file is acquired, integrating the base file with a configuration file of the embedded controller, wherein the configuration file is a configuration file of an EC assembly (hereinafter referred to as an EC configuration file), and the EC configuration file is a file for configuring working parameters and options of the EC assembly. The system comprises configuration parameters of a top layer, and the configuration parameters determine the working modes and characteristics of the EC assembly under different scenes on the basis of the EC file. The EC profile allows a user to customize the functions and parameters of the EC assembly according to specific motherboard designs and requirements, e.g., a threshold for fan speed, parameters for battery charging, etc., may be set by the profile. Generally speaking, the EC file is used for setting various functions of the EC assembly, and the EC configuration file is used for selecting among the functions set in the EC file and configuring parameters of the selected functions. The specific configuration information involved in the configuration text for performing the corresponding functional configuration is shown in table 1:
TABLE 1
The SMBIOS, i.e., system management BIOS (SYSTEM MANAGEMENT BIOS), is a standard for transferring management information through system firmware, and is created by DMTF (distributed management task force). The LEDs are the LED lamps used for displaying the working states of the main board and/or the hard disk on the main board. PCIE, peripheral component interconnect express (PERIPHERAL COMPONENT INTERCONNECT EXPRESS) is a high-speed serial computer expansion bus standard applied on a motherboard. USB (Universal Serial Bus ) is a standard interface technology for transferring data and providing power between a computer and an external device.
The user can configure the configuration file according to the own use requirement, and the configuration file generated based on the user's setting is stored in a storage area corresponding to the controller in the memory. And the controller integrates the read basic file with the configuration file of the embedded controller in the memory, so as to obtain a corresponding integrated file.
In a specific embodiment, step S130 includes the substeps of splicing and combining the base file and the configuration file to obtain corresponding combined information, and performing format adjustment on the combined information according to a preset file format to integrate the combined information to obtain the integrated file.
Specifically, the base file and the configuration file are spliced and combined, so that corresponding combination information is obtained. For example, the size of the base file is 96KB, the size of the configuration file is 31KB, the combined information obtained by combining is 127KB, or the size of the base file is 96KB, the size of the configuration file is 3KB, and the combined information obtained by combining is 99KB. The configuration file can be adjusted according to the requirement.
And carrying out format adjustment on the combined information according to a file format preset in the controller, wherein an integrated file corresponding to the combined information is required to be generated according to the file format in the format adjustment process. For example, the check code corresponding to the combination information may be generated according to the check code generation rule in the file format, and the check code is used as the last bit information to be combined with the combination information, so as to obtain the file information of 128 KB. And storing the file information as a corresponding integrated file according to the format symbol set in the file format, wherein if the format symbol is BIN, the file information can be stored as a BIN file to be used as the corresponding integrated file.
The generated check code can be used for checking the integrity of the integrated file, and preventing the information in the integrated file from being tampered. Further, the check code generation rule may be set as a remainder calculation function, the 127KB combined information is converted into a 16-ary character string, and the remainder calculation is performed according to the remainder calculation function, where the remainder obtained may be used as a check code of 1KB length (the insufficient bits are zero-padded to reach 1KB length). Or the check code generation rule can be set as a Hash function, hash transportation is carried out on the 16-system character string according to the Hash function, so that corresponding abstract information is obtained, the abstract information is obtained after Hash operation is carried out on the 16-system character string, and the obtained abstract information is used as a check code with the length of 1KB (the insufficient bit is subjected to zero filling to reach the length of 1 KB). The hash function may be a function based on SHA256 construction, and SHA256 (secure hash algorithm 256) generates a 32 byte length data, i.e., the extract information, for any length (calculated as bits) of information.
In a specific embodiment, before the base file and the configuration file are spliced and combined to obtain corresponding combined information, the method further comprises the steps of checking configuration parameters of the configuration file according to the base file to obtain a checking result of whether the checking result is passed or not, and executing the step of splicing and combining the base file and the configuration file if the checking result is passed.
The method comprises the steps of carrying out configuration parameter verification on a configuration file according to a base file before splicing and combining the base file and the configuration file, obtaining each parameter information configured in the configuration file if the base file is provided with selectable items of each function and parameter ranges of each function, judging whether each parameter information is matched with the selectable item of the corresponding function in the base file, and judging whether each parameter information is located in the parameter range of the corresponding function, so that configuration parameter verification is realized. If any parameter information is not matched with the selectable item of the corresponding function or any parameter information is not located in the parameter range of the corresponding function, the obtained verification result is not passed.
If the verification result is that the user passes, the subsequent step, namely the step of splicing and combining the basic file and the configuration file, can be continuously executed, and if the verification result is that the user does not pass, prompt information can be generated to remind the user.
And S140, sending the integrated file to the embedded controller for brushing.
And sending the obtained integrated file to the embedded controller so as to write the integrated file into the embedded controller, wherein the process is to enable the embedded controller to acquire the integrated file of the latest version, thereby facilitating the subsequent realization of interface function configuration.
And S150, inputting the integrated file into the memory for storage and obtaining a corresponding memory mapping address.
Further, after the integrated file is input into a storage area corresponding to the controller in the memory for storage, the address corresponding to the storage position of the integrated file can be obtained from the memory after the integrated file is stored, and the address is the memory mapping address corresponding to the integrated file.
And S160, if the controller detects that the power is turned on again, reading an integrated file corresponding to the memory mapping address from the memory, and carrying out interface function configuration through the integrated file.
The controller can detect the power-on condition of the main board, if the controller detects that the main board is powered on again, the main board is restarted at the moment, the BIOS system is started, the controller reads an integrated file corresponding to the memory mapping address from the memory, and the corresponding interface function configuration is completed through the integrated file, so that the application of interface function configuration of the main board based on memory sharing is realized.
In a specific embodiment, step S160 includes the substeps of mapping the memory according to the memory mapping address to obtain an integrated file corresponding to the memory mapping address, parsing the integrated file to obtain corresponding configuration parameter information, and sending a corresponding configuration instruction according to a configuration item in the configuration parameter information to perform interface function configuration through the configuration instruction.
Specifically, the memory can be mapped according to the memory mapping address to determine a storage location corresponding to the memory mapping address in the memory, and the integrated file can be obtained by obtaining the data information stored in the storage location. Analyzing the integrated file to obtain configuration parameter information in the integrated file, sending corresponding configuration instructions based on configuration items in the configuration parameter information, wherein the configuration instructions of different configuration items can be sent to a specific component through different communication channels, and after the component receives the configuration instructions, configuring based on parameter values in the configuration instructions to complete interface function configuration, wherein the interface function configuration relates to the configuration of specific parameters such as data transmission, interface function realization and the like.
In the process of analyzing the integrated file, 1KB data of the last bit in the integrated file can be obtained as a check code, and information to be checked corresponding to the first 127KB data in the integrated file is generated according to the check code generation rule. And if the verification codes are inconsistent, the data information in the integrated file is incomplete or the integrated file is tampered, and prompt information which can not be used for interface function configuration can be sent out so as to remind a user.
The memory sharing application method for the mainboard system comprises the steps of sending a memory sharing instruction to set a memory as a sharing mode, reading a basic file corresponding to an embedded controller in the memory and integrating the basic file with a configuration file of the embedded controller to obtain a corresponding integrated file, sending the integrated file to the embedded controller for refreshing, inputting the integrated file into the memory for storage and obtaining a corresponding memory mapping address, and reading the integrated file corresponding to the memory mapping address from the memory and configuring an interface function through the integrated file if the controller detects that the memory is electrified again. According to the method, the data sharing permission is set to share the data information in the memory, so that not only can the mode of operating the transmitted data information be enriched, but also the data transmission efficiency is greatly improved, and the configuration efficiency and the application effect of the mainboard interface function are improved.
The embodiment of the invention also provides a memory sharing application device for the mainboard system, which can be configured in a controller of the mainboard, and is used for executing any embodiment of the memory sharing application method for the mainboard system. Specifically, referring to fig. 3, fig. 3 is a schematic block diagram of a memory sharing application device for a motherboard system according to an embodiment of the present invention.
As shown in fig. 3, the memory sharing application device 100 for a motherboard system includes a memory sharing instruction sending unit 110, a basic file reading unit 120, an integrating unit 130, a sending unit 140, a storage unit 150, and an interface function configuration unit 160.
The memory sharing instruction sending unit 110 is configured to execute a pre-stored memory sharing instruction to set the memory to a sharing mode.
And the base file reading unit 120 is configured to read a base file corresponding to the embedded controller in the memory.
In a specific embodiment, the basic file reading unit 120 includes an instruction sending unit, configured to send a memory information sharing instruction to the embedded controller, so as to control the embedded controller to perform memory sharing setting, and a reading unit, configured to read a corresponding basic file from the memory according to a base address of the embedded controller.
And the integrating unit 130 is configured to integrate the basic file with the configuration file of the embedded controller to obtain a corresponding integrated file.
In a specific embodiment, the integrating unit 130 includes a splicing and combining unit, configured to splice and combine the base file and the configuration file to obtain corresponding combined information, and a format adjustment unit, configured to perform format adjustment on the combined information according to a preset file format, so as to integrate the combined information to obtain the integrated file.
And the sending unit 140 is used for sending the integrated file to the embedded controller for brushing.
The storage unit 150 is configured to input the integrated file into the memory for storage and obtain a corresponding memory mapping address.
And the interface function configuration unit 160 is configured to read the integrated file corresponding to the memory mapping address from the memory and perform interface function configuration through the integrated file if the controller detects that the controller is powered on again.
The memory sharing application device for the mainboard system, which is provided by the embodiment of the invention, is used for sending a memory sharing instruction to set a memory as a sharing mode, reading a basic file corresponding to an embedded controller in the memory and integrating the basic file with a configuration file of the embedded controller to obtain a corresponding integrated file, sending the integrated file to the embedded controller for writing, inputting the integrated file into the memory for storage and obtaining a corresponding memory mapping address, and reading the integrated file corresponding to the memory mapping address from the memory and configuring an interface function through the integrated file if the controller detects that the memory is electrified again. According to the method, the data sharing permission is set to share the data information in the memory, so that not only can the mode of operating the transmitted data information be enriched, but also the data transmission efficiency is greatly improved, and the configuration efficiency and the application effect of the mainboard interface function are improved.
The memory sharing application apparatus for a motherboard system described above may be implemented in the form of a computer program that can run on a computer device as shown in fig. 4.
Referring to fig. 4, fig. 4 is a schematic block diagram of a computer device according to an embodiment of the present invention. The computer device may be a controller for executing a memory sharing application method for a motherboard system to enable communication with an embedded controller based on memory sharing and interface function configuration.
Referring to fig. 4, the computer device 500 includes a processor 502, a memory, and a communication interface 505, which are connected by a communication bus 501, wherein the memory may include a storage medium 503 and an internal memory 504.
The storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, may cause the processor 502 to perform a memory sharing application method for a motherboard system, where the storage medium 503 may be a volatile storage medium or a non-volatile storage medium.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of a computer program 5032 in the storage medium 503, which computer program 5032, when executed by the processor 502, causes the processor 502 to execute a memory sharing application method for a motherboard system.
The communication interface 505 is used for network communication, such as providing transmission of data information, etc. It will be appreciated by those skilled in the art that the architecture shown in fig. 4 is merely a block diagram of some of the architecture relevant to the present inventive arrangements and is not limiting of the computer device 500 to which the present inventive arrangements may be implemented, and that a particular computer device 500 may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
The processor 502 is configured to run a computer program 5032 stored in the memory, so as to implement the corresponding functions in the memory sharing application method for the motherboard system.
Those skilled in the art will appreciate that the embodiment of the computer device shown in fig. 4 is not limiting of the specific construction of the computer device, and in other embodiments, the computer device may include more or less components than those shown, or certain components may be combined, or a different arrangement of components. For example, in some embodiments, the computer device may include only a memory and a processor, and in such embodiments, the structure and function of the memory and the processor are consistent with the embodiment shown in fig. 4, and will not be described again.
It is to be appreciated that in an embodiment of the invention, the Processor 502 may be a general purpose Processor, a digital signal Processor (DIGITAL SIGNAL Processor, DSP), an Application SPECIFIC INTEGRATED Circuit (ASIC), an off-the-shelf Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In another embodiment of the invention, a computer-readable storage medium is provided. The computer readable storage medium may be a volatile or nonvolatile computer readable storage medium. The computer readable storage medium stores a computer program, wherein the computer program when executed by a processor implements the steps included in the memory sharing application method for a motherboard system.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the apparatus, device and unit described above may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein. Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, and for example, the division of the units is merely a logical function division, there may be another division manner in actual implementation, or units having the same function may be integrated into one unit, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices, or elements, or may be an electrical, mechanical, or other form of connection.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment of the present invention.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention is essentially or part of what contributes to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a computer-readable storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. The computer readable storage medium includes various media capable of storing program codes, such as a usb (universal serial bus), a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.