Paging vs Segmentation
Paging is a memory management method used by operating systems. Paging allows the main memory to use data that is residing on a secondary storage device. These data are stored in the secondary storage device as blocks of same size called pages. Paging allows the operating system to use data that will not fit in to the main memory. Memory segmentation is a method that provides memory protection. Each memory segment is associated with a specific length and a set of permissions. When a process tries to access the memory it is first checked to see whether it has the required permission to access the particular memory segment.
What is Paging?
Paging is a memory management method used by operating systems. Paging allows the main memory to use data that is residing on a secondary storage device. These data are stored in the secondary storage device as blocks of same size called pages. Paging allows the operating system to use data that will not fit in to the main memory. When a program tries access a page, first the page table is checked to see whether that page is on the main memory. Page table holds details about where the pages are stored. If it is not in the main memory, it is called a page fault. Operating system is responsible for handling page faults without showing it to the program. The operating system first finds where that particular page is stored in the secondary storage and then brings it in to an empty page frame in the main memory. Then it updates the page table to indicate that the new data is in the main memory and returns the control back to the program that initially requested the page.
What is Segmentation?
内存分割is a method that provides memory protection. Each memory segment is associated with a specific length and a set of permissions. When a process tries to access the memory it is first checked to see whether it has the required permission to access the particular memory segment and whether it is within the length specified by that particular memory segment. If either of these conditions is not satisfied, a hardware exception is raised. In addition, a segment may also have a flag indicating whether the segment is in the main memory or not. If the segment is not residing in the main memory, an exception will be raised and the operating system will bring the segment from the secondary memory to the main memory.
What is the difference between Paging and Segmentation?
在分页中,内存分为相等的尺寸段,称为页面,而内存段的大小可能有所不同(这就是为什么每个段都与长度属性关联的原因)。段的尺寸是根据过程所需的地址空间确定的,而过程的地址空间则分为分页中相等大小的页面。细分提供了与细分市场相关的安全性,而分页不提供这种机制。
bale30says
thanks