LRU:
? Replaces the page that has not been referenced for the longest time
替换主存中上次使用距当前最远的页
? By the principle of locality, this should be the page least likely to be referenced in
the near future根据局部性原理,这也是最近最不可能访问到的页
? Each page could be tagged with the time of last reference. This would require a great
deal of overhead 每一页添加一个最后一次访问的时间标签,就需要额外的开销
CLOCK:
? Additional bit called a use bit附加位称为使用位
? When a page is first loaded in memory, the use bit is set to 1
当某一页首次装入主存中时,该帧的使用位设置为1
? When the page is referenced, the use bit is set to 1
当该页随后被访问到时,它的使用位也被置为1
? When it is time to replace a page, the first frame encountered with the use bit set to
0 is replaced.
当需要替换一页时,选择遇到的第一个使用位为0的帧替换。
? During the search for replacement, each use bit set to 1 is changed to 0
在查找替换页的时候,所有使用位为1的帧被重置为0.
12.What is preemptive or nonpreemptive scheduling decision mode?
1、preemptive抢占:一旦进程处于运行状态,它就不断执行直到终止。或者因为等待I/O,或者因
为请求某些操作系统服务而阻塞自己。
2、nonpreemptive非抢占:当前正在运行的进程可能被操作系统中断,并转移到就绪态。
3、与非抢占策略相比,抢占策略可能导致较大的开销,但是可能对所有进程提供较好的服务。 How to compute turnaround time in different short-term scheduling algorithms?、
turnaround time周转时间(Tr)=等待时间+服务时间Ts(也即完成时间-到达时间)
ABCDE周转时间分别为:3,7,9,12,12
其它调度策略的图英文版P403,中文版P289,考试可能会让画图或者求时间。大家有时间也理解下其它的。
13.Why Disk cache is usually used in operating system?
一些写出的数据也许下次会被访问到,使这些数据能迅速地从软件设置的磁盘高速缓存中取出,而不是缓慢的从磁盘中取出。
14.Disk arm scheduling algorithms磁盘调度算法(11章) 1、先进先出(FIFO) 2、SCAN扫描
3、C-SCAN循环扫描 4、RAID独立磁盘冗余阵列
15.What is Absolute path or relative path?
Absolute path绝对路径:从根目录开始做起点的路径。 relative path相对路径:从当前目录开始做起点的路径。
Explain how file pathname /usr/ast/mbox is be parsed(解析) in Unix SVR4?
路径解析:
6 usr 1、从根目录读内容,取出目录项
2、读索引结点i—node6的内容,从属性内容中判断出usr为目录 3、从索引结点i—node6中找到第一个块地址132 4、读地址为132的块信息,取出目录项 26 ast 5、读索引结点i—node26的内容,从属性内容中判断出ast为目录 6、从索引结点i—node26中找到第一个块地址406 7、读地址为406的块信息,取出目录项 60 mbox 8、读索引结点i—node406的内容,从属性内容中判断出mbox为文件,结束搜索
16.Consider a UNIX-style i-node with 10 direct pointers, one single-indirect pointer, and one double-indirect pointer. Assume that the disk block size is 1 Kbytes, and that the size of a disk block address is 4 bytes. How large a file can be indexed using such an i-node?
disk block size is 1 Kbytes:一块1KB
4 bytes=4*8=32位,所以一级间接是2^32块,二级则平方一次即可。
文件的容量如下表:
级 块数 字节数 直接 10 10KB 一级间接 2^32=256 256KB 二级间接 256*256=64k 64MB