Archive for August, 2012

Any program is a set of functions that the processor has to execute to give the user the required output.

A function is a set of instructions that the program executes when the function is called by the program at a certain time.

The main function is what the processor search for to start executing the program, in other words, the main function is the first function being executed by the processor. The main function can call then other functions within the program to execute certain action.

To write the program code, you most of the time will execute some predefined functions, like for example the writing and reading function which in C++, we call them cout and cin. These 2 functions were already defined in a library that allows your program to understand the functionalities iostream. I made a very small application, in the following part to help you better understanding how to start writing code. The namespace std is what allows your application to consume the standard functionalities.

For example:

#include <iostream>

using namespace std;

int add(int x, int y)

{

    return x+y;

}

int main()

{

    cout << add(4,4);

    return 0;

}

After a number of recent blog posts about Virtualization in Intel Platform, here we will enter smoothly and explore the VMX operations and the CPUID. Here in this blog post, you will find all the details regarding what is related to the VMX Operation.

Now starting with the CPUID, it is taken from the CPU, it is main target is to define the ID of the processor and its capabilities. As in my blog post I am so interested about the Virtualization and Cloud Computing I will show you how to know if the current processor supports the VMX operations for allowing it to develop using the VMM and the Guest OS.

First of all let’s have a look on Instruction format that is passed to the processor to execute. The following picture is taken from the “64-ia32-architecture-software-developer-vol-2a-manual” for Intel.

I will not get in details what each thing in the instruction format do, maybe in late blog posts, but what I want to point out that you can know if the processor supports the VMX operation from the 5th bit. this is form the Intel Book “System software can determine whether a processor

supports VMX operation using CPUID. If CPUID.1:ECX.VMX[bit 5] = 1

I know and I am sure that all the coming Microprocessor will support the VMX operations because the coming windows of Microsoft the most dominant OS on earth for end users will have a Hypervisor.

 

 

VMX operation is the feature added to several Intel microprocessors that give them the capabilities to create Virtual Machine and creating the Hypervisors. Continuing on my latest post about Virtualization on Intel Platform, the VMX has two kinds of operations, one for the VMM (Virtual Machine Monitor) called the root operation and the second one is for the Guest Software called non-root operation. The root and the non-root operation are the way that the VMM and the Guest Software talk to each other.

There are some transitions made from the VMX root operations to the non-root operations called “VM Entries”, the other kind of transition from non-root operations to root operations called “VM Exits”.

So after defining everything like below, now I will explain everything in detail. The root operation is a set of instructions basically an addition of instructions added to the processor to allow him to execute and to accept these kind of instructions beside the normal instructions. The non-root operation’s main target is to facilitate the Virtualization.

Based on the latest Blog posts about Virtualization on Intel Microprocessor, and the VMM (Virtual Machine Monitor) the Hypervisor is the main component for the Virtualization. The Hypervisor most likely is called the VMM (Virtual Machine Manager), I think that this is the component that is managing the Virtual Machine Monitor of the processor to gain 3 main things:

  1. Equivalence, for executing the applications running on the guest OS as it is running on a normal PC
  2. Hardware Resource Control, this feature mainly prevents the guest OS from changing or accessing any kind of the configuration system
  3. Efficiency, that means that all the instructions of the guest OS must be executed simply and in an easy way without any interfering of the Hypervisor or the Virtual Machine Monitor.

Types of Hypervisor:

  • Bare metal Hypervisor

    The bare metal is the hypervisor that can control directly the Hardware resources and can easily manage the resources for different Guests that want to run their applications.

  • Hosted Hypervisor

     

    The hosted Hypervisor is a hosted hypervisor on an operating system that acts like an application that the operating systems executes its instructions.