9.1 Name two differences between logical and physical addresses
邏輯地址不是指實際的實體地址;相反,它指的是抽象位址空間中的抽象位址。實體位址是記憶體中實際的實體位址,邏輯位址由CPU生成,並由記憶體管理單元(MMU)轉換為實體位址。因此,MMU生成實體地址
9.2 Why are page sizes always powers of 2?
分頁是通過將地址拆分為頁和偏移量來實現的。最有效的方法是將地址分解為X頁位和Y偏移位,而不是對地址執行算術運算來計算頁碼和偏移量。因為每個位位置代表2的冪,所以在位之間拆分地址會導致頁面大小為2的冪
9.3 Consider a system in which a program can be separated into two parts: code and data. The CPU knows whether it wants an instruction (instruction fetch) or data (data fetch or store). Therefore, two base –limit register pairs are provided: one for instructions and one for data. The instruction base–limit register pair is automatically read-only, so programs can be shared among different users. Discuss the advantages and disadvantages of this scheme.
該方案的主要優點是它是一種有效的代碼和數據共享機制。例如,只需要在記憶體中保存編輯器或編譯器的一個副本,並且需要訪問編輯器或編譯器代碼的所有process都可以共享此代碼。
另一個優點是保護代碼免受錯誤修改。
唯一的缺點是代碼和數據必須分開,這通常是在編譯器生成的代碼中遵守的。
9.4 Consider a logical address space of 64 pages of 1,024 words each, mapped onto a physical memory of 32 frames. a. How many bits are there in the logical address? b. How many bits are there in the physical address?
a. Logical address: 16 bits
b. Physical address: 15 bits
9.5 What is the effect of allowing two entries in a page table to point to the same page frame in memory? Explain how this effect could be used to decrease the amount of time needed to copy a large amount of memory from one place to another. What effect would updating some byte on one page have on the other page?
通過允許頁表中的兩個條目指向記憶體中的同一頁欄,用戶可以共享代碼和數據。如果代碼是可重入的,那麼通過共享文本編輯器、編譯器和數據庫系統等大型程序可以節省大量記憶體空間。通過讓不同的頁表指向相同的記憶體位置,可以“複製”大量記憶體
然而,共享非進入代碼或數據意味著任何有權訪問代碼的用戶都可以修改它,這些修改將反映在其他用戶的“副本”中。
9.6 Given six memory partitions of 300 KB, 600 KB,