Disclosure of Invention
It is therefore an object of the present invention to provide a method for trusted booting of a computer, which enables a trusted booting at a low cost.
In order to achieve the above object, the present invention provides a method for trusted starting of a computer, comprising:
Step 10, starting the computer, wherein an MCU on a computer main board prohibits a CPU from accessing system firmware in a ROM (read only memory), the MCU verifies the content of the system firmware in the ROM, if the system firmware is not tampered, the authentication is passed, the MCU allows the CPU to access the system firmware in the ROM, the CPU executes a system firmware code in the ROM to continue starting, otherwise, the starting is prohibited;
step 20, starting running and initializing a memory by the system firmware, and sending a secret word and memory information to the MCU, starting a first watchdog of the MCU, waiting for the secret word and memory information sent by the system firmware, and if the MCU does not receive a correct secret word within a set time, starting the MCU is forbidden to overtime, if the first watchdog does not overtime, and the MCU receives the correct secret word and memory information, starting the MCU continuously, otherwise starting the MCU is forbidden;
step 30, the system firmware checks the equipment information on the main board and sends the darkness and the equipment information to the MCU, and starts a second watchdog of the MCU to wait for the darkness and the equipment information sent by the system firmware, if the MCU does not receive the correct darkness within a set time, the second watchdog overturns, the starting is forbidden, if the second watchdog does not overtime, and the MCU receives the correct darkness and the equipment information, the second watchdog is closed, the starting is continued, and otherwise the starting is forbidden;
And step 40, the system firmware checks the system file information on the hard disk and sends the dark language and the system file information to the MCU, and starts a third watchdog of the MCU to wait for the dark language and the system file information sent by the system firmware, if the MCU does not receive the correct dark language within a set time, the third watchdog overturns to prohibit starting, and if the third watchdog does not overtime and the MCU receives the correct dark language and the system file information, the third watchdog is closed, the trusted verification is passed, and the operating system is started.
The computer trusted starting method further comprises the following steps:
Step 12, after the CPU executes the system firmware code in the ROM to continue to boot, judging whether the system firmware code is first boot, if so, collecting the device information on the motherboard and the information of the system file on the hard disk and sending the information to the MCU through a whistle to serve as original reference data;
and 14, judging whether the system firmware needs to be updated when the first power-on is judged in the step 12, if so, updating the system firmware, informing the MCU to recalculate the check value of the system firmware content in the ROM, and if not, turning to the step 20.
The device information is a hash value of the device information.
The system file information is a hash value of the system file information.
The ROM is a flash memory.
The computer includes a desktop computer, a notebook computer, a tablet computer, and a vehicle-mounted computer.
The CPU and MCU are connected via the same channel selector to a ROM storing system firmware.
The CPU and MCU are connected to the channel selector via an SPI bus, and the channel selector is connected to the ROM via an SPI bus.
In summary, the computer trusted starting method of the invention can realize a low-cost trusted starting scheme.
Detailed Description
Referring to FIG. 1, a schematic block diagram of a computer trusted boot method according to a preferred embodiment of the present invention is shown. The invention provides a new computer trusted starting method which can be implemented by proper modification based on the existing software and hardware, thereby realizing a low-cost trusted starting scheme. As shown in fig. 1, in principle, the hardware and/or software modules related to the trusted starting method of the computer mainly include a CPU (central processing unit) disposed on a motherboard of the computer, an MCU (micro control unit), a motherboard power control logic module, a channel selector, a ROM (read only memory) storing system firmware, i.e. a BIOS, in this embodiment, the ROM may be specifically Flash (Flash memory), the motherboard power control logic module, and other components (devices or hardware) on the motherboard, and further, a watchdog (not shown), and those skilled in the art will understand that the watchdog may be implemented by hardware or software and will not be described herein. Wherein the CPU and the MCU are connected to the ROM storing the system firmware via the same channel selector, in this preferred embodiment the connection is specifically chosen to be realized by an SPI (serial peripheral interface) bus, i.e. the CPU and the MCU are connected to said channel selector via an SPI bus, said channel selector being connected to said ROM via an SPI bus. In the preferred embodiment, the motherboard power control logic module is electrically connected to the CPU and other components on the motherboard, respectively, to provide CPU power and device power, respectively. In this preferred embodiment, the MCU is in communication connection with the ROM on the one hand, and in communication with the motherboard power control logic module on the other hand, so that the MCU can provide firmware access control and power control signals, and therefore, when the system firmware gathers system firmware and/or hardware information during the start-up process and sends the information to the MCU for verification, when the information is not matched, for example, a memory bank replacement is encountered, an external device replacement on the motherboard, and an operating system replacement on the hard disk, the MCU can implement an endpoint to the corresponding device by sending a power control signal, so that the system start-up can be disabled. In the preferred embodiment, the computer includes, but is not limited to, desktop computers, notebook computers, tablet computers, and car computers.
Those skilled in the art will appreciate that the hardware and/or software modules involved in the computer trusted starting method of the present invention are implemented based on the existing computer platform, especially the existing domestic computer platform, and the MCU is used in combination with the system firmware to implement the trusted starting, so as to implement a low-cost trusted starting scheme.
Referring to fig. 2 and 3, the computer trusted boot method of the present invention can be further understood by referring to fig. 1, wherein fig. 2 is a flowchart of the computer trusted boot method of the present invention, and fig. 3 is a flowchart of a preferred embodiment of the computer trusted boot method of the present invention. The method mainly comprises the following steps:
Step 10, starting the computer, wherein an MCU on a computer main board prohibits a CPU from accessing system firmware in a ROM (read only memory), the MCU verifies the content of the system firmware in the ROM, if the system firmware is not tampered, the authentication is passed, the MCU allows the CPU to access the system firmware in the ROM, the CPU executes a system firmware code in the ROM to continue starting, otherwise, the starting is prohibited;
In the preferred implementation, specifically, before the computer is started, the MCU takes over the signal of the SPI bus of the FLASH storing the system firmware through the channel selector, reads the content of the system firmware and checks, and after the check value is correct, the CPU is controlled to be electrified through the main board power supply control logic module and the signal on the SPI bus is released to the CPU through the channel selector. The CPU starts to execute the system firmware codes stored in the FLASH to start after the system firmware codes are started continuously. By checking the content of the system firmware in the ROM, the information security and other problems caused by the tampering of the system firmware can be avoided.
Step 20, starting running and initializing a memory by the system firmware, and sending a secret word and memory information to the MCU, starting a first watchdog of the MCU, waiting for the secret word and memory information sent by the system firmware, and if the MCU does not receive a correct secret word within a set time, starting the MCU is forbidden to overtime, if the first watchdog does not overtime, and the MCU receives the correct secret word and memory information, starting the MCU continuously, otherwise starting the MCU is forbidden;
in this preferred implementation, specifically, the system firmware starts running and initializes the memory, and the system firmware sends the dark language plus the memory information to the MCU. At this time, the first watchdog of the MCU is started, and the MCU waits for receiving the whisper and the memory information sent by the system firmware. If the correct whisper is not received within the prescribed time, the first watchdog times out and prohibits starting. If the MCU receives the correct whisper and memory information, the first watchdog is closed, and the system firmware is allowed to continue to run for starting. By checking the memory information, information security and other problems caused by memory change can be avoided.
Step 30, the system firmware checks the equipment information on the main board and sends the darkness and the equipment information to the MCU, and starts a second watchdog of the MCU to wait for the darkness and the equipment information sent by the system firmware, if the MCU does not receive the correct darkness within a set time, the second watchdog overturns, the starting is forbidden, if the second watchdog does not overtime, and the MCU receives the correct darkness and the equipment information, the second watchdog is closed, the starting is continued, and otherwise the starting is forbidden;
In this preferred embodiment, specifically, the system firmware continues to run to boot up and verify other critical information on the motherboard, i.e., device information, including but not limited to device list, optionROM (option ROM) information, hard disk SN (serial number), and send the whisper and device information to the MCU. Specifically, the device information may be a hash value of the device information, and the comparison speed may be increased during the comparison. At this time, the second watchdog of the MCU is turned on, waiting for the whisper and the device hash value sent by the system firmware. If the correct whisper is not received within the prescribed time, the second watchdog times out and prohibits the continuous start. If the MCU receives the correct hash value of the whisper and the device information, the second watchdog is closed, and the system firmware is allowed to continue to run for starting. By checking the device information, information security and other problems caused by the change of the device on the main board can be avoided.
And step 40, the system firmware checks the system file information on the hard disk and sends the dark language and the system file information to the MCU, and starts a third watchdog of the MCU to wait for the dark language and the system file information sent by the system firmware, if the MCU does not receive the correct dark language within a set time, the third watchdog overturns to prohibit starting, and if the third watchdog does not overtime and the MCU receives the correct dark language and the system file information, the third watchdog is closed, the trusted verification is passed, and the operating system is started.
In this preferred implementation, specifically, the system firmware continues to run to start, and starts to verify the system file information on the hard disk, where the system file information may specifically be a hash value of the system file information, so that the verification speed may be increased, and then sends the hash values of the system file information and the whistle to the MCU. At this time, the third watchdog of the MCU is started to wait for the hash value of the system file and the whisper sent by the system firmware. If the correct whisper is not received within the prescribed time, the third watchdog times out and prohibits the continuous start. If the MCU receives the correct hash value of the whisper and the system file information, the third watchdog is closed, and the system firmware is allowed to continue to run for starting.
Further, the computer trusted boot method of the preferred embodiment may further include:
And 12, after the CPU executes the system firmware codes in the ROM to continue starting up in the step 10, judging whether the starting up is the first time, if so, collecting the equipment information on the main board and the information of the system files on the hard disk and sending the information to the MCU through a secret word to serve as original reference data.
Through this step, when the system firmware performs the boot for the first time, the system firmware will transfer the original memory information, the device hash value, the system file hash value, etc. to the MCU. The values can be stored in the MCU, the original data can not be obtained by the outside, and the MCU is only allowed to use when the information verification is carried out.
Further, the computer trusted boot method of the preferred embodiment may further include:
And 14, judging whether the system firmware needs to be updated when the first power-on is judged in the step 12, if so, updating the system firmware, informing the MCU to recalculate the check value of the system firmware content in the ROM, and if not, turning to the step 20. Through the step, the computer trusted starting method can support the updating of the system firmware at the same time.
In summary, the computer trusted starting method of the invention can realize a low-cost trusted starting scheme.
In the above, it is obvious to those skilled in the art that various other corresponding changes and modifications can be made according to the technical scheme and the technical idea of the present invention, and all such changes and modifications are intended to fall within the scope of the appended claims.