WO2020000947A1 - 实现封装形式的bios数据刷写的方法、装置及设备 - Google Patents

实现封装形式的bios数据刷写的方法、装置及设备 Download PDF

Info

Publication number
WO2020000947A1
WO2020000947A1 PCT/CN2018/123472 CN2018123472W WO2020000947A1 WO 2020000947 A1 WO2020000947 A1 WO 2020000947A1 CN 2018123472 W CN2018123472 W CN 2018123472W WO 2020000947 A1 WO2020000947 A1 WO 2020000947A1
Authority
WO
WIPO (PCT)
Prior art keywords
system management
file
fragment
package file
encapsulated
Prior art date
Application number
PCT/CN2018/123472
Other languages
English (en)
French (fr)
Inventor
孙永博
Original Assignee
郑州云海信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 郑州云海信息技术有限公司 filed Critical 郑州云海信息技术有限公司
Publication of WO2020000947A1 publication Critical patent/WO2020000947A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation

Definitions

  • the present invention relates to the technical field of secure flashing, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for flashing BIOS data in a packaged form.
  • BIOS Basic Input Output System
  • BIOS Basic Input Output System
  • BIOS Basic Input Output System
  • BIOS is of great importance in the electronics industry. It is indispensable and irreplaceable. It is a set of programs that are solidified into a ROM chip on the computer's motherboard. It saves the computer's most important basic input and output. Programs, power-on self-tests, and system startup programs, are responsible for the initialization and resource allocation of the computer hardware platform and the loading of the operating system, while also providing some essential system parameters for the operating system, without which the computer will not boot, more Can not work normally.
  • the BIOS needs to be flashed to a ROM chip on the computer's motherboard. This requires a flashing tool.
  • the flashing tools are mainly divided into two categories: hardware and software. Hardware flashing tools are inconvenient to operate and need to be removed from the ROM or on the motherboard. Reserve the corresponding interface, and connect the tool with the cable. Therefore, in the prior art, a software flashing tool is
  • BIOS file Due to the importance of the BIOS, once the contents of the BIOS have been tampered with maliciously and bad programs are added, it will threaten the security of the system and data. For security reasons, the industry currently uses the Capsule package specification provided by Intel to The BIOS file is encapsulated and encrypted. The BIOS file is parsed out from the package for verification before flashing. The flashing is performed only after the verification is passed. This ensures the security of the BIOS file and has not been tampered with.
  • the server After the package file data is read into the memory and subjected to memory protection processing, the server enters the sleep mode. After the server recovers from the sleep mode, the package file data is read from the memory, and the original BIOS data is parsed from the package file data. To flash the original BIOS data.
  • BIOS flashing the implementation process and technology of BIOS flashing are complicated, and data needs to be transmitted through sleep wake-up or restart, and the corresponding memory data must be maintained so that it is not modified during sleep, wake-up or restart; Sleeping and waking up or restarting cause the entire flashing process to take a long time; and most servers do not support sleep and cannot be flashed in this way.
  • the object of the present invention is to provide a method, a device and a device for flashing BIOS data in a packaged form, which has solved the problem that during the BIOS flashing process in the prior art, the packaged files need to be transmitted by sleeping, waking or restarting, resulting in flashing time. Too long a problem.
  • the present invention provides a method for flashing BIOS data in a packaged form, which includes: after reading a pre-generated packaged file into memory, using a corresponding underlying driver of an operating system to store the packaged file.
  • the address is converted into a physical address; a system management interrupt is triggered, and the physical address and size of the package file are transferred to a system management mode environment, so that the package file is read and restored in the system management mode environment;
  • the system management is interrupted, and the package file is processed in the system management mode; the data information obtained after processing the package file is used to complete the flashing of the original BIOS data.
  • the method further includes:
  • the triggering a system management interrupt and transmitting the physical address and size of the package file to a system management mode environment, so that the package file is read and restored in the system management mode environment includes:
  • each of the encapsulated fragments is sequentially read, and a complete encapsulated file is obtained according to the fragment physical address and the fragment size of each fragment of the encapsulated file.
  • the triggering the system management interruption, and processing the package file in the system management mode includes:
  • using the data information obtained after processing the encapsulated file to complete the flashing of the BIOS original data includes: calling the SPI access function to the BIOS original data by using the SPI address obtained after parsing the encapsulated file. Brush writing.
  • the present invention also provides a device for implementing BIOS data flashing in a package form, including:
  • a conversion module configured to read a pre-generated package file into memory, and then use a corresponding underlying driver of the operating system to convert the storage address of the package file into a physical address;
  • a transmitting module for triggering a system management interrupt, and transmitting the physical address and size of the package file to a system management mode environment, so that the package file is read and restored in the system management mode environment;
  • a processing module for triggering the system management interruption, and processing the package file in the system management mode
  • the flashing module is configured to complete the flashing of the original BIOS data by using the data information obtained after processing the package file.
  • the conversion module further includes: a segmentation module, configured to perform segmentation processing on the package file to obtain a fragment physical address and a fragment size of each fragment of the package file.
  • a segmentation module configured to perform segmentation processing on the package file to obtain a fragment physical address and a fragment size of each fragment of the package file.
  • the transmission module is specifically configured to:
  • each of the encapsulated fragments is sequentially read, and a complete encapsulated file is obtained according to the fragment physical address and the fragment size of each fragment of the encapsulated file.
  • the processing device is specifically configured to: trigger a system management interrupt, and transmit the fragment physical address and fragment size of each fragment of the package file to a system management mode environment;
  • each of the encapsulated fragments is sequentially read, and a complete encapsulated file is obtained by splicing according to the fragment physical address and fragment size of each fragment of the encapsulated file.
  • the present invention also provides a device for flashing BIOS data in a packaged form, including: a memory for storing BIOS data; and a processor for implementing the above-mentioned BIOS data flashing in a packaged form when executing the computer program. Write method steps.
  • the method for flashing BIOS data in a packaged form reads a previously generated packaged file into a memory, and uses a corresponding underlying driver of an operating system to convert a storage address of the packaged file into a physical address; triggering a system Management interruption, transmitting the physical address and size of the package file to a system management mode environment, and reading the package file in the system management mode environment; triggering the system management interruption in the system management environment Process the package file; and use the data information obtained after processing the package file to complete the flashing of the BIOS original data.
  • the method for flashing BIOS data in an encapsulated form utilizes a system management interrupt and a system management mode to implement transmission of the encapsulated file, which solves the need to sleep the BIOS data in the prior art when flashing the BIOS data.
  • Wake-up or restart mode transmits the package file, which causes the problem of long BIOS flashing time; greatly saves the time required for the BIOS flashing process; and because the server does not need to perform sleep wake-up or restart functions, the implementation provided by the present invention
  • the method of flashing the BIOS data in an encapsulated form is more applicable.
  • FIG. 1 is a flowchart of a first specific embodiment of a method for implementing BIOS data flashing in an encapsulated form according to the present invention
  • FIG. 2 is a flowchart of a second specific embodiment of a method for implementing BIOS data flashing in an encapsulated form according to the present invention
  • FIG. 3 is a structural block diagram of a device for implementing BIOS data flashing in a packaged form according to an embodiment of the present invention.
  • the core of the present invention is to provide a method, a device, and a device for implementing BIOS data flashing in a packaged form, making the BIOS data flashing process simple and easy, and greatly saving the time required for BIOS flashing.
  • FIG. 1 is a flowchart of a first specific embodiment of a method for implementing BIOS data flashing in an encapsulated form provided by the present invention; specific operation steps are as follows:
  • Step S101 after reading the pre-generated package file into memory, using a corresponding underlying driver of the operating system to convert the storage address of the package file into a physical address;
  • the method for flashing BIOS data in an encapsulated form provided in this embodiment can be run in a UEFI Shell environment, and also in a Windows and Linux environment; when running in different operating environments, use the same as the operating environment.
  • the corresponding low-level driver converts the storage address of the package file into a physical address.
  • Step S102 a system management interrupt is triggered, and the physical address and size of the package file are transferred to a system management mode environment, so that the package file is read and restored in the system management mode environment;
  • SMI System Management Interrupt
  • SMM System Management Mode
  • Step S103 the system management interrupt is triggered, and the package file is processed in the system management mode
  • Step S104 Use the data information obtained after processing the package file to complete the flashing of the original BIOS data.
  • the method for flashing BIOS data in an encapsulated form uses the system management interrupt and the system management mode to transmit the encapsulated file; solving the need for the server to sleep and wake up or restart in the prior art
  • the transmission of the package file causes the BIOS system flashing process to take a long time.
  • the writing method provided in this embodiment is relatively simple and easy to implement, and is applicable to server models; it can be used in UEFI Shell / Windows / Linux operating environments.
  • the package file in this embodiment is a Capsule file
  • the Capsule file is a general BIOS data package form.
  • the Capsule file may be segmented according to the size of the Capsule file and then transmitted in segments, which further improves the flashing efficiency of the BIOS data.
  • FIG. 2 is a flowchart of a second specific embodiment of a method for implementing BIOS data flashing in an encapsulated form according to the present invention; specific operation steps are as follows:
  • Step S201 After reading the pre-generated Capsule file to the memory, the storage address of the package file is converted into a physical address by using a corresponding underlying driver of the operating system;
  • Step S202 performing segment processing on the Capsule file to obtain a fragment physical address and a fragment size of each fragment of the Capsule file;
  • Step S203 a system management interrupt is triggered, and the fragment physical address and fragment size of each fragment of the Capsule file are transmitted to the system management mode environment;
  • Step S204 In the system management mode environment, sequentially read each fragment of the Capsule file, and stitch the entire package file according to the fragment physical address and fragment size of each fragment of the package file;
  • Step S205 trigger the system management interruption, and verify the Capsule file in the system management mode
  • Step S206 After the Capsule file is successfully verified, the Capsule file is parsed in the system management mode to obtain the original BIOS data and the SPI address.
  • Step S207 Use the SPI address obtained after parsing the Capsule file to call an SPI access function to flash the BIOS raw data.
  • the Capsule file is divided into a plurality of fragments according to the size of the Capsule file; the system management interrupt is triggered to trigger the Capsule
  • the fragment physical address and fragment size of each fragment of the file are transmitted to the system management module environment; in the system management module environment, after the fragments are spliced, the complete Capsule file is read, and the spliced
  • the Capsule file is checked to determine whether the file data is overwritten. If it is not overwritten, the verification is successful; the successfully verified Capsule file is parsed to obtain the BIOS original data and the SPI address, and the SPI access function is called to the BIOS original data. Flashing.
  • the method for flashing BIOS data in an encapsulated form provided by this embodiment implements integrity check and flashing of BIOS data, and can be applied to Windows and Linux environments. It is simpler and easier than the prior art, and is applicable to Most server models.
  • the package file may be a Capsule file; it may also be a package file in another package format.
  • FIG. 3 is a structural block diagram of a device for implementing BIOS data flashing in a packaged form according to an embodiment of the present invention
  • a specific device may include:
  • a conversion module 100 configured to read a pre-generated package file into a memory, and then convert a storage address of the package file into a physical address by using a corresponding underlying driver of an operating system;
  • the transmitting module 200 is configured to trigger a system management interrupt, and transmit the physical address and size of the package file to a system management mode environment, so that the package file is read and restored in the system management mode environment;
  • a processing module 300 configured to trigger the system management interruption, and process the package file in the system management mode
  • the flashing module 400 is configured to complete the flashing of the original BIOS data by using the data information obtained after processing the package file.
  • the apparatus for flashing BIOS data in this embodiment is used to implement the foregoing method for flashing BIOS data in an encapsulated form. Therefore, the specific implementation manner in the apparatus for flashing BIOS data can be seen in the BIOS data in an encapsulated form described above.
  • the conversion module 100, the transmission module 200, the processing module 300, and the flashing module 400 are respectively used to implement steps S101, S102, and S103 in the method for flashing BIOS data in an encapsulated form. And S104. Therefore, for specific implementation manners, reference may be made to the descriptions of the respective embodiments, and details are not described herein again.
  • a specific embodiment of the present invention further provides a device for implementing BIOS data flashing in an encapsulated form, including: a memory for storing BIOS data; and a processor for implementing the foregoing implementation of the encapsulated form when executing the computer program. Steps in the method of flashing the BIOS data.
  • RAM random access memory
  • ROM read-only memory
  • electrically programmable ROM electrically erasable programmable ROM
  • registers hard disks, removable disks, CD-ROMs, or in technical fields Any other form of storage medium is known.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Stored Programmes (AREA)

Abstract

一种实现封装形式的BIOS数据刷写的方法、装置以及设备,方法包括:预先生成的封装文件读取至内存后,利用操作系统相应的底层驱动将所述封装文件的存储地址转换为物理地址(S101);触发系统管理中断,将所述封装文件的物理地址和大小传送至系统管理模式环境中,从而使在所述系统管理模式环境中读取并还原所述封装文件(S102);触发所述系统管理中断,在所述系统管理模式中对所述封装文件进行处理(S103);利用处理所述封装文件后得到的数据信息,完成对BIOS原数据的刷写(S104)。利用该方法,使封装形式的BIOS数据刷写过程简便易行,且大大节省了BIOS封装文件刷写所需时间。

Description

实现封装形式的BIOS数据刷写的方法、装置及设备
本申请要求于2018年6月29日提交中国专利局、申请号为201810699015.X、发明名称为“实现封装形式的BIOS数据刷写的方法、装置及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及安全刷写技术领域,特别是涉及一种实现封装形式的BIOS数据刷写的方法、装置、设备以及计算机可读存储介质。
背景技术
BIOS(基本输入输出系统)在电子行业具有非常高的重要性,不可或缺,无可替代,它是一组固化到计算机主板上一个ROM芯片里的程序,保存着计算机最重要的基本输入输出的程序、开机自检程序和系统启动程序,负责计算机硬件平台的初始化和资源分配以及操作系统的加载,同时还会为操作系统提供一些必不可少的系统参数,没有它计算机便不开机,更不能正常工作。BIOS需要刷写到计算机主板上的一个ROM芯片里,这就需要刷写工具,刷写工具主要分为硬件和软件两大类,硬件刷写工具操作不便,需要把ROM取下来,或者在主板预留相应的接口,通过连线与工具相连。因此现有技术中一般应用软件刷写工具实现BIOS文件的刷写。
由于BIOS的重要性,一旦BIOS中的内容被恶意篡改,加入不良企图的程序,就会威胁到系统和数据的安全,出于安全性的考虑,目前业界普遍采用Intel提供的Capsule封装规范,把BIOS文件封装和加密,在刷写前再把BIOS文件从封装中解析出来进行校验,只有校验通过,才进行刷写,这就保证了BIOS文件的安全性,没有被篡改。
现有技术中将封装文件数据读取到内存,并做内存保护处理后,服务器进入睡眠模式,服务器从睡眠模式恢复后,从内存读取封装文件数据,在封装文件数据中解析出BIOS原数据,对所述BIOS原数据进行刷写。在现有技术中,BIOS刷写的实现过程和技术复杂,需要通过睡眠唤醒或者重 启的方式传递数据,并要保持住相应内存数据,使在睡眠和唤醒或者重启过程中不被修改;由于需要睡眠和唤醒或者重启,导致整个刷写过程耗时时间长;且大部分服务器不支持睡眠,不能通过这种方式实现刷写。
综上所述可以看出,如何使封装文件不通过睡眠唤醒或者重启的方式传送是目前有待解决的问题。
发明内容
本发明的目的是提供一种实现封装形式的BIOS数据刷写的方法、装置以及设备,已解决现有技术中BIOS刷写过程中,封装文件需要睡眠唤醒或者重启的方式传送,造成刷写时间过长的问题。
为解决上述技术问题,本发明提供一种实现封装形式的BIOS数据刷写的方法,包括:将预先生成的封装文件读取至内存后,利用操作系统相应的底层驱动将所述封装文件的存储地址转换为物理地址;触发系统管理中断,将所述封装文件的物理地址和大小传送至系统管理模式环境中,从而使在所述系统管理模式环境中读取并还原所述封装文件;触发所述系统管理中断,在所述系统管理模式中对所述封装文件进行处理;利用处理所述封装文件后得到的数据信息,完成对BIOS原数据的刷写。
优选地,所述将预先生成的封装文件读取至内存后,利用操作系统相应的底层驱动将所述封装文件的地址转换为物理地址后还包括:
对所述封装文件进行分段处理,得到所述封装文件的各个片段的片段物理地址和片段大小。
优选地,所述触发系统管理中断,将所述封装文件的物理地址和大小传送至系统管理模式环境中,从而使在所述系统管理模式环境中读取并还原所述封装文件包括:
触发系统管理中断,将所述封装文件的各个片段的片段物理地址和片段大小传送至系统管理模式环境中;
在所述系统管理模式环境中,依次读取所述封装的各个片段,依据所述封装文件的各个片段的片段物理地址和片段大小,拼接得到完整的封装文件。
优选地,所述触发所述系统管理中断,在所述系统管理模式中对所述封装文件进行处理包括:
触发所述系统管理中断,在所述系统管理模式中对所述封装文件进行校验;所述封装文件校验成功后,在所述系统管理模式中对所述封装文件进行解析,得到BIOS原数据和SPI地址。
优选地,所述利用处理所述封装文件后得到的数据信息,完成对BIOS原数据的刷写包括:利用对所述封装文件解析后得到的SPI地址调用SPI访问函数对所述BIOS原数据进行刷写。
本发明还提供了一种封装形式的实现BIOS数据刷写的装置,包括:
转换模块,用于将预先生成的封装文件读取至内存后,利用操作系统相应的底层驱动将所述封装文件的存储地址转换为物理地址;
传送模块,用于触发系统管理中断,将所述封装文件的物理地址和大小传送至系统管理模式环境中,从而使在所述系统管理模式环境中读取并还原所述封装文件;
处理模块,用于触发所述系统管理中断,在所述系统管理模式中对所述封装文件进行处理;
刷写模块,用于利用处理所述封装文件后得到的数据信息,完成对BIOS原数据的刷写。
优选地,所述转换模块后还包括:分段模块,用于对所述封装文件进行分段处理,得到所述封装文件的各个片段的片段物理地址和片段大小。
优选地,所述传送模块具体用于:
触发系统管理中断,将所述封装文件的各个片段的片段物理地址和片段大小传送至系统管理模式环境中;
在所述系统管理模式环境中,依次读取所述封装的各个片段,依据所述封装文件的各个片段的片段物理地址和片段大小,拼接得到完整的封装文件。
优选地,所述处理装置具体用于:触发系统管理中断,将所述封装文件的各个片段的片段物理地址和片段大小传送至系统管理模式环境中;
在所述系统管理模式环境中,依次读取所述封装的各个片段,依据所 述封装文件的各个片段的片段物理地址和片段大小,拼接得到完整的封装文件。
本发明还提供了一种实现封装形式的BIOS数据刷写的设备,包括:存储器,用于存储BIOS数据;处理器,用于执行所述计算机程序时实现上述一种实现封装形式的BIOS数据刷写的方法的步骤。
本发明所提供的实现封装形式的BIOS数据刷写的方法,将预先生成的封装文件读取至内存后,利用操作系统相应的底层驱动将所述封装文件的存储地址转换为物理地址;触发系统管理中断,将所述封装文件的物理地址和大小传送至系统管理模式环境中,在所述系统管理模式环境中读取所述封装文件;触发所述系统管理中断,在所述系统管理环境中对所述封装文件进行处理;利用处理所述封装文件后得到的数据信息完成对所述BIOS原数据的刷写。本发明所提供的实现封装形式的BIOS数据刷写的方法,利用系统管理中断和系统管理模式实现对所述封装文件的传送,解决了现有技术中对BIOS数据进行刷写时,需要通过睡眠唤醒或者重启的方式传送封装文件,导致BIOS刷写时间过长的问题;大大节省了BIOS刷写过程所需时间;且由于服务器不需要进行睡眠唤醒或者重启的功能,使本发明所提供的实现封装形式的BIOS数据刷写的方法适用范围更广。
附图说明
为了更清楚的说明本发明实施例或现有技术的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明所提供的实现封装形式的BIOS数据刷写的方法的第一种具体实施例的流程图;
图2为本发明所提供的实现封装形式的BIOS数据刷写的方法的第二种具体实施例的流程图;
图3为本发明实施例提供的一种实现封装形式的BIOS数据刷写的装置的结构框图。
具体实施方式
本发明的核心是提供一种实现封装形式的BIOS数据刷写的方法、装置以及设备,使BIOS数据刷写过程简便易行,且大大节省了BIOS刷写所需时间。
为了使本技术领域的人员更好地理解本发明方案,下面结合附图和具体实施方式对本发明作进一步的详细说明。显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
请参考图1,图1为本发明所提供的实现封装形式的BIOS数据刷写的方法的第一种具体实施例的流程图;具体操作步骤如下:
步骤S101:将预先生成的封装文件读取至内存后,利用操作系统相应的底层驱动将所述封装文件的存储地址转换为物理地址;
本实施例所提供的实现封装形式的BIOS数据刷写的方法,可以在UEFI Shell环境下运行,也可以在Windows和Linux环境下运行;在不同运行环境下运行时,利用与所述运行环境相对应的底层驱动将所述封装文件的存储地址转换为物理地址。
步骤S102:触发系统管理中断,将所述封装文件的物理地址和大小传送至系统管理模式环境中,从而使在所述系统管理模式环境中读取并还原所述封装文件;
触发系统管理中断(SMI System Management Interrupt),将所述封装文件的物理地址和大小传送至统管理模式环境(SMM System Management Mode)中,在所述系统管理模式环境中读取并还原所述封装文件。
步骤S103:触发所述系统管理中断,在所述系统管理模式中对所述封装文件进行处理;
步骤S104:利用处理所述封装文件后得到的数据信息,完成对BIOS原数据的刷写。
本实施例所提供的实现封装形式的BIOS数据刷写的方法,利用所述系统管理中断和所述系统管理模式对所述封装文件传送;解决了现有技术 中需要服务器进行睡眠和唤醒或者重启传送封装文件,造成所述BIOS系统刷写过程时间较长。且本实施例所提供的书写方法,相对简便易行,适用于服务器机型;可以利用于UEFI Shell/Windows/Linux运行环境下。
基于上述实施例,在本实施例中所述封装文件为Capsule文件,所述Capsule文件一种通用的BIOS数据的封装形式。在所述Capsule文件过大,不能一次完成传输时,可以根据所述Capsule文件的大小对所述Capsule文件分片段后,进行分段传递,进一步提高了BIOS数据的刷写效率。请参考图2,图2为本发明所提供的实现封装形式的BIOS数据刷写的方法的第二种具体实施例的流程图;具体操作步骤如下:
步骤S201:将预先生成的Capsule文件读取至内存后,利用操作系统相应的底层驱动将所述封装文件的存储地址转换为物理地址;
步骤S202:对所述Capsule文件进行分段处理,得到所述Capsule文件的各个片段的片段物理地址和片段大小;
步骤S203:触发系统管理中断,将所述Capsule文件的各个片段的片段物理地址和片段大小传送至系统管理模式环境中;
步骤S204:在所述系统管理模式环境中,依次读取所述Capsule文件的各个片段,依据所述封装文件的各个片段的片段物理地址和片段大小,拼接得到完整的封装文件;
步骤S205:触发所述系统管理中断,在所述系统管理模式中对所述Capsule文件进行校验;
步骤S206:所述Capsule文件校验成功后,在所述系统管理模式中对所述Capsule文件进行解析,得到BIOS原数据和SPI地址。
步骤S207:利用对所述Capsule文件解析后得到的SPI地址调用SPI访问函数对所述BIOS原数据进行刷写。
在本实施例中,在将所述封装文件的内存地址转换为物理地址后,依据所述Capsule文件的大小,将所述Capsule文件划分为多个片段;触发所述系统管理中断将所述Capsule文件的各个片段的片段物理地址和片段大小传输至所述系统管理模块环境中;在所述系统管理模块环境中,对所述 各个片段进行拼接后,读取完整的Capsule文件,对拼接出的Capsule文件进行检验,判断文件数据是否被改写,若未改写,则校验成功;对校验成功的Capsule文件进行解析,得到BIOS原数据和SPI地址,从而调用SPI访问函数对所述BIOS原数据进行刷写。本实施例所提供的实现封装形式的BIOS数据刷写的方法,实现了BIOS数据的完整性校验和刷写,且可以应用于Windows和Linux环境中,相对现有技术简便易行,适用于大部分服务器机型。
基于上述实施例,在本申请中,所述封装文件可以为Capsule文件;也可以为其他封装形式的封装文件。
请参考图3,图3为本发明实施例提供的一种实现封装形式的BIOS数据刷写的装置的结构框图;具体装置可以包括:
转换模块100,用于将预先生成的封装文件读取至内存后,利用操作系统相应的底层驱动将所述封装文件的存储地址转换为物理地址;
传送模块200,用于触发系统管理中断,将所述封装文件的物理地址和大小传送至系统管理模式环境中,从而使在所述系统管理模式环境中读取并还原所述封装文件;
处理模块300,用于触发所述系统管理中断,在所述系统管理模式中对所述封装文件进行处理;
刷写模块400,用于利用处理所述封装文件后得到的数据信息,完成对BIOS原数据的刷写。
本实施例的实现BIOS数据刷写的装置用于实现前述的实现封装形式的BIOS数据刷写的方法,因此实现BIOS数据刷写的装置中的具体实施方式可见前文中的实现封装形式的BIOS数据刷写的方法的实施例部分,例如,转换模块100,传送模块200,处理模块300,刷写模块400,分别用于实现上述实现封装形式的BIOS数据刷写的方法中步骤S101,S102,S103和S104,所以,其具体实施方式可以参照相应的各个部分实施例的描述,在此不再赘述。
本发明具体实施例还提供了一种实现封装形式的BIOS数据刷写的设 备,包括:存储器,用于存储BIOS数据;处理器,用于执行所述计算机程序时实现上述一种实现封装形式的BIOS数据刷写的方法的步骤。
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。
以上对本发明所提供的实现封装形式的BIOS数据刷写的方法、装置以及设备进行了详细介绍。本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进和修饰,这些改进和修饰也落入本发明权利要求的保护范围内。

Claims (10)

  1. 一种实现封装形式的BIOS数据刷写的方法,其特征在于,包括:
    将预先生成的封装文件读取至内存后,利用操作系统相应的底层驱动将所述封装文件的存储地址转换为物理地址;
    触发系统管理中断,将所述封装文件的物理地址和大小传送至系统管理模式环境中,从而使在所述系统管理模式环境中读取并还原所述封装文件;
    触发所述系统管理中断,在所述系统管理模式中对所述封装文件进行处理;
    利用处理所述封装文件后得到的数据信息,完成对BIOS原数据的刷写。
  2. 如权利要1所述的方法,其特征在于,所述将预先生成的封装文件读取至内存后,利用操作系统相应的底层驱动将所述封装文件的地址转换为物理地址后还包括:
    对所述封装文件进行分段处理,得到所述封装文件的各个片段的片段物理地址和片段大小。
  3. 如权利要求2所述的方法,其特征在于,所述触发系统管理中断,将所述封装文件的物理地址和大小传送至系统管理模式环境中,从而使在所述系统管理模式环境中读取并还原所述封装文件包括:
    触发系统管理中断,将所述封装文件的各个片段的片段物理地址和片段大小传送至系统管理模式环境中;
    在所述系统管理模式环境中,依次读取所述封装的各个片段,依据所述封装文件的各个片段的片段物理地址和片段大小,拼接得到完整的封装文件。
  4. 如权利要求3所述的方法,其特征在于,所述触发所述系统管理中断,在所述系统管理模式中对所述封装文件进行处理包括:
    触发所述系统管理中断,在所述系统管理模式中对所述封装文件进行校验;
    所述封装文件校验成功后,在所述系统管理模式中对所述封装文件进 行解析,得到BIOS原数据和SPI地址。
  5. 如权利要求4所述的方法,其特征在于,所述利用处理所述封装文件后得到的数据信息,完成对BIOS原数据的刷写包括:
    利用对所述封装文件解析后得到的SPI地址调用SPI访问函数对所述BIOS原数据进行刷写。
  6. 一种实现封装形式的BIOS数据刷写的装置,其特征在于,包括:
    转换模块,用于将预先生成的封装文件读取至内存后,利用操作系统相应的底层驱动将所述封装文件的存储地址转换为物理地址;
    传送模块,用于触发系统管理中断,将所述封装文件的物理地址和大小传送至系统管理模式环境中,从而使在所述系统管理模式环境中读取并还原所述封装文件;
    处理模块,用于触发所述系统管理中断,在所述系统管理模式中对所述封装文件进行处理;
    刷写模块,用于利用处理所述封装文件后得到的数据信息,完成对BIOS原数据的刷写。
  7. 如权利要求6所述的装置,其特征在于,所述转换模块后还包括:
    分段模块,用于对所述封装文件进行分段处理,得到所述封装文件的各个片段的片段物理地址和片段大小。
  8. 如权利要求7所述的装置,其特征在于,所述传送模块具体用于:
    触发系统管理中断,将所述封装文件的各个片段的片段物理地址和片段大小传送至系统管理模式环境中;
    在所述系统管理模式环境中,依次读取所述封装的各个片段,依据所述封装文件的各个片段的片段物理地址和片段大小,拼接得到完整的封装文件。
  9. 如权利要求8所述的装置,其特征在于,所述处理装置具体用于:
    触发系统管理中断,将所述封装文件的各个片段的片段物理地址和片段大小传送至系统管理模式环境中;
    在所述系统管理模式环境中,依次读取所述封装的各个片段,依据所述封装文件的各个片段的片段物理地址和片段大小,拼接得到完整的封装 文件。
  10. 一种实现封装形式的BIOS数据刷写的设备,其特征在于,包括:
    存储器,用于存储BIOS数据;
    处理器,用于执行所述计算机程序时实现如权利要求1至5任一项所述一种实现封装形式的BIOS数据刷写的方法的步骤。
PCT/CN2018/123472 2018-06-29 2018-12-25 实现封装形式的bios数据刷写的方法、装置及设备 WO2020000947A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810699015.X 2018-06-29
CN201810699015.XA CN108958749A (zh) 2018-06-29 2018-06-29 实现封装形式的bios数据刷写的方法、装置及设备

Publications (1)

Publication Number Publication Date
WO2020000947A1 true WO2020000947A1 (zh) 2020-01-02

Family

ID=64484560

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/123472 WO2020000947A1 (zh) 2018-06-29 2018-12-25 实现封装形式的bios数据刷写的方法、装置及设备

Country Status (2)

Country Link
CN (1) CN108958749A (zh)
WO (1) WO2020000947A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108958749A (zh) * 2018-06-29 2018-12-07 郑州云海信息技术有限公司 实现封装形式的bios数据刷写的方法、装置及设备
CN109343886B (zh) * 2018-12-12 2022-04-29 广东浪潮大数据研究有限公司 一种升级bios的方法、装置以及设备
CN111722864A (zh) * 2020-06-24 2020-09-29 深圳市元征科技股份有限公司 一种ecu数据刷写方法及相关装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103207797A (zh) * 2013-03-15 2013-07-17 南京工业大学 基于通用可扩展固件接口固件系统的胶囊式定制更新方法
CN104200843A (zh) * 2014-09-13 2014-12-10 无锡中星微电子有限公司 闪存烧入器、烧入系统及烧入方法
CN105005471A (zh) * 2015-06-24 2015-10-28 北京百度网讯科技有限公司 修改bios的配置参数的方法、设备、服务器和系统
WO2016105862A1 (en) * 2014-12-25 2016-06-30 Intel Corporation Method, apparatus, system for centering in a high-performance interconnect
CN108958749A (zh) * 2018-06-29 2018-12-07 郑州云海信息技术有限公司 实现封装形式的bios数据刷写的方法、装置及设备

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102455939A (zh) * 2010-10-19 2012-05-16 英业达股份有限公司 系统管理中断机制
CN107220053B (zh) * 2017-05-25 2020-10-27 联想(北京)有限公司 一种bios管理方法及电子设备
CN107479931B (zh) * 2017-08-18 2020-10-16 苏州浪潮智能科技有限公司 一种linux系统应用层刷新BIOS的方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103207797A (zh) * 2013-03-15 2013-07-17 南京工业大学 基于通用可扩展固件接口固件系统的胶囊式定制更新方法
CN104200843A (zh) * 2014-09-13 2014-12-10 无锡中星微电子有限公司 闪存烧入器、烧入系统及烧入方法
WO2016105862A1 (en) * 2014-12-25 2016-06-30 Intel Corporation Method, apparatus, system for centering in a high-performance interconnect
CN105005471A (zh) * 2015-06-24 2015-10-28 北京百度网讯科技有限公司 修改bios的配置参数的方法、设备、服务器和系统
CN108958749A (zh) * 2018-06-29 2018-12-07 郑州云海信息技术有限公司 实现封装形式的bios数据刷写的方法、装置及设备

Also Published As

Publication number Publication date
CN108958749A (zh) 2018-12-07

Similar Documents

Publication Publication Date Title
JP6728409B2 (ja) 仮想化マネージャのセキュアなブート処理
JP6715356B2 (ja) 部分的にオフロードされた仮想化マネージャにおけるメモリ割当て技術
US7752428B2 (en) System and method for trusted early boot flow
JP6845264B2 (ja) オポチュニスティックハイパーバイザを用いたパフォーマンスの変動の低減
US6678833B1 (en) Protection of boot block data and accurate reporting of boot block contents
US11544223B2 (en) Write operation verification method and apparatus
WO2020000947A1 (zh) 实现封装形式的bios数据刷写的方法、装置及设备
US20090271603A1 (en) Embedded system and startup method thereof
KR20130058058A (ko) 서비스 프로세서 컴플렉스 내의 데이터 저장을 위한 요구 기반 usb 프록시
US10228993B2 (en) Data dump for a memory in a data processing system
US20130138934A1 (en) Loading configuration information
WO2018040494A1 (zh) 一种扩展处理器指令集的方法及装置
US10303487B2 (en) System and method for booting an information handling system
CN108509215B (zh) 一种系统软件的更换方法、装置、终端设备及存储介质
US11886886B2 (en) System and method for runtime synchronization and authentication of pre-boot device drivers for a rescue operating system
US9292664B2 (en) Key injection tool
US10514972B2 (en) Embedding forensic and triage data in memory dumps
US20220237144A1 (en) Baseboard management controller and construction method thereof
US10642623B1 (en) Preserving firmware settings during firmware updates
CN114721493A (zh) 芯片启动方法、计算机设备及可读存储介质
CN116881929B (zh) 安全防护方法、装置、电子设备以及基板控制器芯片
CN111198832B (zh) 一种处理方法和电子设备
US9141803B2 (en) Self-healing of operating system components
CN116225541A (zh) 一种带内cpu与带外管理bmc通信的方法及通信系统
CN113655846A (zh) 一种OpenPOWER服务器时间同步方法及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18924857

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18924857

Country of ref document: EP

Kind code of ref document: A1