分段分页和分页分段之间的差异或相似之处是什么?

0de*_*al0 25 paging operating-system memory-management memory-segmentation

我正在研究组合的分页/分段系统,在我的书中有两种方法:

1.paged segmentation
2.segmented paging
Run Code Online (Sandbox Code Playgroud)

我无法弄清楚两者之间的区别.我认为在分页分段中,分段被分成页面,在分段分页中,页面被分成段,但我不知道我是对还是错.同时在因特网上,仅使用一种方案来描述组合的寻呼/分段.我无法弄清楚为什么在我的课本中有两种方案.任何帮助将深表感谢.

0de*_*al0 36

So,after vigorously searching on net for the difference or similarity between these two terms,I have come up on a final answer.First of all I would write down the similarities:

  • They both (segmented paging and paged segmentation) are a type of paging/segmentation combined systems (Paging and Segmentation can be combined by dividing each segment into pages).
  • In both the system the segments are divided into pages.

Now to describe the differences I will have to define and describe each term separately:

  • Segmented paging- Segments are divided into pages.Implementation requires STR(segment table register) and PMT(page map table).In this scheme, each virtual address consists of a segment number, page number within that segment and an offset within that page.The segment number indexes into segment table which yields the base address of the page table for that segment.The page number indexes into the page table,each of which entry is a page frame.Adding the PFN(page frame number) and the offset results in the physical address.Hence addressing can be described by the following function :

va = (s,p,w) where, va is the virtual address, |s| determines number of segments (size of ST), |p| determines number of pages per segment (size of PT), |w| determines page size.

address_map(s, p, w)
{
pa = *(*(STR+s)+p)+w;
return pa;
}
Run Code Online (Sandbox Code Playgroud)

The diagram is here:

分段分页

  • Paged Segmentation- Sometimes segment table or page table may too large to keep in physical memory(they can even reach MBs).Therefore,the segment table is divided into pages too and thus a page table of ST pages is created. The segment number is broken into page no.(s1) and page offset(s2) of page table of ST pages.So,the virtual address can be described as :

va = (s1,s2,p,w)

address_map
(s1, s2, p, w)
{
pa = *(*(*(STR+s1)+s2)+p)+w;
return pa;
}
Run Code Online (Sandbox Code Playgroud)

The diagram description is here: 分页分段

  • 想知道这些信息的来源,因为它与[这里]的内容有所不同(http://nob.cs.ucdavis.edu/classes/ecs150-2008-02/handouts/memory/mm-segpag.html ) (3认同)

hex*_*eus 8

分页的最佳特性

事实是,分页有以下好处:

  1. 快速分配(至少比分段快)
  2. 无外部碎片(此方法的最后一页存在内部碎片

细分的最佳特征

但是从细分中也可以看出一个很好的行为:

  1. 分享
  2. 保护

给定的术语可以组合并创建以下术语:

  • 分段分页:虚拟地址空间被分成段。物理地址空间分为页框。
  • 分页分割:使用进程段表的主要分割技术有时会越界!这意味着大小变得太大并且主内存没有足够的空间来保存段表。因此段表和段号被分成页。

分段寻呼的要求

实现分段分页需要采取多个步骤:

  1. 每个段表条目代表一个页表基地址。
  2. STR(段表寄存器)和 PMT(页映射表)填充有所需的值。
  3. 每个虚拟地址由段号页码和该页内的偏移量组成
  4. 段号索引到段表中,它为我们提供了该段的页表基地址
  5. 页码索引到页表中。
  6. 每个页表条目都是一个页框
  7. 通过添加页框号偏移量找到作为物理地址的最终结果。

Paged 分段的要求

在该方案中发生以下步骤:

  1. 每个段条目被分成多个段。
  2. 对于代表页面集合的每个段表条目,创建一个页面表。