My slogan is: reject reprinting, long live innovation! YY is the mother of innovation, and practice is the father of innovation! I will try to write my own thoughts, maybe not necessarily. However, even if you have any shortcomings, you should simply repost them.
Opening part: Virtualization Technology Summary
Virtualization technology is getting increasingly popular. Summary + YY:
Virtual machines in specific languages: simulation of bytecode. The operating system is different. It mainly targets dynamic languages and can be implemented across platforms. Such as JVM. Care about OS.
The most primitive method: command-level simulation. Condition: the instruction set is different and there is no OS. Each READ command is converted into a command on the target machine. Registers and so on in the memory. It is generally used to simulate embedded chips. For example, Wukong simulator. Focus on instruction sets.
Faster approach: user-level function-level simulation. Condition: the instruction set is the same. OS is different. Use the OS APIs on the host machine to implement the APIS required by the target application. In user mode simulation. For example, wine. Focus on APIs.
Faster approach: kernel-level function-level simulation. Condition: the instruction set is the same. OS is different. Use the kernel functions of the OS on the host machine to call the system required by the target application. In kernel mode simulation. For example, uniied kernel. Focus on system calls.
Virtual Hardware mode: Most machine code is executed directly. Condition: the instruction set is the same and the OS is different. Of course, some hooks are required. You do not need to change the command for addition, subtraction, multiplication, and division. Memory-related commands? How to handle the kernel state? Hardware is virtualized. A virtual memory. For example, 256 m. The memory physical address needs to be remapped, so MMU needs to be virtualized. In the virtual MB memory, each "process" has its own page table. The kernel state address is also 1 GB. This task is handed over to MMU. But this kernel state is different from the real kernel state. In the host computer's view, this "kernel state" is still the user State. All processes are run in the address space of VMware. VMware's 4G address space is a real kernel state, while 1G is a virtual "kernel state ". The remaining 2 GB of user space is shared by all processes. If not, rob the IP address first to invalidate the pages corresponding to other processes. As for the distinction between the real kernel state and the virtual "kernel state", it depends on four rings of intel X86. Set the real kernel state to ring0, the virtual kernel state to ring1, and the user State to ring3. The bus address is also remapped. The operations of the "virtual OS" on the video memory, the operation on the mouse and keyboard, and the operation on the NIC are all operations performed by a single process on the device. Therefore, we must develop the separation technique. Redefines the operation of the BUS address. For example, VMWare. Focus on hardware operations.
There are also Virtual Operating System Mode and xen mode, so we will not study it carefully.