 And welcome to today's lecture on virtual machines. We have been discussing virtual memory, which is a part of the hierarchical memory organization. And as we shall see, virtual machines is an extension of the idea of virtual memory. So today, we shall discuss about some of the aspects of virtual memory, which we have not been able to cover in the last two lectures, and then we shall switch to virtual machines. So, here is the outline of today's lecture. First I shall discuss about Pentium 2 memory address translation mechanism, and discuss about several policies like fetch policy, replacement policy, and then replacement algorithms, which are done as part of the virtual memory management system, and then how the protection is achieved with the help of virtual memory. And then we shall extend this idea of virtual memory to virtual machines. And particularly as we shall see, there are two classes of virtual machines, one is known as system virtual machines, another is process virtual machines, which we shall discuss in detail. And then we shall summarize the lecture, I mean covering virtual memory and virtual machines. So far as the Pentium 2 is concerned, as we know there are several alternatives available. It can use unsegmented unpaged memory, it can use unsegmented paged memory, it can use unsegmented unpaged memory, and segmented paged memory, which combines segmentation and paging, which I have briefly mentioned in my last lecture. And as you know it uses 46 bit providing 64 terabytes of memory, that is the virtual memory, of course there are two bits used for the purpose of protection. So, it has got 48 bit virtual address that is generated by the processor, and the physical address is 32 bit, and with that you can have 4 gigabyte of physical memory. This is how the translation takes place, it generates that 48 bit address, that is 16 bit segmented address, that is a segmented segmented reference, and 32 bit offset, I mean that is actually used for the purpose of linear address translation. So, we have got a segment table, and with the help of that segment table pointer that is the base address, and the segment offset that entries obtained, and that provides you the segmented address with that offset is added to point to the linear address, and which is as you can see it comprises three parts, on the first is page directory, then page table and offset. So, page directory provides you the base of the page table, from where you get the particular page reference number, or page frame number, and which is used to generate the physical address by concatenating the offset to get the 32 bit physical address, and that gives you 4 gigabyte of physical address. So, this is how the Pentium memory address translation takes place, now we shall focus on some of the policies that is used in virtual memory system, number one is known as fetch policy. So, this determines when a page should be brought into the main memory, as we know all the pages are present in the secondary storage, then from the secondary storage you have to transfer to main memory, and when to do that, that means when a page should be brought into the main memory. So, in virtual memory management system, the technique that is used is known as demand paging. So, demand paging only brings pages into the main memory, when a reference is made to a location on the page, that means when a address is generated by the processor referring a particular page, only then that page is transferred from the secondary memory to the main memory. So, that is why it is called demand paging, and only recently accessed pages are available in the main memory, and that means only brings the pages into the main memory when a reference is made to a location on the page, and many page faults when process first started. So, this is inevitable because in the beginning not a single page is present in the main memory, so as the processor keeps on accessing different pages, they have to be transferred from the secondary storage to the main memory, and each will lead to a page fault, so that will lead to many page faults. There is another policy that can be used which is known as prepaging, so prepaging brings in more pages than needed, so in this particular case it is different from the demand paging although this is advantageous in many situations, but rarely practiced. So, this is more efficient to bring in pages that reside contiguously on disk, because of the locality of references, you know the processor keeps on accessing contiguous memory locations, and if they are stored in consecutive pages, it is preferable to transfer several pages one after to the main memory, so that is your prepaging that means bring in pages that reside contiguously on the disk, so more than one page can be transferred whenever a page fault occurs, but as I said this is rarely practiced, because that takes quite long time, but it can be done to improve the efficiency. So, this is the fetch policy, then comes the replacement policy, so determines where a real memory a process piece is to reside, this is important in a segmentation system and paging or combined paging with segmentation hardware performs address translation, so placement that means it determines where it is present in the real memory that placement is important and particularly as we have seen because of the limited size of main memory, a restricted number of phases should be present in the main memory, so continuously there will be swapping of phases between main memory and secondary memory, so you have to use some replacement policy which decides which page is replaced, that means whenever a new page is brought in you have to replace a new page, so the page removed should be the page least likely to be referenced in the near future, so that is the ideal situation, so what is being done in practice most of the policies predict the future behavior based on the past behavior, so you cannot really predict the future, but based on the past behavior some prediction about the future can be made and based on that the replacement is being done. And there are several approaches, the first one is known as optimal policy, so the replace the page which will not be used for the longest period of time, so who can tell that replace the page which will not be used for the longest period of time, it is difficult to predict because in a dynamic situation when a program is getting executed, it is not possible to predict possibly the prediction can be done by an astrologer, but we cannot keep an astrologer inside the processor, so it is difficult to implement or not possible to implement, so difficult to implement because it requires the knowledge of the future, so this policy although it is ideal this cannot be adopted in practice, so the most commonly used technique that is used is known as least recently used LRU technique, so it replaces the page that has not been referenced for longest time, so what is being done least recently used that means you have a number of pages and there is some mechanism by which you can keep track of which page has not been used for a longest period of time and that page is replaced, obviously this will be helpful because by the principle of locality you know temporal locality this should be the page least likely to be referenced in near future as you know temporal locality tells that if a page is referenced now it will be referenced in near future likely to be reused in near future, so if a page has not been used for a long time it is unlikely to be used in near future, so that is the basic idea behind this least recently used technique what can be done each page could be tagged with the time of last reference, so you have to keep a kind of time stamp with each page and obviously this would require great deal of overhead, so it is difficult to really keep track of that time I mean for each page you have to store the information of time and it involves lot of overhead, so it can be implemented but in lot of overhead is involved in this particular technique. Another technique that can be used is known as fast in fast out or FIFO, so treat page frames allocated to a process as a circular buffer that means as the pages are that means you are bringing in the pages the first page that was brought in is removed first, so fast in fast out, so pages are removed in round roman style it is very simple to implement possibly simplest replacement policy to implement and page that has been in memory the longest period is replaced as I mentioned, so these pages may be needed again very soon, so although it is very easy to implement this fast in fast out FIFO type of replacement algorithm but it does not really give you very good result the reason for that is the page which is being replaced now may be required in near future, so it does not really give you very good result. Another technique is known as clock policy, so in this case this requires an additional bit called use bit, so when a page is first loaded in the memory the use bit is set to 1 and when the page is referenced the use bit is set I mean when a page is brought in it is set to 1 and again when a page is referenced it is set to 1 why it is done because when it is time to replace a page the first frame encountered with the use bit is set to 0 is replaced, so that means whenever you are replacing a page the first frame encountered with the use bit set to 0 is replaced but when how you are setting it to 0 during the search of replacement each use bit is set to 1 is changed to 0 that means whenever you are replacing whenever a particular page is replaced all the other use bits of all the other pages are set to 0, so subsequently again whenever you reference a page then you set to 1, so that is how it works and this is known as clock policy because it is dependent on the reference by the user. So, as you can see the overhead in this particular case is very small because you require only a single bit use bit and it has been found that it gives you reasonably good result and that is the reason why it is one of the most commonly used technique. Now we shall discuss about the idea of protection via virtual memory, we have seen that one of the important use of virtual memory is protection because security and privacy has become a very important aspect in present day context because large number of users are using a computer system, it is shared by many users and so on, so the virtual memory provides protection in a natural way and we have seen that it is done along with the TLB, TLB actually enhances the performance, the operating system and architecture jointly makes this possible and we know that the architecture must provide the following to facilitate this protection. These are the three requirements, number one is two modes of operation, supervisor mode and user mode and provides a portion of the processor state that user process can use but cannot modify, so there are two modes, user mode and supervisor mode, so in the user mode certain protection bits, certain flag bits cannot be changed, for example there is a flag bit known as user supervisor flag bit that cannot be modified, similarly there are many access bits read only, read write only, access only like that, those bits cannot also be modified by the user, so it should be done by the supervisor, so that means in the supervisor mode the processor state can be modified but not in the user mode and the architecture must also provide a mechanism by which to switch from one mode to another mode and as we know whenever the processor is in the user mode, it can switch to supervisor mode by a system call, so system call is a kind of software interrupt, you know whenever system call is that is an instruction is executed, control is transferred to the supervisor, then the processor state is saved, program counter is saved and it switches to the supervisor mode and in the supervisor mode necessary operations are performed and then the processor returns to the user mode by simple that software return instruction at the end of the supervisor call subroutine, there is a return instruction and that return transfers it back to the user mode, so this is how the switch between switch from user mode to supervisor mode and supervisor mode to user mode can be achieved and that is also provided by the architecture and it also provide mechanism to limit memory accesses to protect the memory state of a process without having to swap the process to disk on a context switch. So, whenever context switch is occurring, then it provides a mechanism to limit memory access to protect the memory state of a process without having to swap the process to the disk and these three placing the I mean page tables in the protected address space of the OS satisfies these requirements, as we have already seen that page tables where the information is stored that is kept as part of the I mean supervisors address space, so that means that particular thing cannot be accessed by the user, so we know that page table is a very critical information, if the user is allowed to modify the page table, then the protection required by the virtual machine cannot be achieved, so only the supervisor is allowed to modify the page table and that is the reason why it is kept in the address space of the supervisor. So, this is how the protection is provided by the virtual memory, however this protection is possibly not enough and that is the reason why the concept of virtual machines was introduced, so this virtual machine concept can be considered as an generalization of the idea of virtual memory, so we have seen in virtual memory we are essentially giving the user the notion of an unlimited memory, but here we shall see that virtual machines is essentially providing the virtualization of the processor itself or the entire system, so I shall discuss about in detail what are the things that is provided by virtual machines, this was developed in mid 1960s and remained as part of the main frame computing over the years, so in the beginning in the 1960s this was part of the main frame systems, so implementation of virtual machines were restricted to system IBM 370 and other machines, but only in 80s and 90s this gained popularity in the domain of single user computers like PCs in 1980s and 1990s, question naturally arises, why do you need this concept of virtual machines to be used in PCs, workstations and servers, these are the various needs in the increasing isolation security in modern systems, so modern systems are becoming increasingly complex, the application is becoming complex, size of the programs is becoming complex, the operating system size is also becoming very large, so the protection that is provided by virtual memory is not good enough, so you require additional level of security and protection and that is provided by virtual machines and it has been observed that the failure of security and reliability of standard operating systems, as I have mentioned the operating systems have tens of millions of lines of codes, they are pretty large and there are I mean bugs have been reported in the standard operating systems, so by exploiting the bugs, the bugs present in the operating system, the security protection is violated and it becomes more vulnerable to security and protection and that is the reason why the operating system cannot really provide you the necessary security, which is implemented in using virtual memory, so and moreover the sharing of same computer many unrelated users, that is increasing particularly when in the server domain, it has been found that a server is being used by many users and may be they are unrelated and as a consequence maintaining security has become very difficult. And another reason for using virtual machines is a dramatic increase in the raw speed of processors that has made overhead of virtual machine more acceptable, in the early 60s and 70s it was difficult to provide virtual machine, the reason for that is that virtual machine was imposing lot of overhead and the speed of the processors were not very high and as we have seen the speed of processors have increased dramatically in the last one decade and as a consequence the overhead imposed by virtual machine is insignificant and as a consequence it has now become more feasible, more acceptable to provide this overhead of virtual machine and these are the reasons for providing virtual machines in the present context. Now, let us try to define virtual machine, what is virtual machine? A virtual machine was originally defined by POPEC and Goldberg as an efficient isolated duplicate of real machine, that means we are trying to isolate the real machine duplicating it obviously by emulation, so we are separating the I mean we are separating the real machine with the virtual machine, so with an additional level of isolation. So, it may be considered a computer that is emulated by a program that means we have seen that virtual memory is a kind of where the user is given the illusion that the very large address space is available to it or the entire memory is available to it, here also the user is given the illusion that entire computer system is available to it, but in reality it is not so, so a virtual machine gives an illusion that the entire computer is available to an user, but it may be shared in practice by a large number of users, so all emulation methods that provide a standard software interface such as Java virtual machine that is an example of a virtual machine, Java virtual machine is quite popular and that is an example, then the virtual machines can be broadly categorized into two types as I mentioned, number one is known as a system virtual machine, so a system virtual machine provides a complete system level environment at the binary instruction set architectural level, so here a system virtual machine is providing the instruction set architectural level including the operating system, on the other hand a process virtual machine which is of the second category is designed to run a single program which means that it supports a single process, so a process virtual machine can support a single process, on the other hand a system virtual machine can provide I mean a large number of I mean in the entire system is getting emulated including operating systems, you can have multiple operating systems emulated on a single machine, on a single processor, so system virtual machines provide an illusion that an user has an entire computer at his disposal including a copy of the operating system and a single computer runs multiple virtual machines and can support a number of different operating systems in system virtual machines, so it can different operating systems means it can support it can provide an old operating system like DOS, it can provide the existing operating system like Windows, Microsoft Windows and Unix or you can provide the emulation of a operating system that is under development, so which is not yet commercialized, so that is the advantages of this virtual machine concepts, so normally a single operating system owns all the hardware resources, we know that whenever conventionally you have a processor, a single system is having a single operating system, so all the entire resources processor, I O memory all are under the control of an operating system, on the other hand in case of virtual machine multiple operating systems share these hardware resources, so the processor, the memory, the I O devices all are shared by multiple virtual machines that can be emulated on a single system, so but the users it is transparent to the users, so the user feels that entire computer system is at its disposal, but that is not true in practice, so that is the basic difference of the virtual memory with virtual machine and how is it implemented, so there is a concept called virtual machine monitor, so the system virtual machines allow the sharing of the underlying physical machine resources between different virtual machines including running of its own operating system, so this is done this software layer that provides this virtualization is called virtual machine monitor VMM or hypervisor, so the software that provides this interface is known as VMM or virtual machine monitor, so a virtual machine monitor or hypervisor can run on bare hardware that is the type one on native virtual machines or on top an operating system that is type two or hosted VMM, so the difference between the two is in the first case it is running on the native hardware, so the speed of operation will be pretty fast, on the other hand in the second case where it is running on top of the operating system, so an emulated version of hardware is being used, so in such a case the performance will be lesser compared to the first case, so you have got there are two possibilities one is known as native VMM another is hosted VMM, so the virtual machine monitor is the heart of the virtual machine technology as I have already mentioned, the underlying hardware platform is called the host, so you will definitely require a hardware platform processor, memory, IR devices that is the hardware platform that hardware platform is called the host on top of which the VMM is working and the resources of host are shared by guest virtual machines, so you will be having a number of guest virtual machines running on top of the I mean which will work on top of the VMM virtual machine monitor, so the virtual machine monitor determines how to map virtual resources to physical resources, obviously those guest VM virtual machines have to will require the processor for execution of their program, they will require memory to save their program, they will require I O very different types of I O for data transfer and also to save the data in the hard disk that is a kind of I O, so how the real process and the mapping of the mapping to the hardware is done with the help of this virtual machine monitor, so the VMM determines how to map the virtual resources to the physical resources. Now question naturally arises how big is the virtual machine monitor, it has been found that the virtual machine monitor is typically much smaller than a traditional operating system, we know that I have already mentioned that traditional operating systems are pretty large tens of thousands of lines of codes, on the other hand the virtual machine monitors are relatively smaller compared to the traditional operating systems. Now let us discuss the advantages and disadvantages of virtual machine, the main advantages of the system virtual machines, so here as I mentioned there are two types of virtual machines, one is system virtual machine, another is process virtual machine, so here we are discussing the advantages of system virtual machines, there are several advantages number one is multiple operating system environments can coexist on the same computer, at the same time maintaining strong isolation from each other, so this is a very important aspect, you see multiple operating systems will be running on a single computer, at the same time there will be strong isolation they will not interfere with each other, one will not I mean that the security and protection will not be violated, so that is very important, so there will be strong isolation from each other, the virtual machine can provide an ISA that is somewhat different from that of the real machine, so as we know the instruction set architecture is essentially the programmer's view of the processor, so you may have a native processor which is having its own instruction set architecture. Now a virtual machine monitor can provide you a different instruction set architecture that is not present, that is not provided by the native hardware, that means the instruction set architecture can be different from that of the native hardware, so that is provided by the emulation, so this is very important and useful in many situations and application provisioning, maintenance, high availability and disaster recovery, so you can see these are the other important aspects of computer systems that application provisioning, maintenance, high availability that means to an user it should be available with the help of virtual machines that availability is made very high and it can it provides you disaster recovery, so whenever there is some failure say for example you are having multiple servers, so whenever a virtual machine is implemented on multiple server, if a particular server fails that will be taken care of automatically by the virtual machines, that means it will recover from that disaster or the failure and that is why it is very useful in many applications. Of course there you cannot have all the advantages without any disadvantage, so the main disadvantages of system virtual machines are as follows, the virtual machine is less efficient than a real machine when it accesses the hardware indirectly, so it is quite obvious that whenever you are running an application in an emulated environment, it will definitely be slower than if you run it on the real processor, so that is one disadvantage of this virtual machine because the efficiency will be lesser that time required will be more, so when multiple machines are concurrently running on the same physical host, each virtual machine may exhibit a varying and unstable performance which highly depends on the workload imposed on the system by other virtual machines, so this is quite obvious because each virtual machine is running some application and those applications can be different at different instances of time and as a consequence it provides you a varying workload to the processor, so as a consequence a particular virtual machine running an application what kind of response time it will get that is variable and which is not very stable as well, of course by using proper technique that there can be some temporal isolation among virtual machines, but it is very difficult to implement, so usually it will each virtual machine may exhibit varying and unstable performance, so here question arises what must a virtual machine monitor do, we have seen that that virtual machine monitor is a software interface, what it should do, what it should provide that is being answered here, it presents a software interface to the guest software, so it must isolate the state of guest from each other, so what do you really mean by state of guest, state of guest is you know we have seen that each guest application will require its own status information which I have already mentioned that page table and various other things, those things are to be isolated from each other and must protect itself from the guest software including guest operating systems. So, the virtual machine monitor should also protect itself from the guest software including guest operating systems, so the guest operating systems will be running in a single system and it should be done that means virtual machine monitor has to be protected from the from different operating systems, guest operating systems that will be running. Then there are some qualitative requirements except for performance related behavior, guest software should behave as if it is running on its native hardware, as I have already told there can be some degradation in performance, but apart from the degradation in performance the quality of the result should be identical to that of running in the real hardware, so this is very important because without this the virtual machine concept will not be acceptable and guest software should not be able to change allocation of real system resources directly, so that means that we have seen that each guest virtual machine is provided some part of the hardware resources, so that allocation should not be modified by the guest virtual machine, it should be done by the virtual machine monitor. And there are other benefits like managing software, it provides abstraction that can run the complete software stack as I have already told old operating system like DOS newly developed operating system along with the existing operating system that can be provided by the virtual machine monitor, so it can manage the I mean provides the abstraction that can run for complete software stack for different types of software. Then managing hardware here you will require the consolidation of the number of servers load balancing and to take care of failing hardware as I was mentioning that you may be having a large number of servers, server firm, so where a large number of users or applications are running and the virtual machine monitor should provide a kind of load balancing that means all the servers should be equally loaded, so that the performance level is higher. Similarly, you have to do a kind of consolidation of the hardware that means all the different types of servers say a particular server can efficiently run a particular application. So, the virtual machine monitor will allocate different applications appropriate for a particular server and then as I mentioned it will take care of the failing hardware in a real life scenario some servers or hardware hard disk and other type of devices can fail, so the virtual machine monitor will take care of it will manage the hardware and it will make it transparent to the user. Then comes the processor virtualization which is one important aspect of the virtual machine monitor, so to virtualize a processor the virtual machine monitor must control everything, so access to the privileged states I have already mentioned that there will be two states, you know that supervisor state, user state, so that access to the privileged states will be provided only to the supervisor mode, but not in the user mode then address translation which does the mapping of the physical and the logical address virtual address to physical address that translation has to be done mapping has to be done with the help of page table and that page table should not be modified by the user virtual machines, it should be done by the virtual machine monitor then the access of different IO devices, so that access of different particularly that virtual machines different virtual machines will try to access different I mean IO devices that should be done through the virtual machine monitor then there will be exceptions and interrupts, so whenever exceptions and interrupts are generated control should be transferred to the virtual machine monitor and they will be handled in the supervisor mode under the control of the virtual machine monitor, so to be in charge the virtual machine monitor must be at higher privileged level than the guest virtual machines, so there can be several privileged levels, so user virtual machines will have some privileged level, virtual machine monitor must have another privileged level, so privileged level of the virtual machine monitor should be higher by that we mean some of the some of the instructions which can be executed by the virtual machine monitor cannot be executed by the guest virtual machines, so that means the guest virtual machines will run in the user mode on the other hand the virtual machine monitor will operate in the supervisor mode or the system mode and as I have mentioned that will require two processor modes system mode and user mode and a privilege subset of instructions available only in the system mode, so those subset of instructions can be executed in the system mode, but cannot be executed in the user mode, so this is how the processor virtualization virtualization can be done then comes the instructions at architecture support for virtual machines, the we have seen that the virtual machine monitor is implemented by software, so it is a question arises how efficiently it can be implemented, so that instruction set architecture determines how efficiently it can be implemented, so whenever the instruction set architecture is designed that time you have to plan for virtual machine, so if you do not plan the virtual implementation of virtual machine when the instruction set architecture is designed then implementation of instruction set that virtual machine will be difficult, for example an architecture that allows the virtual machine to execute directly on the hardware is termed as virtualizable, so some processors can be categorized as virtual virtualizable like IBM 370, so IBM 370 proudly wears this level because different virtual machines can be directly executed in their native hardware, on the other hand unfortunately the x86 MIPS and ARM architecture were created without virtualization in mind, so when their instruction set architecture were designed for say MIPS processor or ARM processor or the 8086 series of processors, family of processors then virtualization was not considered because virtual machine concept is not a very old concept, it is a relatively new concept which is used in the present context, so then whenever it is done your implementation will be I mean will be less efficient, so the instruction set architecture requirements are given here, a guest operating system runs as a user mode program on top of virtual machine monitor, if a guest operating system tries to access or modify hardware related information, it will trap to the virtual machine monitor, that means in the user mode you should not have instruction which will allow you to modify the hardware related information those various types of flag bits and that is available, so if an user in the user mode that is tried then it will trap to the virtual machine monitor and the virtual machine monitor supports a virtual version of the sensitive information, so the sensitive information is supported with the help of the virtual machine monitor, now what is the impact of virtual machines on virtual memory, so this is another challenge of virtualization of the virtual memory, we have seen that each guest operating system in every virtual machine manages its own set of page tables, so for each virtual machine you will have a page table, now then page table will map the virtual address to the physical address, so each virtual machine will do so and that will lead to some conflict, so to make it feasible the virtual machine monitor separates the notion of real and physical memory, so what is being done another level of abstraction is provided, so earlier you had virtual machine, virtual memory and physical memory, now you are introducing a real memory, so real memory is treated as a separate intermediate level memory between virtual memory and physical memory, so the guest operating system maps virtual to real memory via page tables, so it is done in two levels and the virtual machine monitor maps the virtual machine monitor page tables maps the guests real memory to physical memory, so you see virtual to real is the job of the guest operating system and the real to physical memory mapping is done by the virtual machine monitor, so the virtual machine monitor maintains a shadow page table that maps directly from the guest virtual address space to the physical address space of the hardware, so the managing the virtual memory using virtual machine is relatively easy but managing the IO device is more difficult, the most difficult part of the system virtualization is the virtualization of IO devices and particularly each IO device may have its own device driver, so IO devices along with the device drivers that is that has to be virtualized, so virtual that means sharing of real devices among multiple virtual machines, so that is a more difficult task what is being done physical disks are partitioned into by the virtual machine monitor to create virtual disks for the real virtual guest virtual machines, so here the again virtual machine monitor is helping in creating virtual disks, so some kind of partitioning is done and each guest virtual machine can access that partition part of it, so the hard disk can be considered as a kind of IO device, similarly the IO devices can be also managed in this manner. Now comes the question of protection and the instruction set architecture, as I mentioned the protection is a joint effort of the architecture and the operating system, so it should be done together, so the architecture must modify some awkward details of existing ISA when virtual machine become popular, so earlier virtual machines were not popular but subsequently when virtual machine became popular it is necessary to modify the instruction set architecture, so that some of the instructions or features is modified, so that virtual machine implementation is feasible. For example, that IBM 370 instruction set architecture had to be changed after six years of its successful existence, similarly x86 instructions I am not going into the details there is an instruction called POPF, so it is related to accessing flag bits modifying flag bits, so this creates a problem, so this they have to be modified, so that you can implement virtual machines, so there are three steps to improve the performance of virtual machines, number one is to reduce the cost of processor virtualization, to reduce interrupt overhead cost due to virtualization, reduce interrupt cost by steering interrupts to the proper virtual machine without invoking virtual machines, these are to be provided together by the architecture and the operating system. And it has been found that it takes several generations of processor architecture upgradation to address all the three issues, so the processor architecture is getting upgraded, so you are getting version after version and to take care of all these three features. Finally, to conclude we shall discuss about the process virtual machines, a process virtual machines sometimes it is called an application virtual machine runs as a normal application inside an operating system and supports a single process unlike the system virtual machine can support multiple operating systems, so it is created when the process is started and destroyed when it exits, so its purpose is to provide a platform independent programming environment, this is very important you are familiar with Java which provides you a Java virtual machine that provides you a virtual independent platform independent programming environment that abstracts a way details of the underlying hardware or operating system and allows a program to execute in the same way on any platform, so this is the basic notion of platform independent programming environment. So, a process virtual machine provides a high level abstraction that of a high level programming language compared to the low level instruction set architecture abstraction of the system virtual machine, so this type of virtual machine has become very popular with the Java programming language which is implemented using Java virtual machines as I have already mentioned. So, you can summarize virtual memory and virtual machine as we have seen virtual memory is an automatic address translation mechanism that it allows decoupling of programs name space from physical location, it provides access to name space potentially greater in size than physical memory rather unlimited memory size, expandability of user name space without real location of existing memory, protection from interference with name space of other tasks and the various components that allows it is physical memory divided into phases we have seen the use of paging scheme, a swap device, typically a hard disk that holds the phases not resident in the physical memory, we have seen that how paging is implemented, then the address translation which does the mapping of mapping or virtual to physical memory, translation look aside buffer to improve the performance inverted page table to make translation efficient, we have discussed in detail and management software is done in the operating system. Similarly, we can summarize the virtual machines, the virtual machine is an extension of the idea of virtual memory to improve the isolation and security in modern systems which is becoming increasingly complex. So, virtual machine is a computer that is emulated by a program as we have seen a single computer runs multiple virtual machines and can support a number of different operating systems in system virtual machine, machine monitor. The software layer providing the virtualization is called virtual machine monitor or hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper hyper So, a virtual machine is less efficient than a real machine when it accesses the hardware indirectly because of the emulation technique that is being used. So, with this we have come to the end of the hierarchical memory organization using virtual memory and also the extension of the idea to virtual machines. Thank you.