Memory protection



         


Memory protection is a system that prevents one process from corrupting the memory of another process running on the same computer at the same time. It usually employs hardware (i.e. a Memory management unit) and system software to allocate distinct memory to different processes and to handle exceptions arising when a process tries to access memory outside its bounds.

There are different ways to achieve memory protection. Segmentation and paging are the most common methods.

If the process is accessing a virtual memory location that is not mapped by the page table, a page fault will appear. Page faults could mean either that the process has tried to access memory that it should not have access to, or that part of the applications memory has been swapped out. In the last case, the page will be swapped back in and execution will proceed where it stopped.

If both paging and segmentation are used at the same time, as in the IA-32 architecture, paging does not map into physical memory at once, but goes through a linear memory stage first. Linear memory is the memory as seen solely by the processors segmentation circuitry, or as if the pages were turned off but the segmentation was still active.

It is important to note that virtual memory is not the same as RAM, that linear memory is a hardware register-defined part of the RAM and that physical memory more or less is the equivalent of RAM. Physical memory is actually both RAM and memory mapped I/O-ports.

The first widely used operating systems with protected memory were variants of Unix.





  View Live Article   This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License