首页 > 解决方案 > 使用基址和边界时地址空间大小和“边界”有什么区别?

问题描述

使用的工具:relocation.py

第 15 章的作业 - 操作系统三个简单的部分(最后一页):

  1. 使用这些标志运行:-s 1 -n 10 -l 100。base 可以设置的最大值是多少,这样地址空间仍然可以完全放入物理内存?

运行时./relocation.py -s 1 -n 10 -l 100我得到这个输出:

ARG seed 1
ARG address space size 1k
ARG phys mem size 16k

Base-and-Bounds register information:

  Base   : 0x00000899 (decimal 2201)
  Limit  : 100

Virtual Address Trace
  VA  0: 0x00000363 (decimal:  867) --> PA or segmentation violation?
  VA  1: 0x0000030e (decimal:  782) --> PA or segmentation violation?
  VA  2: 0x00000105 (decimal:  261) --> PA or segmentation violation?
  VA  3: 0x000001fb (decimal:  507) --> PA or segmentation violation?
  VA  4: 0x000001cc (decimal:  460) --> PA or segmentation violation?
  VA  5: 0x0000029b (decimal:  667) --> PA or segmentation violation?
  VA  6: 0x00000327 (decimal:  807) --> PA or segmentation violation?
  VA  7: 0x00000060 (decimal:   96) --> PA or segmentation violation?
  VA  8: 0x0000001d (decimal:   29) --> PA or segmentation violation?
  VA  9: 0x00000357 (decimal:  855) --> PA or segmentation violation?

For each virtual address, either write down the physical address it translates to
OR write down that it is an out-of-bounds address (a segmentation violation). For
this problem, you should assume a simple virtual address space of a given size.

从输出中,我可以看到这让我ARG address space size 1k感到Limit : 100困惑..

我什至不确定这个问题在问什么。

我可以看到物理内存是 16k,最大基数是否应该是 16k - 1k,以便进程的最大可寻址地址为 16k?但是,在这种情况下,我相信允许的最大地址是 16k - 1k + 100,因为限制是 100...

地址空间中是否存在不可寻址的位置?这意味着我只能从地址base到地址base + bound,不多不少,但地址空间实际上是从位置xy位置x <= base && y >= base + limit

标签: operating-systemvirtual-memory

解决方案


推荐阅读