现代操作系统第四版第三章部分习题(英文)

绝大部分是上课期间的作业,可能后续会有补充,也可能没有
部分内容有参考(包括博客,随书的参考资料,课程资料等等),部分内容是自己写的

另,因为课程要求,所以作为作业上交的部分是用英文完成的,后续补充用英文还是中文看心情叭hhh
操作系统的初学者,如有疏漏或错误,欢迎指正 (^ _ ^)

2.In Fig. 3-3 the base and limit registers contain the same value, 16,384. Is
this just an accident, or are they always the same? It is just an accident, why are they the same in this example?

现代操作系统第四版第三章部分习题(英文)It is just an accident. When a process is run, the base register is loaded with the physical address where its program begins in memory and the limit register is loaded with the length of the program. Programs can be loaded anywhere and of any length. The base and limit registers containing the same value is just an accident.

5.What is the difference between a physical address and a virtual address?
A physical address is the absolute address or actual location in the main memory. A virtual address is the logical address of a process’s address space. Thus a computer with a 32-bit word can generate up to 4 GB of virtual addresses, regardless of whether the computer’s memory is greater or less than 4 GB.

24.A machine has 48-bit virtual addresses and 32-bit physical addresses. Pages are 8 KB. How many entries are needed for a single-level linear page table?
235

34.A student has claimed that ‘‘in the abstract, the basic page replacement algorithms (FIFO, LRU, optimal) are identical except for the attribute used for selecting the page to be replaced.’’
(a) What is that attribute for the FIFO algorithm? LRU algorithm? Optimal algorithm? (b) Give the generic algorithm for these page replacement algorithms.
(a) FIFO: load time LUR: recent access time Optimal:recent access time in the future
(b) It conations labeling algorithm and replacement algorithm. The labeling algorithm uses the attributes given in (a) to mark each page from small to large, replacement algorithm deletes the page with the smallest label.

36.A computer has four page frames. The time of loading, time of last access, and the R and M bits for each page are as shown below (the times are in clock ticks):

Page Loaded Last ref. R M
0 126 280 1 0
1 230 265 0 1
2 140 270 0 0
3 110 285 1 1

(a)Which page will NRU replace?
(b)Which page will FIFO replace?

(c)Which page will LRU replace?
(d)Which page will second chance replace?

(a)NRU will replace page 2
(b)FIFO will replace page 3
(c)LRU will replace page 1
(d)second chance will replace page 2

48.Can you think of any situations where supporting virtual memory would be a bad idea, and what would be gained by not having to support virtual memory? Explain.
General virtual memory is not needed when the memory requirements of all application are well known and controlled. Some examples are special-purpose processors (e.g., network processors), embedded processors, and super-computers (e.g., airplane wing design). In these situations, we should always consider the possibility of using more real memory. If the operating system did not have to support virtual memory, the code would be much simpler and smaller. On the other hand, some ideas from virtual memory mat still be profitably exploited, although with different design requirements. For example, program/thread isolation might be paging to
flash memory.