Virtual Machine manager VMM (Vxd tutorial 2)

Source: Internet
Author: User
Virtual Machine manager VMM (Vxd tutorial 2) Copyright Disclaimer: CSDN is the hosting service provider of this Blog. If this article involves copyright issues, CSDN does not assume relevant responsibilities. Ask the copyright owner to contact the author directly.

Virtual Machine Manager

Translated by Ryo, published in http://asm.yeah.net, English version from [Iczelion's Win32 Assembly Homepage]

The Virtual Machine Manager (VMM) is a Windows 95ActualOperating System, which establishes and maintains a framework for managing virtual machines and provides many important services for other vxd programs. Three important services are as follows:

  • Memory Management
  • Interrupt handling
  • Thread Scheduling
Memory Management

VMM uses Intel 80386 or the updated processor's memory paging capability to create a 32-bit virtual address space for the system virtual machine. It divides the address space into four different parts:

  • V86 ZoneThe address ranges from 0 h to 10 ffefh, which is the current virtual machine.
  • Application private zoneThe address ranges from 4 MB to 2 GB. This is the space where Win32 applications run. Each Win32 process has its own 2 GB (4 MB less ).
  • Application Sharing AreaThe address ranges from 2 GB to 3 GB. This region is in the Virtual MachineAllShared by applications. System DLL (USER32, Kernel32, and gid32) are stored here. All Win16 programs are also put here, because their behavior is not standard: they read and write other Win16 programs in the memory. Only in this area can the Win16 program see all other Win16 programs. The memory ing file and the memory allocated to dpmi are also stored here.
  • System share zoneThe address ranges from 3 GB to 4 GB. This is where the vmm and vxm are stored.

VMM provides three VxD services for the VxD program:

  • Page Memory ServiceThis service allocates/manages a page with a memory size of 4 kb. This is the lowest level of service provided, and all other services are built on the page memory service.
  • Heap Memory ServiceManage Small memory blocks. This advanced memory management service is based on the page memory service.
  • Table serviceManage fixed memory blocks that can be used to link tables.
Handling interruptions

In protected mode, the interrupt is directed to the interrupt description table (IDT ). VMM monitors Virtual Machine IDT with VxD help. Generally, VMM processes almost all interrupt entries in IDT. It performs the first-level interrupt processing: stores the state of the interrupted program and transfers the control to the second-level interrupt processing, the second-level interrupt processing is usually performed by various VxD programs. After the second-level interrupt handler completes its work, it transfers the control to the redistribution program, the rescheduling program restores the state of the interrupted program and continues from where it was previously interrupted.
The above description is too simple. Because the time slice of the interrupted virtual machine may have passed, the rescheduling may not be executed immediately. The VxD program uses the VMM service such as Set_PM_Int or Hook_V86_Int_Chain to handle installation interruptions. The VxD program should not directly change the interrupt entry in the IDT (unless you know exactly what will happen ).

Thread Scheduling

VMM uses two scheduler components to implement priority-based multi-thread processing between virtual machines:

  • Master Scheduler
  • Time slice ManagerOrSub-Scheduler

The main scheduler selects the thread with the highest priority to execute the task. This option is used when the vmm processes an interrupt (such as a timer interrupt. The selected result determines which thread/virtual machine gets control when the vmm returns from the interrupted service. The result of the Main scheduler's work is determined. One thread can gain control or no control, and only one thread can gain control. Vmm and other VxD can adjust the thread execution priority through the vmm service. For example, when a hard interrupt occurs, vmm increases the execution priority of the interrupt processing so that it has a higher chance of being called in the shortest time.
The sub-scheduler allocates CPU time to threads with the highest priority through the services provided by the main scheduler. The sub-scheduler gives each thread a time slice. When a thread finishes executing its time slice, the sub-scheduler increases the priority of the next thread so that it will be selected and executed by the main scheduler.

You canWalter Oney's Systems Programming for Windows 95AndWindows 95 DDKThe document contains details about this issue.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.