Method for outputting power-on self test information, virtual machine manager, and processor
The present disclosure provides a method for outputting power-on self test information, a virtual machine manager, and a processor. The method includes: receiving trigger information generated by a BIOS program when the BIOS program runs a predefined virtual mode trigger instruction, starting, by a virtual machine manager, the virtual machine manager and monitoring a processor, where the processor is a processor that enters a virtual mode after receiving the trigger information of the BIOS program; when detecting that the processor generates an exit instruction, obtaining power-on self test information after the BIOS program performs a power-on self test operation, and outputting the power-on self test information to a serial port. Power-on self test information may be output without using a motherboard diagnostic card, so that device resources are saved. In addition, the operation is simple, and no human control operation is required.
1. A method for outputting power-on self test information, comprising:
receiving trigger information generated by a basic input output system (BIOS) program when the BIOS program runs a predefined virtual mode trigger instruction;
starting, by a virtual machine manager, the virtual machine manager, and monitoring a processor, wherein the trigger information triggers the processor to enter a virtual mode;
when detecting that the processor generates an exit instruction, obtaining power-on self test information after the BIOS program performs a power-on self test operation, wherein the exit instruction is generated after the processor determines that the power-on self test operation performed by the BIOS program meets a predefined trigger event; and
outputting the power-on self test information to a serial port.
2. The method according to claim 1 , wherein outputting the power-on self test information to a serial port comprises:
converting the power-on self test information into serial port data, and outputting the serial port data to the serial port.
3. The method according to claim 2 , wherein outputting the power-on self test information to a serial port comprises:
converting the power-on self test information into serial port data, and setting a predefined identifier for the serial port data; and
outputting the serial port data with the set predefined identifier to the serial port.
4. The method according to claim 1 , wherein: the exit instruction is generated after the processor entering the virtual mode determines that the power-on self test operation performed by the BIOS program meets the predefined trigger event when the processor determines that the BIOS program writes the power-on self test information to port 80 ; and
obtaining the power-on self test information after the BIOS program performs a power-on self test operation comprises:
obtaining the power-on self test information from port 80 .
5. The method according to claim 1 , wherein the power-on self test information output to the serial port is obtained and displayed by a serial port terminal.
6. A method for outputting power-on self test information, comprising:
after receiving trigger information generated by a basic input output system (BIOS) program when the BIOS program runs a predefined virtual mode trigger instruction, entering, by a processor, a virtual mode;
determining, by the processor, whether a power-on self test operation performed by the BIOS program meets a predefined trigger event; and
if so, generating an exit instruction, wherein the exit instruction is used to instruct a virtual machine manager to obtain power-on self test information and output the power-on self test information to a serial port.
7. The method according to claim 6 , wherein the processor determines, in the following way, whether the power-on self test operation performed by the BIOS program meets the predefined trigger event:
the processor determines that the power-on self test operation performed by the BIOS program meets the predefined trigger event when the processor determines that the BIOS program writes the power-on self test information to port 80 .
8. The method according to claim 6 , wherein the trigger instruction is used to instruct the virtual machine manager to obtain the power-on self test information, convert the power-on self test information into serial port data, and output the serial port data to the serial port.
9. A virtual machine manager, comprising:
a starting module, configured to start the virtual machine manager when receiving trigger information generated by a basic input output system (BIOS) program when the BIOS program runs a predefined virtual mode trigger instruction;
a monitoring module, configured to monitor whether a processor entering a virtual mode generates an exit instruction, wherein the exit instruction is generated when the processor determines that a power-on self test operation performed by the BIOS program meets a predefined trigger event;
an obtaining module, configured to: when a monitoring result of the monitoring module is yes, obtain power-on self test information after the BIOS program performs the power-on self test operation; and
an outputting module, configured to output the power-on self test information to a serial port.
10. The virtual machine manager according to claim 9 , further comprising:
a converting module, configured to convert the power-on self test information into serial port data; wherein
the outputting module is configured to output the serial port data to the serial port.
11. The virtual machine manager according to claim 10 , further comprising:
a setting module, configured to set a predefined identifier for the serial port data; wherein
the outputting module is configured to output the serial port data with the set predefined identifier to the serial port.
12. A processor, comprising:
a virtual mode starting module, configured to start a virtual mode when receiving trigger information generated by a basic input output system (BIOS) program when the BIOS program runs a predefined virtual mode trigger instruction;
a determining module, configured to determine whether a power-on self test operation performed by the BIOS program meets a predefined trigger event; and
an instruction generating module, configured to generate an exit instruction if a judgment result of the determining module is yes, wherein the exit instruction is used to instruct a virtual machine manager to obtain power-on self test information and output the power-on self test information to a serial port.
13. The processor according to claim 12 wherein the determining module is configured to determine whether the BIOS program writes power-on self test information to port 80 .