English 中文(简体)
程序页表
原标题:Process Page Tables

I m有兴趣进一步了解虚拟记忆和页面机制,特别是Windows x86系统。 从我从各种在线资源(包括列入SO的其他问题)中收集的资料来看,

(1) 每个过程的单页表都位于同一过程的舱面上。

(2) 每一过程只有一页的表格,包括实际页数(或框架)的虚拟页数。

3) 与特定虚拟地址对应的物理地址由记忆管理股(MMU)计算,其基本方法是将所提供的虚拟地址的前20个轨道作为页表索引,利用该指数检索物理框架的起始地址,然后根据虚拟地址的其余12个参数对该地址适用一些抵消。

Are these three statements correct? Or am I misinterpreting the information?

最佳回答

因此,首先要澄清一些事项:

  1. In the case of the x86 architecture, it is not the operating system that determines the paging policy, it is the CPU (more specifically it s MMU). How the operating system views the paging system is independent of the the way it is implemented. As a commenter rightly pointed out, there is an OS specific component to paging models. This is subordinate to the hardware s way of doing things.
  2. 32 bit and 64 bit x86 processors have different paging schemes so you can t really talk about the x86 paging model without also specifying the word size of the processor.

下面是使用最简单版本的32比特×86版模型的大规模压缩版。 还有许多 t,这是可能的,我知道,各种非洲顾问办利用了它们。 我不去做,因为我不真的熟悉大多数监督厅的内部,而且因为你真的不了解,直到你掌握了更简单的东西。 如果你想要知道x86计算模型的所有可贵的炉子,你可以到英特尔:

在最简单的文字模式中,记忆空间分为4KB区,称为网页。 其中1024个区块被绘制成一个页表(面积为4KB)。 另有一级间接数据,所有1024页的表格被绘制成4KB页的目录,该名录的基面在加工商的特别登记册<代码>%cr3<<>。 这一两级结构已经建立,因为本组织的大多数记忆空间是sparse<>em>,这意味着大多数记忆空间没有使用。 你们不想把一刀切的页桌旁放在一旁,用于记忆。

当你拿到一个记忆地址时,最重要的10个比值指数是页数,这为你提供了页表的基础。 接下来的10个轨道指数进入该页表,以向您提供物理页基数(也称为物理线)。 最后,最后的12个参数指数在框架中。 母亲和母亲部对你来说都是如此,假定你有“条码”>%cr3正确值。

64个轨道系统有4级 日报系统,因为它们的记忆空间更加稀少。 此外,还有可能出现4KB的页数。

To actually get to your questions:

  1. All of this paging information (tables, directories etc) sits in kernel memory. Note that kernel memory is one big chuck and there is no concept of having kernel memory for a single process.
  2. There is only one page directory per process. This is because the page directory defines a memory space and each process has exactly one memory space.
  3. The last paragraph above gives you the way an address is chopped up.

Edit: 清洁和细微改动。

问题回答

总的来说,这非常正确。

If memory serves, a few details are a bit off though:

  1. The paging for the kernel memory doesn t change per-process, so all the page tables are always visible to the kernel.
  2. In theory, there s also a segment-based translation step. Most practical systems (e.g., *BSD, Linux, Windows, OS/X), however, use segments with their base set to 0 and limit set to the address space limit, so this step ends up as essentially a NOP.




相关问题
Fastest method for running a binary search on a file in C?

For example, let s say I want to find a particular word or number in a file. The contents are in sorted order (obviously). Since I want to run a binary search on the file, it seems like a real waste ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Trying to split by two delimiters and it doesn t work - C

I wrote below code to readin line by line from stdin ex. city=Boston;city=New York;city=Chicago and then split each line by ; delimiter and print each record. Then in yet another loop I try to ...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

Encoding, decoding an integer to a char array

Please note that this is not homework and i did search before starting this new thread. I got Store an int in a char array? I was looking for an answer but didn t get any satisfactory answer in the ...