Windows virtual machine starting acceleration method and device, computer equipment and storage medium

By using the option ROM mechanism to generate boot firmware during the startup process of Windows virtual machine, and directly loading BOOTMGR into memory startup, the problem of cumbersome virtual machine startup process is solved, and significant startup speed improvement and system stability enhancement is achieved.

CN119902858AInactive Publication Date: 2025-04-29CHINA TELECOM CLOUD TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510389488.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-31
Publication Date
2025-04-29
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The startup process of Windows virtual machines is complicated during startup, resulting in slow startup speed.

Method used

By compiling and generating startup firmware using the option ROM mechanism, the virtual machine monitor QEMU is initialized during the startup process of the Windows virtual machine, the relevant data of the boot manager file boot manager is read, and the startup firmware is loaded through the basic input and output system SeaBIOS, and the BOOTMGR is directly loaded to memory startup, skipping the intermediate link.

Benefits of technology

It significantly shortens the startup path, improves the startup speed, simplifies the startup process, reduces the probability of errors, and enhances system stability and resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119902858A_ABST
    Figure CN119902858A_ABST
Patent Text Reader

Abstract

The invention relates to a Windows virtual machine starting acceleration method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the steps that in the starting process of the Windows virtual machine, starting firmware is compiled and generated through an option ROM mechanism; the method comprises the steps that a virtual machine monitor QEMU is initialized, a boot manager file is read through the virtual machine monitor QEMU, related data of the boot manager file are obtained, and the related data comprise a memory loading address and file content; loading the startup firmware through a basic input and output system (SeaBIOS); using the virtual machine monitor QEMU to store the file content in a target memory area corresponding to the memory loading address; and loading the file content of a boot manager file in the target memory area by utilizing the boot firmware. By the adoption of the method, when the Windows virtual machine is started, the starting process can be simplified, and the starting speed can be increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of virtual machine technology, and in particular to a Windows virtual machine startup acceleration method, device, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] With the rapid development of cloud computing and virtualization technology, the startup speed and operating efficiency of virtual machines have become one of the important indicators for measuring the performance of virtualization platforms. In the field of virtualization, KVM (Kernel-based Virtual Machine), as an open source hardware-assisted virtualization solution, is widely used in server virtualization scenarios due to its high performance and stability. QEMU (Quick Emulator), as a virtual machine monitor software system of KVM, can cooperate with KVM to achieve efficient hardware-assisted virtualization.

[0003] During the boot process of a Linux virtual machine in a Windows system, the boot method is mainly to load the MBR (Master Boot Record) of the disk through the open source BIOS (Basic Input Output System), and then MBR loads VBR (Volume Boot Record) and other step-by-step chain loading to boot. This boot process is more complicated and results in a slower boot speed.

[0004] Therefore, there is an urgent need for a Windows virtual machine startup acceleration method, device, computer equipment, computer readable storage medium and computer program product that can simplify the startup process and increase the startup speed when starting a Windows virtual machine. Summary of the invention

[0005] Based on this, it is necessary to provide a Windows virtual machine startup acceleration method, device, computer equipment, computer-readable storage medium and computer program product that can simplify the startup process and improve the startup speed when starting a Windows virtual machine in response to the above technical problems.

[0006] In a first aspect, the present application provides a Windows virtual machine startup acceleration method, comprising:

[0007] During the startup process of the Windows virtual machine, the option ROM mechanism is used to compile and generate the startup firmware;

[0008] Initialize the virtual machine monitor QEMU, and use the virtual machine monitor QEMU to read the boot manager file boot manager to obtain relevant data of the boot manager file boot manager, wherein the relevant data includes a memory loading address and file content;

[0009] Loading the boot firmware via the basic input and output system SeaBIOS;

[0010] Using the virtual machine monitor QEMU, storing the file content in a target memory area corresponding to the memory load address;

[0011] The boot firmware is used to load the file content of the boot manager file in the target memory area.

[0012] In one embodiment, the relevant data also includes the memory occupied by the file; before storing the file content into the target memory area corresponding to the memory loading address, the steps include:

[0013] The size of the memory occupied by the file is used as a matching condition to obtain the target memory area.

[0014] In one embodiment, after storing the file content in the target memory area corresponding to the memory loading address, the method further includes:

[0015] Using the virtual machine monitor QEMU to send the memory load address to the startup firmware;

[0016] The step of using the boot firmware to load the file content of the boot manager file in the target memory area includes:

[0017] The boot firmware is used to load the file content of the boot manager file in the target memory area according to the memory loading address.

[0018] In one embodiment, after storing the file content in the target memory area corresponding to the memory loading address, the method further includes:

[0019] Resetting the general registers and segment registers related to the boot firmware;

[0020] Get the configuration data of Windows virtual machine;

[0021] According to the configuration data of the Windows virtual machine, initial values ​​are set for the general register and the segment register.

[0022] In one embodiment, the sending the memory load address to the boot firmware using the virtual machine monitor QEMU includes:

[0023] When the startup firmware is running, the virtual machine monitor QEMU is controlled to send the memory loading address to the startup firmware through the firmware configuration interface fw_cfg.

[0024] In one embodiment, the file content includes the running code of the boot manager; and loading the file content of the boot manager file boot manager in the target memory area according to the memory loading address includes:

[0025] By executing the ljmp jump instruction or the lret jump instruction, the target memory area is jumped to according to the memory loading address, and the running code of the boot manager file boot manager in the target memory area is loaded.

[0026] In a second aspect, the present application also provides a Windows virtual machine startup acceleration device, comprising:

[0027] The firmware compilation module is used to compile and generate the boot firmware using the option ROM mechanism during the startup process of the Windows virtual machine;

[0028] Initialization module, used to initialize the virtual machine monitor QEMU;

[0029] A data loading module is used to read the boot manager file bootmanager by using the virtual machine monitor QEMU to obtain relevant data of the boot manager file boot manager, wherein the relevant data includes a memory loading address and file content;

[0030] A firmware loading module, used for loading the startup firmware via a basic input and output system SeaBIOS;

[0031] A data storage module, used to store the file content into a target memory area corresponding to the memory load address by using the virtual machine monitor QEMU;

[0032] The startup module is used to use the startup firmware to load the file content of the boot manager file in the target memory area.

[0033] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0034] During the startup process of the Windows virtual machine, the option ROM mechanism is used to compile and generate the startup firmware;

[0035] Initialize the virtual machine monitor QEMU, and use the virtual machine monitor QEMU to read the boot manager file boot manager to obtain relevant data of the boot manager file boot manager, wherein the relevant data includes a memory loading address and file content;

[0036] Loading the boot firmware via the basic input and output system SeaBIOS;

[0037] Using the virtual machine monitor QEMU, storing the file content in a target memory area corresponding to the memory load address;

[0038] The boot firmware is used to load the file content of the boot manager file in the target memory area.

[0039] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0040] During the startup process of the Windows virtual machine, the option ROM mechanism is used to compile and generate the startup firmware;

[0041] Initialize the virtual machine monitor QEMU, and use the virtual machine monitor QEMU to read the boot manager file boot manager to obtain relevant data of the boot manager file boot manager, wherein the relevant data includes a memory loading address and file content;

[0042] Loading the boot firmware via the basic input and output system SeaBIOS;

[0043] Using the virtual machine monitor QEMU, storing the file content in a target memory area corresponding to the memory load address;

[0044] The boot firmware is used to load the file content of the boot manager file in the target memory area.

[0045] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0046] During the startup process of the Windows virtual machine, the option ROM mechanism is used to compile and generate the startup firmware;

[0047] Initialize the virtual machine monitor QEMU, and use the virtual machine monitor QEMU to read the boot manager file boot manager to obtain relevant data of the boot manager file boot manager, wherein the relevant data includes a memory loading address and file content;

[0048] Loading the boot firmware via the basic input and output system SeaBIOS;

[0049] Using the virtual machine monitor QEMU, storing the file content in a target memory area corresponding to the memory load address;

[0050] The boot firmware is used to load the file content of the boot manager file in the target memory area.

[0051] The above-mentioned Windows virtual machine startup acceleration method, device, computer equipment, computer-readable storage medium and computer program product achieve significant technical effects by simplifying the startup process of the Windows virtual machine. The traditional startup method requires SeaBIOS to load MBR, VBR and other step-by-step chain boots, which is cumbersome and time-consuming. The present invention uses BIOS optionrom to directly load BOOTMGR to the memory to start, skipping the intermediate links, greatly shortening the startup path, and significantly improving the startup speed, meeting the needs of fast startup of virtual machines in cloud computing and virtualization scenarios, and optimizing the performance of the virtualization platform. Simplifying the startup process also reduces the number of startup links and components, reduces the probability of errors, enhances system stability, reduces startup failures or abnormal situations, and improves the reliability and availability of the virtualization platform. At the same time, it reduces the system resource usage during the startup process, makes resources more efficiently allocated and utilized, quickly releases resources, and improves resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0053] Figure 1 This is an application environment diagram of the Windows virtual machine startup acceleration method in the traditional technology;

[0054] Figure 2 A flowchart of a Windows virtual machine startup acceleration method in one embodiment;

[0055] Figure 3A schematic diagram of the overall process of a Windows virtual machine startup acceleration method in one embodiment;

[0056] Figure 4 A flowchart of a Windows virtual machine startup acceleration method in another embodiment;

[0057] Figure 5 A structural block diagram of a Windows virtual machine startup acceleration device in one embodiment;

[0058] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0059] With the rapid development of cloud computing and virtualization technology, the startup speed and operating efficiency of virtual machines have become one of the important indicators for measuring the performance of virtualization platforms. In the field of virtualization, KVM (Kernel-based Virtual Machine), as an open source hardware-assisted virtualization solution, is widely used in server virtualization scenarios due to its high performance and stability. QEMU (Quick Emulator), as a virtual machine monitor software system of KVM, can cooperate with KVM to achieve efficient hardware-assisted virtualization.

[0060] In the process of starting a Windows virtual machine based on KVM, the traditional way of starting is to load the MBR (Master Boot Record) of the disk through an open source BIOS (such as SeaBIOS), and then MBR loads VBR (Volume Boot Record), and finally boots the Windows operating system. This process involves multiple steps, including SeaBIOS initialization, loading MBR, MBR loading VBR, etc., a step-by-step chain boot process, which is cumbersome and leads to a slow startup speed.

[0061] like Figure 1 As shown in the figure, the traditional Windows virtual machine startup process needs to go through the complete Legacy BIOS boot process, starting with SeaBIOS loading the MBR, loading the VBR level by level, and finally starting the Windows Boot Manager (BOOTMGR). This process is not only time-consuming, but also involves the interaction of multiple links, increasing the risk of startup failure.

[0062] In order to solve the above technical problems, the present application is further described in detail in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0063] In an exemplary embodiment, Figure 2 and Figure 3 As shown, a Windows virtual machine startup acceleration method is provided, and the method is applied to Figure 1 The server in the example is used to illustrate, including the following steps S202 to S210. Among them:

[0064] Step S202: during the startup process of the Windows virtual machine, the startup firmware is compiled and generated using the option ROM mechanism.

[0065] Specifically, Option ROM (Optional Read-Only Memory) is a mechanism used to load specific hardware or software during the computer startup process. It is usually stored in the firmware of hardware devices, such as graphics cards, network cards, etc., and is used to initialize these devices during the BIOS startup phase. Option ROM can also be used to load custom boot programs. In a virtualized environment, the Option ROM mechanism can be used to load custom boot firmware to optimize the boot process. In order to achieve fast startup of Windows virtual machines, it is necessary to develop a custom boot firmware (such as winboot.bin). The main function of this firmware is to load and start Windows' BOOTMGR from Option ROM instead of through the traditional BIOS boot process (such as loading MBR and VBR).

[0066] Step S204, initializing the virtual machine monitor QEMU, and using the virtual machine monitor QEMU to read the boot manager file boot manager, and obtaining relevant data of the boot manager file boot manager, the relevant data including the memory loading address and file content.

[0067] Specifically, QEMU (Quick Emulator) is an open source virtual machine monitor (Hypervisor) that simulates computer hardware, allowing multiple operating systems (virtual machines) to run on a single physical machine. In a KVM (Kernel-based Virtual Machine) environment, QEMU works with KVM to provide efficient hardware-assisted virtualization.

[0068] In a Windows virtual machine, bootmgr is the boot manager file that is responsible for booting the operating system. Before the virtual machine starts, make sure that the bootmgr file exists in the virtual machine's boot media (such as a virtual hard disk or ISO file). For example, in the Windows installation media, the bootmgr file is usually located in the root directory. During the virtual machine startup process, QEMU needs to read the bootmgr file and load it into the virtual machine's memory so that the boot manager can execute; specifically, QEMU will load the specified boot media according to the boot sequence. If the boot sequence includes a hard disk, QEMU will read the bootmgr file from the virtual hard disk. QEMU reads the contents of the bootmgr file into memory by simulating hardware devices (such as a hard disk controller).

[0069] Step S206, loading the boot firmware via the basic input and output system SeaBIOS.

[0070] Specifically, SeaBIOS is an open source BIOS implementation that is widely used in KVM virtualization environments. It provides a set of standardized interfaces and functions for initializing hardware devices and guiding the operating system to start. SeaBIOS is implemented based on traditional BIOS specifications and is compatible with most x86-based operating systems. During the virtual machine startup process, SeaBIOS is responsible for initializing hardware devices and guiding the loading and execution of the startup firmware.

[0071] First, when the virtual machine starts, QEMU (virtual machine monitor) initializes the virtual hardware environment and hands control to SeaBIOS. SeaBIOS starts to execute its initialization program, including detecting and initializing hardware devices (such as CPU, memory, hard disk, etc.). SeaBIOS scans and loads the Option ROM in the virtual machine. In a virtualized environment, Option ROM can be specified by the -option-rom parameter of QEMU. After SeaBIOS detects the boot firmware (such as winboot.bin), it loads it into memory and starts execution.

[0072] Step S208, using the virtual machine monitor QEMU, storing the file content into the target memory area corresponding to the memory load address.

[0073] Specifically, the memory load address refers to the specific location in the virtual machine's memory space where a file or program is loaded. For example, the bootmgr file may be loaded at the memory load address 0x20000. This memory load address is predefined and is usually specified by the boot firmware (such as winboot.bin) or the virtual machine configuration file. During the virtual machine startup process, QEMU needs to read the content of a specific file (such as the boot manager file bootmgr) from the storage medium (such as a virtual hard disk or ISO file) and store it in the target memory area corresponding to the specified memory load address.

[0074] Step S210, using the boot firmware, loading the file content of the boot manager file in the target memory area.

[0075] Specifically, the target memory area refers to the specific location in the virtual machine's memory space where the boot manager file (such as bootmgr) is stored. This address is usually pre-defined, such as 0x20000. The boot firmware needs to read the content of the bootmgr file from this address. When the virtual machine starts, the virtual machine monitor (such as QEMU) initializes the virtual hardware environment and passes control to the boot firmware (such as winboot.bin). The boot firmware begins execution and initializes the necessary hardware and software environment.

[0076] The boot firmware obtains the relevant information of the boot manager file (such as bootmgr) through the interface with the virtual machine monitor (such as QEMU), including the file content and memory loading address. For example, QEMU reads the content of the bootmgr file from the virtual hard disk (such as windows.img) and passes it to the boot firmware through the interface.

[0077] After receiving the contents of the bootmgr file, the boot firmware stores it in the target memory area (such as 0x20000). The boot firmware uses low-level memory operation instructions (such as mov or repmovsb) to copy the file contents from the temporary buffer provided by QEMU to the target memory address. The boot firmware reads the contents of the bootmgr file from the target memory area (such as 0x20000).

[0078] The boot firmware sets the necessary register initial values ​​to ensure that the boot manager can run normally. For example: dx=0x80: indicates that the boot device is a hard disk. esp=0x7c00: sets the stack pointer. The initial values ​​of these registers are necessary for the boot manager (such as bootmgr) to run normally. The boot firmware jumps to the entry address of bootmgr (such as 0x2000:0x0) and starts executing bootmgr. Bootmgr continues to guide the startup of the Windows operating system.

[0079] In the above-mentioned Windows virtual machine startup acceleration method, significant technical effects are achieved by simplifying the startup process of the Windows virtual machine. The traditional startup method requires SeaBIOS to load MBR, VBR and other step-by-step chain boots, which is cumbersome and time-consuming. The present invention uses BIOS optionrom to directly load BOOTMGR to memory startup, skipping the intermediate links, greatly shortening the startup path, and significantly improving the startup speed, meeting the needs of fast startup of virtual machines in cloud computing and virtualization scenarios, and optimizing the performance of the virtualization platform. Simplifying the startup process also reduces the number of startup links and components, reduces the probability of errors, enhances system stability, reduces startup failures or abnormal situations, and improves the reliability and availability of the virtualization platform. At the same time, it reduces the system resource usage during the startup process, makes resources more efficiently allocated and utilized, quickly releases resources, and improves resource utilization.

[0080] In an exemplary embodiment, the relevant data also includes the memory occupied by the file; before storing the file content into the target memory area corresponding to the memory load address, it includes:

[0081] The size of the memory occupied by the file is used as a matching condition to match the target memory area.

[0082] Specifically, before storing the file content in the target memory area, the boot firmware needs to determine whether the target memory area is large enough to accommodate the file content. This step includes:

[0083] The boot firmware obtains the memory size occupied by the file from the virtual machine monitor (such as QEMU). The boot firmware checks whether the target memory area is large enough based on the file size to ensure that the file content can be completely stored in the area. If the target memory area is large enough, the boot firmware continues to the next step; if the target memory area is insufficient, the boot firmware may need to reselect a larger memory area or report an error.

[0084] After confirming that the target memory area is large enough, the boot firmware stores the file content in the target memory area. In specific implementation, the boot firmware uses low-level memory operation instructions (such as mov or rep movsb) to copy the file content from the temporary buffer provided by QEMU to the target memory address.

[0085] In this embodiment, during the virtual machine startup process, the boot firmware (such as winboot.bin) needs to obtain relevant information of the boot manager file (such as bootmgr) from the virtual machine monitor (such as QEMU), including the file content, memory loading address, and the memory size occupied by the file. Before storing the file content in the target memory area, the boot firmware checks whether the target memory area has enough space based on the memory size occupied by the file. This process ensures that the file content can be stored completely in the target memory area, thereby optimizing the virtual machine startup process and improving the startup efficiency.

[0086] In an exemplary embodiment, after storing the file content in the target memory area corresponding to the memory load address, the method further includes:

[0087] Use the virtual machine monitor QEMU to send the memory load address to the boot firmware;

[0088] Use the boot firmware to load the boot manager file in the target memory area, including:

[0089] Using the boot firmware, the file content of the boot manager file bootmanager in the target memory area is loaded according to the memory loading address.

[0090] Specifically, QEMU sends the memory loading address (such as 0x20000) to the boot firmware (such as winboot.bin) through the interface. The boot firmware (such as winboot.bin) receives the memory loading address (such as 0x20000) sent by QEMU through the interface. The boot firmware reads the content of the boot manager file (such as bootmgr) from the target memory area (such as 0x20000) according to the received memory loading address; the boot firmware sets the necessary register initial values ​​and jumps to the entry address of the boot manager (such as 0x2000:0x0) to start executing the boot manager.

[0091] In this embodiment, by starting the firmware, the file content of the boot manager file boot manager in the target memory area is loaded according to the memory loading address, ensuring that the boot manager file (such as bootmgr) can be correctly loaded and executed, thereby optimizing the startup process of the virtual machine and improving the startup efficiency.

[0092] In an exemplary embodiment, Figure 4 As shown, after the file content is stored in the target memory area corresponding to the memory load address, it also includes:

[0093] Step S402, resetting the general registers and segment registers related to the boot firmware;

[0094] Step S404, obtaining configuration data of the Windows virtual machine;

[0095] Step S406, setting initial values ​​for general registers and segment registers according to the configuration data of the Windows virtual machine.

[0096] Specifically, reset general registers: the startup firmware resets general registers (such as eax, ebx, ecx, edx, esi, edi, esp, ebp, etc.) and sets their values ​​to initial values ​​(usually 0).

[0097] Reset segment registers: The startup firmware resets the segment registers (such as cs, ds, es, fs, gs, ss, etc.) and sets their values ​​to the initial values ​​(usually 0 or a specific segment address).

[0098] The boot firmware obtains the configuration data of the Windows virtual machine from QEMU through the interface. These configuration data may include: the memory size of the virtual machine; the number of CPUs of the virtual machine; the boot device information of the virtual machine; and other information related to the virtual machine's operating environment.

[0099] Based on the configuration data obtained, the boot firmware sets initial values ​​for general registers. For example, esp (stack pointer) may be set to a specific memory address, such as 0x7c00. Registers such as eax and ebx may be set to specific values ​​to meet the boot requirements of the boot manager (such as bootmgr).

[0100] And, based on the configuration data obtained, the boot firmware sets initial values ​​for the segment registers. For example, cs (code segment register) may be set to 0x2000. Data segment registers such as ds and es may be set to 0x0000 or other specific values.

[0101] And, depending on the configuration data, the boot firmware may also need to set the initial values ​​of other registers (such as eflags, cr0, etc.).

[0102] In this embodiment, by resetting the registers through the startup firmware, obtaining the configuration data of the Windows virtual machine, and setting the initial value of the registers according to the configuration data, the reliability, performance and compatibility of the virtual machine startup can be significantly improved; not only the startup process is optimized and the startup time is reduced, but also the adaptability of the virtual machine in different configuration environments is enhanced, and debugging and maintenance work is simplified.

[0103] In an exemplary embodiment, the memory load address is sent to the boot firmware using the virtual machine monitor QEMU, including:

[0104] When the boot firmware is running, the virtual machine monitor QEMU is controlled through the firmware configuration interface fw_cfg to send the memory loading address to the boot firmware.

[0105] Specifically, fw_cfg is an interface for passing configuration data and file contents during the virtual machine boot process. It allows communication between the boot firmware and QEMU. The fw_cfg interface passes data through a special device (such as port 0x510) or a memory mapped area. The boot firmware can obtain data by reading these ports or memory areas. The data passed by the fw_cfg interface usually includes key-value pairs, where the key is the identifier of the configuration item and the value is the specific configuration data. The memory load address can be passed as a configuration item through the fw_cfg interface.

[0106] The boot firmware sends a request to QEMU through the fw_cfg interface, requesting specific configuration data (such as the memory load address). After QEMU receives the request, it sends the memory load address to the boot firmware through the fw_cfg interface. The boot firmware receives the data sent by QEMU through the fw_cfg interface and stores it.

[0107] In this embodiment, during the virtual machine startup process, QEMU sends the memory loading address to the startup firmware (such as winboot.bin) through the fw_cfg interface. This process ensures that the startup firmware can correctly load the content of the boot manager file (such as bootmgr) from the target memory area and continue to guide the startup process. The fw_cfg interface provides an efficient and reliable way to enable the necessary communication between the startup firmware and the virtual machine monitor, thereby optimizing the startup process of the virtual machine and improving the startup efficiency.

[0108] In an exemplary embodiment, the file content includes the running code of the boot manager; according to the memory loading address, the file content of the boot manager file boot manager in the target memory area is loaded, including:

[0109] By executing the ljmp jump instruction or the lret jump instruction, the target memory area is jumped to according to the memory load address, and the running code of the boot manager file boot manager in the target memory area is loaded.

[0110] Specifically, ljmp instruction: long jump instruction, the format is ljmp <segment> : <offset>, used to jump to the specified code segment and offset address. lret instruction: long return instruction, usually used to return from an interrupt or call, can also be used to jump to the specified code segment and offset address.

[0111] The boot firmware jumps to the target memory area (such as 0x2000:0x0000) by executing the ljmp (long jump) or lret (long return) instruction. The CPU starts to execute the code in the target memory area, that is, the running code of the boot manager file (such as bootmgr). The boot manager file (such as bootmgr) continues to guide the startup of the Windows operating system.

[0112] In this embodiment, the ljmp instruction is used for inter-segment jumps, clearly specifies the target code segment and offset address, and is suitable for initializing a new environment and clear control flow management. The lret instruction is used to return from an interrupt or call, restore the execution environment before the call, and implement flexible control flow management through stack operations. Compared with other instructions, the ljmp and lret instructions have unique advantages in inter-segment jumps and stack management, making them very suitable in the virtual machine startup process.

[0113] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0114] Based on the same inventive concept, the embodiment of the present application also provides a Windows virtual machine startup acceleration device for implementing the Windows virtual machine startup acceleration method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more Windows virtual machine startup acceleration device embodiments provided below can refer to the limitations of the Windows virtual machine startup acceleration method above, and will not be repeated here.

[0115] In an exemplary embodiment, Figure 5 As shown, a Windows virtual machine startup acceleration device is provided, comprising:

[0116] The firmware compiling module 502 is used to compile and generate the startup firmware by using the option ROM mechanism during the startup process of the Windows virtual machine;

[0117] Initialization module 504, used to initialize the virtual machine monitor QEMU;

[0118] The data loading module 506 is used to read the boot manager file bootmanager by using the virtual machine monitor QEMU to obtain the relevant data of the boot manager file boot manager, the relevant data including the memory loading address and the file content;

[0119] The firmware loading module 508 is used to load the startup firmware through the basic input and output system SeaBIOS;

[0120] The data storage module 510 is used to store the file content into the target memory area corresponding to the memory load address by using the virtual machine monitor QEMU;

[0121] The startup module 512 is used to load the file content of the boot manager file bootmanager in the target memory area by using the startup firmware.

[0122] In an exemplary embodiment, the data storage module 510 is further configured to use the size of the memory occupied by the file as a matching condition to obtain the target memory area through matching.

[0123] In an exemplary embodiment, the relevant data also includes the memory occupied by the file; the data loading module 506 is specifically used to use the virtual machine monitor QEMU to send the memory loading address to the boot firmware; and use the boot firmware to load the file content of the boot manager file boot manager in the target memory area according to the memory loading address.

[0124] In an exemplary embodiment, the initialization module 504 is further used to reset the general registers and segment registers related to the startup firmware; obtain the configuration data of the Windows virtual machine; and set initial values ​​for the general registers and segment registers according to the configuration data of the Windows virtual machine.

[0125] In an exemplary embodiment, the startup module 512 is further configured to control the virtual machine monitor QEMU to send the memory loading address to the startup firmware through the firmware configuration interface fw_cfg when the startup firmware is running.

[0126] In an exemplary embodiment, the file content includes the running code of the boot manager; the startup module 512 is also used to jump to the target memory area according to the memory load address by executing the ljmp jump instruction or the lret jump instruction, and load the running code of the boot manager file boot manager in the target memory area.

[0127] Each module in the above Windows virtual machine startup acceleration device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0128] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store relevant data of the boot manager file bootmanager. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a Windows virtual machine startup acceleration method is implemented.

[0129] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0130] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0131] During the startup process of the Windows virtual machine, the option ROM mechanism is used to compile and generate the startup firmware;

[0132] Initialize the virtual machine monitor QEMU, and use the virtual machine monitor QEMU to read the boot manager file bootmanager to obtain relevant data of the boot manager file boot manager, including the memory loading address and file content;

[0133] Load the boot firmware through the basic input and output system SeaBIOS;

[0134] Using the virtual machine monitor QEMU, the file content is stored in the target memory area corresponding to the memory load address;

[0135] Use the boot firmware to load the file content of the boot manager file in the target memory area.

[0136] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0137] The size of the memory occupied by the file is used as a matching condition to match the target memory area.

[0138] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0139] Use the virtual machine monitor QEMU to send the memory load address to the boot firmware;

[0140] Using the boot firmware, the file content of the boot manager file bootmanager in the target memory area is loaded according to the memory loading address.

[0141] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0142] Reset the general registers and segment registers related to the startup firmware;

[0143] Get the configuration data of Windows virtual machine;

[0144] Set initial values ​​for general registers and segment registers according to the configuration data of the Windows virtual machine.

[0145] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0146] When the boot firmware is running, the virtual machine monitor QEMU is controlled through the firmware configuration interface fw_cfg to send the memory loading address to the boot firmware.

[0147] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0148] The file content includes the running code of the boot manager;

[0149] By executing the ljmp jump instruction or the lret jump instruction, the target memory area is jumped to according to the memory load address, and the running code of the boot manager file boot manager in the target memory area is loaded.

[0150] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0151] During the startup process of the Windows virtual machine, the option ROM mechanism is used to compile and generate the startup firmware;

[0152] Initialize the virtual machine monitor QEMU, and use the virtual machine monitor QEMU to read the boot manager file bootmanager to obtain relevant data of the boot manager file boot manager, including the memory loading address and file content;

[0153] Load the boot firmware through the basic input and output system SeaBIOS;

[0154] Using the virtual machine monitor QEMU, the file content is stored in the target memory area corresponding to the memory load address;

[0155] Use the boot firmware to load the file content of the boot manager file in the target memory area.

[0156] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0157] The size of the memory occupied by the file is used as a matching condition to match the target memory area.

[0158] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0159] Use the virtual machine monitor QEMU to send the memory load address to the boot firmware;

[0160] Using the boot firmware, the file content of the boot manager file bootmanager in the target memory area is loaded according to the memory loading address.

[0161] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0162] Reset the general registers and segment registers related to the startup firmware;

[0163] Get the configuration data of Windows virtual machine;

[0164] Set initial values ​​for general registers and segment registers according to the configuration data of the Windows virtual machine.

[0165] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0166] When the boot firmware is running, the virtual machine monitor QEMU is controlled through the firmware configuration interface fw_cfg to send the memory loading address to the boot firmware.

[0167] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0168] The file content includes the running code of the boot manager;

[0169] By executing the ljmp jump instruction or the lret jump instruction, the target memory area is jumped to according to the memory load address, and the running code of the boot manager file boot manager in the target memory area is loaded.

[0170] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0171] During the startup process of the Windows virtual machine, the option ROM mechanism is used to compile and generate the startup firmware;

[0172] Initialize the virtual machine monitor QEMU, and use the virtual machine monitor QEMU to read the boot manager file bootmanager to obtain relevant data of the boot manager file boot manager, including the memory loading address and file content;

[0173] Load the boot firmware through the basic input and output system SeaBIOS;

[0174] Using the virtual machine monitor QEMU, the file content is stored in the target memory area corresponding to the memory load address;

[0175] Use the boot firmware to load the file content of the boot manager file in the target memory area.

[0176] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0177] The size of the memory occupied by the file is used as a matching condition to match the target memory area.

[0178] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0179] Use the virtual machine monitor QEMU to send the memory load address to the boot firmware;

[0180] Using the boot firmware, the file content of the boot manager file bootmanager in the target memory area is loaded according to the memory loading address.

[0181] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0182] Reset the general registers and segment registers related to the startup firmware;

[0183] Get the configuration data of Windows virtual machine;

[0184] Set initial values ​​for general registers and segment registers according to the configuration data of the Windows virtual machine.

[0185] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0186] When the boot firmware is running, the virtual machine monitor QEMU is controlled through the firmware configuration interface fw_cfg to send the memory loading address to the boot firmware.

[0187] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0188] The file content includes the running code of the boot manager;

[0189] By executing the ljmp jump instruction or the lret jump instruction, the target memory area is jumped to according to the memory load address, and the running code of the boot manager file boot manager in the target memory area is loaded.

[0190] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0191] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0192] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0193] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.< / offset> < / segment>

Claims

1. A Windows virtual machine startup acceleration method, characterized in that: The method comprises: During the startup process of the Windows virtual machine, the option ROM mechanism is used to compile and generate the startup firmware; Initialize the virtual machine monitor QEMU, and use the virtual machine monitor QEMU to read the boot manager file bootmanager to obtain relevant data of the boot manager file boot manager, wherein the relevant data includes a memory loading address and file content; Loading the boot firmware via the basic input and output system SeaBIOS; Using the virtual machine monitor QEMU, storing the file content in a target memory area corresponding to the memory load address; The boot firmware is used to load the file content of the boot manager file in the target memory area.

2. The method according to claim 1, characterized in that The related data also includes the memory occupied by the file; before storing the file content into the target memory area corresponding to the memory loading address, it includes: The size of the memory occupied by the file is used as a matching condition to obtain the target memory area.

3. The method according to claim 2, characterized in that After storing the file content in the target memory area corresponding to the memory loading address, the method further includes: Using the virtual machine monitor QEMU to send the memory load address to the startup firmware; The step of using the boot firmware to load the file content of the boot manager file in the target memory area includes: The boot firmware is used to load the file content of the boot manager file in the target memory area according to the memory loading address.

4. The method according to claim 1, characterized in that After storing the file content in the target memory area corresponding to the memory loading address, the method further includes: Resetting the general registers and segment registers related to the boot firmware; Get the configuration data of Windows virtual machine; According to the configuration data of the Windows virtual machine, initial values ​​are set for the general register and the segment register.

5. The method according to claim 3, characterized in that: The using the virtual machine monitor QEMU to send the memory load address to the startup firmware includes: When the startup firmware is running, the virtual machine monitor QEMU is controlled to send the memory loading address to the startup firmware through the firmware configuration interface fw_cfg.

6. The method according to claim 3, characterized in that The file content includes the running code of the boot manager; and the loading of the file content of the boot manager file boot manager in the target memory area according to the memory loading address includes: By executing the ljmp jump instruction or the lret jump instruction, the target memory area is jumped to according to the memory loading address, and the running code of the boot manager file boot manager in the target memory area is loaded.

7. A Windows virtual machine startup acceleration device, characterized in that: The device comprises: The firmware compilation module is used to compile and generate the boot firmware using the option ROM mechanism during the startup process of the Windows virtual machine; Initialization module, used to initialize the virtual machine monitor QEMU; A data loading module, used for reading a boot manager file boot manager by using the virtual machine monitor QEMU, and obtaining relevant data of the boot manager file boot manager, wherein the relevant data includes a memory loading address and file content; A firmware loading module, used for loading the startup firmware via a basic input and output system SeaBIOS; A data storage module, used to store the file content into a target memory area corresponding to the memory load address by using the virtual machine monitor QEMU; The startup module is used to load the file content of the boot manager file bootmanager in the target memory area by using the startup firmware.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Virtual machine creation method, device and system, medium and equipment

    CN113886019A

  • Resource configuration method and device, electronic equipment and computer readable storage medium

    CN114398172A

  • Virtualization method of industrial Internet of Things operating system and system applying virtualization method

    CN117891555A

  • Virtual machine QEMU program hot upgrade method, system and equipment

    CN119718547A