operating-system - 使用基址和边界时地址空间大小和“边界”有什么区别?
问题描述
使用的工具:relocation.py
从第 15 章的作业 - 操作系统三个简单的部分(最后一页):
- 使用这些标志运行:-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
,不多不少,但地址空间实际上是从位置x
到y
位置x <= base && y >= base + limit
?
解决方案
推荐阅读
- python - pip 无法安装 install_requires 中列出的软件包
- javascript - 使用带有 AJAX 和 PHP 的 input type="file" 将文件发送到电子邮件
- docker - 更改 amazon/dynamodb-local 端口
- php - MySQL 在当天每天增加一次行值,然后在第二天重置
- c# - 在整个程序中存储记录的适当方式?
- python - 在类中设置默认值
- node.js - serverless.yml 中的运行时变量未设置节点版本
- dns - 是什么导致了 ID 未知的 DNS 响应?
- .net-core - 如何处理重定向到不同 api 版本的请求?
- python - 使用 python 查看 A 和 prev B