操作系统:分页问题

发布于 2024-11-05 01:17:56 字数 356 浏览 4 评论 0原文

我有一个正在尝试回答的问题,该问题给出了以下情况:

16K 页 32位虚拟地址 512MB 硬盘,可寻址 16K 扇区 当前正在运行 8 个进程

我被问到:

i) 需要多少个进程页表?

我认为这是一个棘手的问题?答案肯定是 1。

ii) 如果进程地址寄存器 PAR 最大可以达到 32 位,那么这台机器可以支持的最大物理内存量是多少?

iii)如果安装了 64MB 物理内存,进程表中的每个条目应该有多宽?

请有人给我关于最后两个部分的帮助/提示,​​因为我真的很困惑?谢谢!

I have a question that I am trying to answer that gives the following situation:

16K Pages
32-bit Virtual Addresses
512MB hard disk, sector-addressable with 16K sectors
8 processes currently running

I am asked:

i) How many process page tables are required?

I think this is a trick question? Surely the answer is just 1.

ii) If a process address register PAR can be up to 32 bits, what is the maxmimum amount of physical memory that can be supported on this machine?

iii) How wide in bits should each entry in a process table be if 64MB physical memory is installed?

Please could anyone give me help/hint with the last two parts as I'm really stuck on them? Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

堇色安年 2024-11-12 01:17:56

如果你今天晚些时候考试前看这里,那是因为它不是指进程地址寄存器,而是指页面地址寄存器!

尝试查看 http://cseweb.ucsd.edu/classes/fa03/cse120/ Lec08.pdf 了解更多信息,包括有关分段和分页组合的帮助

此外,IC 图书馆中名为 Operating Systems Concepts 的书(代码为 005.43SIL)表示每个进程都有自己的进程页表,甚至可以自行分段!

i) 我说的是 8

ii) 好吧,页表中具有 14 位偏移量的 32 位虚拟内存寻址(2^14 = 16K 页长)意味着页号还剩下 18 位。在 32 位 PAR 中,这意味着 14 位用于页面位置。如果将页面位置的数量乘以页面大小,则得到 2^14 * 2^14 = 2^18,即 256MB RAM

iii) 我得到 30 位。 64MB 是 2^26 除以页面大小,即 2^26/2^14 = 2^12,这意味着页面位置有 12 位。根据 (ii),我计算出页号的虚拟内存地址中还剩下 18 位,这意味着它应该是 30 位宽。我还发表了评论,因为它应该是字节对齐的,所以可以使用额外的 2 位,以便我们知道它是否已被写入以及当前是否存储在磁盘上。

希望这有帮助!

In case you look on here before the exam later today, it is because it doesn't mean Process address register, it means Page address register!

Try looking at http://cseweb.ucsd.edu/classes/fa03/cse120/Lec08.pdf for some more information including help about segmentation and paging combined

Also, the book in the IC library called Operating Systems concepts with code 005.43SIL says that each process has it's own process page table and can even be segmented itself!

i) I said 8

ii) Well, 32 bits of virtual memory addressing with 14 bits of offset in the page table (2^14 = 16K page length) means there are 18 bits left for the page number. In 32 bits of PAR, this means 14 bits for the page location. If you multiple the amount of page locations by the page size, you get 2^14 * 2^14 = 2^18 which is 256MB of RAM

iii) I got 30 bits. 64MB is 2^26 divided by the page size is 2^26/2^14 = 2^12 which means 12 bits for the page location. From (ii) I calculated that 18 bits are left in the virtual memory address for the page number meaning that it should be 30 bits wide. I also put a comment that since it should be byte-aliged maybe the extra 2 bits can be used so that we know whether it has been written to and whether it is currently being stored on the disk.

Hope this helps!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文