Information about Virtual Memory
- This article is about the computer term. For the TBN game show, see Virtual Memory (game show).
Memory is called "virtual" due to an analogy with optics: virtual images in optics (such as the image in a mirror) appear to be real but actually don't exist.
An important note is that virtual memory is not just "using disk space to extend physical memory size". Such goal is now often achieved with paging technique, and in the past with overlay technique, but it is not a core of a virtual memory concept.
Technically, virtual memory is an addressing scheme implemented in hardware and software that allows non-contiguous memory to be addressed as if it were contiguous. All current implementations of virtual memory support two operating system features:
- Residency on reference - A memory location can be addressed that does not currently reside in physical memory. The hardware and operating system will load the required data from auxiliary storage automatically, in a manner completely invisible to the program addressing the memory. This allows a program to naturally reference more main memory than actually exists in the computer.
- Isolation - A multi-tasking system can provide multiple virtual address spaces with total memory isolation between them. Every task (except the lowest level operating system) can have its own private address space and thus can be naturally isolated from other tasks altering the memory contents. Isolation increases reliability by isolating faults within a specific task and preventing a task from interrupting other tasks.
Overview
In x86 architecture, hardware has two methods of addressing RAM, real and virtual.- In real mode, memory address registers contain an integer that addresses a word or byte of RAM. The memory is addressed sequentially: if a program increments the address register by n, the location of the memory being addressed moves forward by n.
- In virtual mode, memory is divided into pages, usually 4096 bytes long. These pages may reside in any available RAM location that can be addressed in virtual mode. Memory address registers are divided into an index and an offset: the high-order bits represent the index, and the lower-order bits represent the offset. The index is an offset within the page-mapping table (which resides at a known address in memory), each of whose entries contains the starting real addresses of the corresponding page. The offset represents a location within the page specified by the offset, and can range from 0 to 1 less than the page size (with a page size of 4096, between 0 and 4095). The virtual address is resolved by looking up the index in the page table -- yielding a physical page address -- and then adding the offset to the physical address.
Paging
Historically, a number of systems implemented virtual memory without paging, most notably the PDP-11, but also machines like the GE-645, which supported both paged and unpaged segments. It is also theoretically possible to build a system with paged memory but without virtual memory. Pages would be used simply for memory allocation and accessed with physical, non-translated address.
Translating the memory addresses
To minimize the performance penalty of address translation, most modern CPUs include an on-chip memory management unit (MMU) and maintain a table of recently used virtual-to-physical translations, called a Translation Lookaside Buffer (TLB). Translating an address that has an entry in the TLB requires no additional memory reference (and therefore time). However, the TLB can only contain a limited number of mappings between virtual and physical addresses. When the translation for the requested address is not resident in the TLB, the hardware will have to perform the translation and load the result into the TLB.On some processors, address translation is performed entirely in hardware; the MMU has to make additional memory references to load the required translations from the translation tables, but no other action is needed. In other processors, assistance from the operating system is needed: the hardware raises an exception, and the operating system handles it by replacing a TLB entry with an entry from the primary translation table, and the instruction that made the original memory reference is restarted.
Memory protection
Hardware that supports virtual memory almost always in addition implements memory protection mechanisms. The MMU may have the ability to vary its operation according to the type of memory reference (for read, write or execution) and the privilege mode of the CPU at the time the memory reference was made. This allows the operating system to protect its own code and data (such as the translation tables used for virtual memory) from corruption by an erroneous or malicious program, to protect programs from each other, and (to some extent) to protect programs from themselves (e.g. by preventing writes to areas of memory that contain code).History
In the 1940s and 1950s, before the development of a virtual memory, all larger programs had to contain logic for managing two-level storage (primary and secondary, today's analogies being RAM and hard disk), such as overlaying techniques. Programs were responsible for moving overlays back and forth from secondary storage to primary.The main reason of introducing virtual memory was therefore not simply extend a primary memory, but to make such extension as easy to use for programmers as possible.
Many systems already had the ability of dividing the memory between multiple programs (required for multiprogramming and multiprocessing), provided for example by "base and bounds registers" on early PDP-10 and System/360, without in any way providing virtual memory. Some systems provided a memory protection in the same way, preventing one process from modifying another's code or data.
Systems also had also the ability to relocate a program, as opposed to compiling a program to use one fixed physical memory location only. For example the KA-10 model of the PDP-10, which gave each program a private address space starting at location 0, but had no support for virtual memory.
Virtual memory was developed in approximately 1959–1962, at the University of Manchester for the Atlas Computer, completed in 1962. However, Fritz-Rudolf Güntsch, one of Germany's pioneering computer scientists and later the developer of the Telefunken TR 440 mainframe, claims to have invented the concept in 1957 in his doctoral dissertation Logischer Entwurf eines digitalen Rechengerätes mit mehreren asynchron laufenden Trommeln und automatischem Schnellspeicherbetrieb (Logic Concept of a Digital Computing Device with Multiple Asynchronous Drum Storage and Automatic Fast Memory Mode).
In 1961, Burroughs released the B5000, the first commercial computer with virtual memory.[1] It was based on the segmentation, not paging.
Like many technologies in the history of computing, virtual memory was not accepted without challenge. Before it could be implemented in mainstream operating systems, many models, experiments, and theories had to be developed to overcome the numerous problems with virtual memory. Specialized hardware had to be developed to translate virtual addresses to physical addresses in primary or secondary memory. Some worried that this process would be expensive, hard to build, and take too much processor power to do the address translation.[2]
By 1969 the debate over virtual memory for commercial computers was over.[2] An IBM research team led by David Sayre showed that the virtual memory overlay system consistently worked better than the best manually controlled systems.
Possibly the first minicomputer to introduce virtual memory was the Norwegian NORD-1 minicomputer. During the 1970s, other minicomputer models such as VAX models running VMS implemented virtual memories.
The difference between virtual memory implementations using pages and using segments is not only about the memory division with fixed and variable sizes, respectively. In some systems, e.g. Multics, or later System/38 and Prime machines, the segmentation was actually visible to the user processes, as part of the semantics of a memory model. In other words, instead of a process just having a memory which looked like a single large vector of bytes or words, it was more structured. This is different from using pages, which doesn't change the model visible to the process. This had important consequences.
It wasn't just a "page with a variable length", or a simple way to lengthen the address space (as in Intel 80286). In Multics, the segmentation was a very powerful mechanism that was used to provide a single-level virtual memory model, in which there was no differentiation between "process memory" and "file system" - a process' active address space consisted only a list of segments (files) which were mapped into its potential address space (both code and data). It is not the same as the later mmap in Unix, because inter-"file" pointers (both code and data) don't work if people are mapping files into semi-arbitrary places, at least not without a lot of extra instructions as overhead. Multics could perform relocated inter-segment references as an built-in addressing mode on most instructions, that worked even if different processes mapped the same file into different places in different private address spaces (see the "Multics" book by Organick).
Virtual memory was introduced to the x86 architecture with the protected mode of the Intel 80286 processor. At first it was done with segment swapping, which became inefficient with larger segments. The Intel 80386 introduced support for paging underneath the existing segmentation layer. The page fault exception could be chained with other exceptions without causing a double fault.
See also
- Physical memory and its physical address
- Memory address
- Address space
- CPU design
- Virtual address space
- Page (computing)
- Page table
- Paging
- Working set
- Segmentation (memory)
- Memory management
- Memory management unit
- Memory allocation
- System/38
- Protected mode, a x86's name of virtual memory addressing
References
1. ^ Cragon, Harvey G. (1996), Memory Systems and Pipelined Processors, Jones and Bartlett Publishers, pp. 113, ISBN 0867204745, <[1]
2. ^ Denning, Peter (1997). "Before Memory was Virtual". In the Beginning: Recollections of Software Pioneers.
2. ^ Denning, Peter (1997). "Before Memory was Virtual". In the Beginning: Recollections of Software Pioneers.
- John L. Hennessy, David A. Patterson, Computer Architecture, A Quantitative Approach (ISBN 1-55860-724-2)
- Virtual Memory Secrets by Murali
External links
- Linux Memory Management
- Linux Kernel Mailing List Discussion
- Pointers to virtual memory visualizations
Virtual Memory is a game show broadcast on Trinity Broadcasting Network. It has been on the air since 2000. It is hosted by Jamie Alexander. All questions on Virtual Memory are related to the Bible.
..... Click the link for more information.
..... Click the link for more information.
computer is a machine which manipulates data according to a list of instructions.
Computers take numerous physical forms. The first devices that resemble modern computers date to the mid-20th century (around 1940 - 1941), although the computer concept and various machines
..... Click the link for more information.
Computers take numerous physical forms. The first devices that resemble modern computers date to the mid-20th century (around 1940 - 1941), although the computer concept and various machines
..... Click the link for more information.
An operating system (OS) is the software that manages the sharing of the resources of a computer. An operating system processes system data and user input, and responds by allocating and managing tasks and internal system resources as a service to users and programs of the
..... Click the link for more information.
..... Click the link for more information.
DOS (from Disk Operating System) commonly refers to the family of closely related operating systems which dominated the IBM PC compatible market between 1981 and 1995 (or until about 2000, if Windows 9x systems are included): DR-DOS, FreeDOS, MS-DOS, Novell-DOS, OpenDOS, PC-DOS,
..... Click the link for more information.
..... Click the link for more information.
Mainframes (often colloquially referred to as Big Iron) are computers used mainly by large organizations for critical applications, typically bulk data processing such as census, industry and consumer statistics, ERP, and financial transaction processing.
..... Click the link for more information.
..... Click the link for more information.
paging, sometimes called swapping, is a transfer of pages between main memory and an auxiliary store, such as hard disk drive.[1] Paging is an important part of virtual memory implemention in most contemporary general-purpose operating systems, allowing to easily
..... Click the link for more information.
..... Click the link for more information.
In a general computing sense, overlaying means "replacement of a block of stored instructions or data with another"[1] Overlaying is a programming method that allows programs to be larger than the central processing unit's main memory.
..... Click the link for more information.
..... Click the link for more information.
In computer science, a memory address is a unique identifier for a memory location at which a CPU or other device can store a piece of data for later retrieval. In modern byte-addressable
..... Click the link for more information.
..... Click the link for more information.
An operating system (OS) is the software that manages the sharing of the resources of a computer. An operating system processes system data and user input, and responds by allocating and managing tasks and internal system resources as a service to users and programs of the
..... Click the link for more information.
..... Click the link for more information.
Multitasking may refer to any of the following:
..... Click the link for more information.
- Computer multitasking - the apparent simultaneous performance of two or more tasks by a computer's central processing unit.
..... Click the link for more information.
Virtual address space (abbreviated VAS) is a memory mapping mechanism available in modern operating systems such as OpenVMS, UNIX, Linux, and Windows NT.
..... Click the link for more information.
Overview
..... Click the link for more information.
The generic term x86 refers to the "CISC" type instruction set of the most commercially successful CPU architecture[1] in the history of personal computing, used in processors from Intel, AMD, VIA, and others.
..... Click the link for more information.
..... Click the link for more information.
In a context of computer virtual memory, a page, memory page, or virtual page is a fixed-length block of main memory, that is contiguous in both physical memory addressing and virtual memory addressing.
..... Click the link for more information.
..... Click the link for more information.
paging, sometimes called swapping, is a transfer of pages between main memory and an auxiliary store, such as hard disk drive.[1] Paging is an important part of virtual memory implemention in most contemporary general-purpose operating systems, allowing to easily
..... Click the link for more information.
..... Click the link for more information.
paging, sometimes called swapping, is a transfer of pages between main memory and an auxiliary store, such as hard disk drive.[1] Paging is an important part of virtual memory implemention in most contemporary general-purpose operating systems, allowing to easily
..... Click the link for more information.
..... Click the link for more information.
In a context of computer virtual memory, a page, memory page, or virtual page is a fixed-length block of main memory, that is contiguous in both physical memory addressing and virtual memory addressing.
..... Click the link for more information.
..... Click the link for more information.
page fault is an interrupt (or exception) to the software raised by the hardware, when a program accesses a page that is mapped in address space, but not loaded in physical memory.
The hardware that detects this situation is the memory management unit in a processor.
..... Click the link for more information.
The hardware that detects this situation is the memory management unit in a processor.
..... Click the link for more information.
The PDP-11 was a series of 16-bit minicomputers sold by Digital Equipment Corp. in the 1970s and 1980s. The PDP-11 was a successor to DEC's PDP-8 computer in the PDP series of computers. It had several uniquely innovative features, and was easier to program than its predecessors.
..... Click the link for more information.
..... Click the link for more information.
Segmentation is one of the most common ways to achieve memory protection; another common one is paging. Segmentation means that a part or parts of the memory will be sealed off from the currently running process, through the use of hardware registers.
..... Click the link for more information.
..... Click the link for more information.
A memory management unit (MMU), sometimes called paged memory management unit (PMMU), is a computer hardware component responsible for handling accesses to memory requested by the central processing unit (CPU).
..... Click the link for more information.
..... Click the link for more information.
A Translation Lookaside Buffer (TLB) is a CPU cache that is used by memory management hardware to improve the speed of virtual address translation. A TLB has a fixed number of slots containing page table entries, which map virtual addresses onto physical addresses.
..... Click the link for more information.
..... Click the link for more information.
Memory protection is a way for controlling memory usage on a computer, and is core to virtually every OS. The main purpose of memory protection is to prevent processes on an operating system from accessing the memory of other processes.
..... Click the link for more information.
..... Click the link for more information.
hierarchical protection domains,[1][2] often called protection rings, are a mechanism to protect data and functionality from faults (fault tolerance) and malicious behaviour (computer security).
..... Click the link for more information.
..... Click the link for more information.
In a general computing sense, overlaying means "replacement of a block of stored instructions or data with another"[1] Overlaying is a programming method that allows programs to be larger than the central processing unit's main memory.
..... Click the link for more information.
..... Click the link for more information.
In computing, multitasking is a method by which multiple tasks, also known as processes, share common processing resources such as a CPU. In the case of a computer with a single CPU, only one task is said to be running
..... Click the link for more information.
..... Click the link for more information.
In computing, multitasking is a method by which multiple tasks, also known as processes, share common processing resources such as a CPU. In the case of a computer with a single CPU, only one task is said to be running
..... Click the link for more information.
..... Click the link for more information.
The PDP-10 was a computer manufactured by Digital Equipment Corporation (DEC) from the late 1960s on; the name stands for "Programmed Data Processor model 10". It was the machine that made time-sharing common; it looms large in hacker folklore because of its adoption in the 1970s
..... Click the link for more information.
..... Click the link for more information.
System/360 Model 65 operator's console, with register value lamps and toggle switches (middle of picture) and "emergency pull" switch (upper right).]] The IBM System/360 (S/360) is a mainframe computer system family announced by IBM on April 7, 1964.
..... Click the link for more information.
..... Click the link for more information.
The PDP-10 was a computer manufactured by Digital Equipment Corporation (DEC) from the late 1960s on; the name stands for "Programmed Data Processor model 10". It was the machine that made time-sharing common; it looms large in hacker folklore because of its adoption in the 1970s
..... Click the link for more information.
..... Click the link for more information.
The University of Manchester is a university located in Manchester, England. With over 40,000 students studying 500 academic programmes, more than 10,000 staff and an annual income of nearly £600 million it is the largest single-site University in the United Kingdom and receives
..... Click the link for more information.
..... Click the link for more information.
This article is copied from an article on Wikipedia.org - the free encyclopedia created and edited by online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of the wikipedia encyclopedia articles provide accurate and timely information please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.
Herod_Archelaus