当我在阅读“操作系统概念”(第 7 版)时遇到问题时,我感到很困惑:
在 IBM/370 中,内存保护是通过使用 key 来提供的。 key 是一个 4 位的数量。每个 2K 内存块都有一个与之关联的键(存储键)。 CPU 也有一个与之关联的 key (保护 key )。仅当两个键相等或其中一个为零时才允许存储操作。以下哪些内存管理方案可以成功地用于此硬件?
一种。裸机
湾。单用户系统
C。具有固定数量进程的多道程序
d。具有可变数量进程的多道程序
e.寻呼
F。分割
我对此有一些问题:这些 key 是如何计算的?为什么它提供了另一种“要么为零”的方式,而第一种方式已经看似安全?(我的意思是“要么为零”用于什么情况下,“要么为零”是有效的,而不是匹配两个键来查看如果它们相同。)
最佳答案
免责声明:这不是一个明智的答案,只是一个意见
“要么为零”似乎启用了场景
操作系统“如何计算这些 key ”的答案需要一些考古工作。初始点:
IBM Systems Reference Library, IBM System/360 Principles of Operation
Page 17
System Structure → Protection Features
...When the store-protection feature is installed, attempts to modify storage are monitored... Two instructions -
SET STORAGE KEY
andINSERT STORAGE KEY
- are provided for assigning and inspecting the code in a key. The same code may be used in many keys.A user's right of access to storage is identified by a four-bit protection key. For references caused by the CPU, the protection key in the current PSW is used; access by channels are controlled by the protection key assigned to the associated I/O operation...
也可以看看:
关于memory-management - 如何理解IBM/370的内存保护方案?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27752842/