[試題] 102下 薛智文 作業系統 期末考

作者: ibetrayall   2014-06-26 23:09:26
課程名稱︰作業系統
課程性質︰必帶
課程教師︰薛智文
開課學院:電資學院
開課系所︰資訊系
考試日期(年月日)︰103/6/18
考試時限(分鐘):9:10 ~ 12:10
是否需發放獎勵金:是
(如未明確表示,則不予發放)
試題 :
This is an open-book and open-own-note exam. Please do answer with your
own words in the ORDER of question number. Provide your own question definition
if you feel it is not clear enough. Points will be deducted if your answer is
difficult to read. You can write in Chinese and keep this paper. Have a nice
summer vacation.
1.[10%] Please describe how to set the niceness values for the scheduling
algorithms FIFO, RR, and, SJF. [3*2%] In Linux, why can't we get the desired
scheduling under some circumstances? Please give two examples and explain
why? [4%]
2.[10%] When implementing blocking I/O in a kernel module, it is common to
establish a shared data buffer between kernel threads and user processes.
Please describe how we can use wait_event to ensure the correct behavior
even if there are no data available in the buffer.[5%] What's the difference
between wait_event and wait_event_interruptible?[5%]
3.[10%] In Linux, a file can be mapped into memory via the system call mmap.
Please describe an efficient implementation exploiting demand paging and data
buffer to minimize both initialization time and access time.[5%] Suppose a
file is mapped into two different address spaces with the flag MAP_PRIVATE
at the same time. How can we make sure that any updates to the mapped memory
region in one process are invisible to other processes, and are not carried
through to the underlying file? Please explain your solution with an example.
[5%] Hint:
void *mmap(void *addr, size_t length, int prot, int flags,
int fd, off_t offset);
4.[10%] Find a save (from deadlock) sequence if any.[5%] Find the maximal
request of P_4 that can be granted at current stage.[5%]
Allocation Need Available
A B C A B C A B C
P_0 0 1 0 7 4 3 3 3 1
P_1 3 0 1 5 0 0
P_2 3 0 2 0 4 0
P_3 2 2 1 1 2 0
P_4 0 0 2 3 4 1
5.[10%] Why Raid(1+0) is preferable than Raid(0+1)?[5%] How Raid technologies
can be extended to wireless broadcast systems?[5%]
6.[20%] Memory management and (disk) storage management use similar
technologies.
a. List 3 common ones.[1,2,2%]
b. Describe 3 technologies which are better used in one management but not
in the other, with reasons.[3*5%]
7. [20%] In Project 2, we need to guarantee the following orders.
● The slave program will be executed only after both device modules
have been loaded
● The master program will be executed only after the master device
module has been loaded
● In the slave program, it first set the IP address and then begin
reading data from the slave device with blocking I/O.
a. Why do we guarantee them in device driver instead of in applications?[5%]
b. What happen if they are not guaranteed?[5%] Hint: Can the master and
slave still be connected?
c. Can implementation by asynchronous I/O outperform synchronous I/O?[5%]
d. What is the difference between nonblocking I/O and asynchronous I/O?[5%]
8. [20%] For a multiprogramming system with many process, when a process need
I/O operation, it will send a system call to the operating system, but if
the controller is busy, the process will be placed in the disk queue,
allowing the operating system to choose. There are some common disk
scheduling algorithms: FCFS, SSTF, SCAN, C-SCAN, LOOK, C-LOOK
a. Suppose there is the total of 200 cylinders on the disk, if it requests
continuous read and write 110, 60, 120, 131, 70, 111, 130. Try to find
which scheduling's disk arm moves the least distance? (Head start on 50th
track, the default direction is the direction of increasing)[7%]
b. When the operating system reads the track which is evenly distributed,
try to analyze the performance of SCAN and C-SCAN? [4%]
c. What application is mostly suitable using FCFS, SSTF, C-SCAN,
respectively? Why?[3*3%]

Links booklink

Contact Us: admin [ a t ] ucptt.com