分页说明必填 [英] Paging Explanation Required

查看:94
本文介绍了分页说明必填的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试了解分页,并且遇到了一些问题.我发现了一个我无法理解的示例问题,并希望有人可以让我朝正确的方向前进:

I am trying to understand paging and am running into some problems. I've found an example problem that I cannot make sense of, and was hoping that someone could set me in the correct direction:

所讨论的理论系统具有64K(2 ^ 16)字节的内存.页大小为4K字节(2 ^ 12),页表有15个整数.对于理论过程X,页表中的foreach条目有页号,当前/不存在位和页帧号.

The theoretical system in question has 64K (2^16) bytes of memory. The page size is 4K bytes (2^12), and the page table has 15 entires. Foreach entry in the page table for a theoretical process X, there is page number, a present/absent bit, and a page frame number.

我知道,对物理地址的查找使用页面大小作为偏移量,其余的地址空间作为页面帧号.但是,由于没有地址空间号,我很困惑如何计算理论系统上表示物理地址所需的位数.

I understand that the look-up of the physical address uses the page size as the amount devoted to the offset, and the rest of the address space to the page frame number; however, without the address space number, I am confused how I could calculate how many bits are required to represent the physical address on the theoretical system.

为了使事情更复杂,如果我获得最大的地址空间(例如32K字节),我不确定如何表示虚拟地址.给定页表的结构,我觉得它仅仅是地址空间的大小.不过我感觉也不对.

To complicate things further, I am not sure how I would represent the virtual address if I am given the maximum address space (say 32K bytes). Given the structure of the page table, I feel like it would simply be the size of the address space. This doesn't feel right too me though.

任何有助于弄清这些东西如何工作的帮助都将是感激的.我在研究中注意到,您可以通过执行地址空间的大小除以页面大小来计算表条目的数量.我以为这将回答我的问题:要使用多少位来表示物理地址,但随后注意到这一假设是有缺陷的.

Any help to clarify how this stuff works would be appreciative. I noticed in my research that you can calculate the number of table entries by performing the size of the address space divided by the page size. I thought that this would answer my question in re: to how many bits would be used to represent the physical address, but then noticed that assumption would be flawed.

谢谢大家.

MN7

推荐答案

我将尝试回答这个问题.大概,您想知道如何从给定的地址空间编号中得出:

I shall try answering this question. Presumably, you would like to know how, from a given address space number, you can derive:

  1. 为查找页表中的页码而预留的位和
  2. 用于在确定的页面内计算偏移量的位.

这是针对OS的设计决定,您的问题的答案实际上是在确定页面编号和偏移量的位数之前就已经预先确定的.

This is a design decision for the OS and the answer to your question really is determined upfront before you even get down to deciding on the number of bits for page number and offset.

希望这会有所帮助.我愿意接受更好的答案.

Hope this helps. I am open to better answers.

这篇关于分页说明必填的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆