| 所組別: | 電子工程學系博士班乙組 | 科目: | 系統程式 | 考試時間: | 06月09日第 1節 |
| 一. | Terminology(28%) |
| 1. Critical Section | |
| 2. Semaphore | |
| 3. Internal Fragmentation | |
| 4. Belady's Anomaly | |
| 5. System Call | |
| 6. Context Switch | |
| 7. Light Weight Process |
| 二. | Which of the following are true and which are false ?Justify your answers.(16%) |
| 1. The real time system must be on line and the on line system must be real time. | |
| 2. The response time is the interval between job submission and job completion. | |
| 3. After interrupt processing is complete, the preemptive process has no chance to get CPU at once. | |
| 4. It is impossible to have a deadlock involving only one signal processor. | |
| 5. Pure code is non-self-modifying code, it never changes during execution. | |
| 6. In average, the internal fragmentation is one-half page per process for segmentation with paging system. | |
| 7. The working set is an approximation of the program's locality. | |
| 8. A safe state is not a deadlock state, a deadlock state is an unsafe state, so that all unsafe states are deadlocks. |
| 三. | Why is the definition of operating system as “the software that controls the hardware”is wrong? Please give a better definition.(10%) |
| 四. | Consider the following algorithms, please explain whether it satisfies mutual exclusion, progress, and bounded waiting requirements? Why?(9%) | |
| 1. Suppose that a process interchanges the operators of semaphore as follows
V(S); CRITICAL SECTION P(S); | ||
| 2. Suppose that a process exchanges V(S) with P(S), that is , it executes
P(S); CRITICAL SECTION P(S); | ||
| 3.
repeat while flag[j] do no-op; flag[i]:=true; CRITICAL SECTION flag[i]:=false; until false; |
repeat
while flag[i] do no-op; flag[j]:=true; CRITICAL SECTION flag[j]:=false; until false; | |
| 五. | What is the differences between a trap and interrupt?(9%) |
| 六. | Consider the two-dimensional array Var A: array[1..100,1..100] of integer, And the size of (integer)=2. Where A[1][1] is at location 400, in a paged memory system with page of size 400 bytes. A small process in page 0 (locations 0 to 399) for manipulating the matrix; thus, every instruction fetch will be from page 0. For three page frames, how many page faults are generated by the following array initialization loops, using LRU replacement, and assuming page frame 1 has the process in it, and the other two are initially empty:(8%)
1. for j:=1 to 100 for i:=1 to 100 A[i][j]:=0; 2. for i:=1 to 100 for j:=1 to 100 A[i][j]:=0; |
| 七. | Consider the Dining Philosophers problems, please answer the following questions.(12%) |
| 1. Give at least two answers that can solve deadlock problem? | |
| 2. Which necessary condition can not hold, so that you can prevent the occurrence of deadlock that in question 1. | |
| 3. Give at least two answers that can solve starvation problem? |
| 八. | Answer the following file systemquestions (8%) | |
| 1. | Explain the purpose of the open file and close file operations. | |
| 2. | As we know, some systems require files to be opened explicitly(明顯的); Others make the opening an implicit(不明顯的) part of the first access to each file. Why is explicit file opening more desirable? | |