Author:Instructor Zhu, a lecturer at Huaqing vision embedded College.
A successful operating system is inseparable from the support of various virtual devices. Virtualization usually occurs when a certain amount of resources is insufficient, but it depends on another kind of resources and capabilities.
In the early days, computers were slow, and people were too slow to use them. However, with Moore's law-based growth, the CPU speed is much faster than the human response speed, which is 10x9: 10 = 100000000 times. It is a waste of resources for a single CPU.
As a result, the thin client-server business model emerged. One server can satisfy the requests of N clients at the same time. Each client does not feel the existence of other clients, and thinks that it excludes a server. Currently, online games fully utilize this feature. The same is true for the implementation of cloud computing. Even on the same PC, multiple tasks are executed concurrently. Processes, threads, hyper-threading, and multi-core are all virtual machines of different levels. Multithreading releases the powerful computing and processing capabilities of the CPU to make full use of its capabilities. Processor virtualization is achieved because of the insufficient number of processors and the high CPU efficiency.
Another widely used type is virtual memory. The virtual memory frees you from the limitations of the application due to insufficient physical memory and ensures the space independence of the process, it depends on the high speed of the CPU and the swap buffer of the hard disk. Of course, the memory management cannot be supported because each process consumes the process space allocated to itself at the same time. Just like insurance companies, if there is a problem with all of them, the insurance companies will go bankrupt immediately. In fact, it is unlikely that the former is a small probability event because of program locality and multiple occurrences. Our method can solve the average problem, but generally it does not consider the worst case with a small probability.
The same is true for Virtual Network hard disks, as in some mail systems, although each person can have ng space, on average, only a very small proportion of people may use up. Therefore, we do not have to prepare the largest disk space in theory. It is not too late to solve the problem if the worst case occurs.
The Virtual Disk removes the limitation of the physical disk. A physical disk can be a logical disk multiple times, and a logical disk can contain multiple physical disks.
Virtual optical drive, remember that a buddy used to play games. This game may be subject to copyright control and must rely on CDs. However, he created a virtual disc on the disk, and the virtual disc is out of the box. Now, the ISO file of a virtual disc has been widely used. You can use it to burn a physical disc or directly load it using a virtual machine.
Almost every big company has a virtual private network. Physical IP addresses are allocated by region. Computers in China and the United States are definitely not in the same subnet. However, multinational companies all have their own virtual subnets, so that everyone can freely access the company's servers, even across thousands of mountains and thousands of subnets. You can view the ip address in the same subnetwork. This greatly facilitates internal collaboration and improves the efficiency of cross-zone collaboration. The implementation depends mainly on the IP tunneling technology. The ip package you see is not an actual IP package, but a data part. You need to fill in different ip headers through different subnets.
In recent years, the most popular and practical virtual technology is estimated to be virtual machines. VMware was used for operating system kernel and driver development in those years. It was very convenient, fast restart, and easier debugging. I did not expect it to become the mainstream market. Think about it too. Many companies have over-built server hardware capabilities. One physical machine can program multiple virtual machines and even install different operating systems to meet different needs and improve resource utilization, reduces hardware and power costs. In addition, the virtual machine technology also improves security. There is a dual file system technology. The network can only access the logical file system, and viruses can only access and destroy the logical file system, the actual physical file system is isolated and protected. Virtual machines fully use virtual technology. All the hardware in the virtual machine is virtual. the CPU is only a process of the host machine, and the memory is only part of the virtual memory of the host, hard disk, and floppy disk, the optical drive is actually a file in the hard drive of the host machine, and the NIC is also a logical Nic.
The so-called virtual mainframe is composed of thousands of PC nodes that can complete high-performance computing tasks at a lower cost than the real mainframe. The software environment is even better.