Each process also has a protection key value associated with it. Protection keysĪ protection key mechanism divides physical memory up into blocks of a particular size (e.g., 4 kiB), each of which has an associated numerical value called a protection key. On some systems, the page fault mechanism is also used for executable space protection such as W^X. This scheme, known as swapped virtual memory, allows in-memory data not currently in use to be moved to disk storage and back in a way which is transparent to applications, to increase overall memory capacity. This way, the application receives the memory page as needed. Page faults are used not only for memory protection, but also in another interesting way: the OS may intercept the PF, and may load a page that has been previously swapped out to disk, and resume execution of the application which had caused the page fault. Unallocated pages, and pages allocated to any other application, simply do not have any addresses from the application point of view.Īs a side note, a PF may not be a fatal occurrence. Page tables make it easier to allocate new memory, as each new page can be allocated from anywhere in physical memory.īy such design, it is impossible for an application to access a page that has not been explicitly allocated to it, simply because any memory address, even a completely random one, that application may decide to use, either points to a page allocated to that application, or generates a page fault (PF). The page table is usually invisible to the process. Most computer architectures based on pages, most notably x86 architecture, also use pages for memory protection.Ī page table is used for mapping virtual memory to physical memory. Virtual memory makes it possible to have a linear virtual memory address space and to use it to access blocks fragmented over physical memory address space. Using a virtual memory mechanism, each page can be made to reside in any location of the physical memory, or be flagged as being protected. In paging, the memory address space is divided into equal, small pieces, called pages.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |