1、操作系统复习题1.1 What are the three main purposes of an operating system?1.3 What is the main advantage of multiprogramming?1.4 What are the main differences between operating systems for mainframe computers and personal computers?1.6 Define the essential properties of the following types of operating sys
2、tems:a.Batchb.Interactivec.Time sharingd.Real timee.Networkf.Distributed2.2 How does the distinction between monitor mode and user mode function as a rudimentary (基本的)form of protection (security) system?2.3 What are the differences between a trap and an interrupt? What is the use of each function?2
3、.4 For what types of operations is DMA useful? Explain your answer.2.9 Give two reasons why caches are useful. What problems do they solve? What problems do they cause? If a cache can be made as large as the device for which it is caching (for instance, a cache as large as a disk), why not make it t
4、hat large and eliminate the device?3.1 What are the five major activities of an operating system in regard to process management?3.2 What are the three major activities of an operating system in regard to memory management?3.3 What are the three major activities of an operating system in regard to s
5、econdary-storage management?3.4 What are the five major activities of an operating system in regard to file management?3.5 What is the purpose of the command interpreter? Why is it usually separate from the kernel?3.7 What is the purpose of system calls?3.11 What is the main advantage of the layered
6、 approach to system design?3.12 What are the main advantages of the microkernel approach to system design?4.2 Describe the differences among short-term, medium-term, and long-term scheduling.4.4 Describe the actions a kernel takes to context switch between processes.5.1 Provide two programming examp
7、les of multithreading giving improved performance over a single-threaded solution.5.2 Provide two programming examples of multithreading that would not improve performance over a single-threaded solution.5.3 What are two differences between user-level threads and kernel-level threads? Under what cir
8、cumstances is one type better than the other?5.6 What resources are used when a thread is created? How do they differ from those used when a process is created?6.1 A CPU scheduling algorithm determines an order for the execution of its scheduled processes. Given n processes to be scheduled on one pr
9、ocessor, how many possible different schedules are there? Give a formula in terms of n.6.2 Define the difference between preemptive and nonpreemptive scheduling. State why strict nonpreemptive scheduling is unlikely to be used in a computer center.6.3 Consider the following set of processes, with th
10、e length of the CPU-burst time given in milliseconds: Process Burst Time Priority P1 10 3 P2 1 1 P3 2 3 P4 1 4 P5 5 2The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0.a. Draw four Gantt charts illustrating the execution of these processes using FCFS, SJF,a nonp
11、reemptive priority (a smaller priority number implies a higher priority), and RR (quantum = 1) scheduling.b. What is the turnaround time of each process for each of the scheduling algorithms in part a?c. What is the waiting time of each process for each of the scheduling algorithms in part a?d. Whic
12、h of the schedules in part a results in the minimal average waiting time (over all processes)?6.4 Suppose that the following processes arrive for execution at the times indicated. Each process will run the listed amount of time. In answering the questions, use nonpreemptive scheduling and base all d
13、ecisions on the information you have at the time the decision must be made. Process Arrival Time Burst Time P1 0.0 8 P2 0.4 4 P3 1.0 1a.What is the average turnaround time for these processes with the FCFS scheduling algorithm?b.What is the average turnaround time for these processes with the SJF sc
14、heduling algorithm?c.The SJF algorithm is supposed to improve performance, but notice that we chose to run process P1 at time 0 because we did not know that two shorter processes would arrive soon. Compute what the average turnaround time will be if the CPU is left idle for the first 1 unit and then
15、 SJF scheduling is used. Remember that processes P1 and P2 are waiting during this idle time, so their waiting time may increase. This algorithm could be known as future-knowledge scheduling.Remember that turnaround time is finishing time minus arrival time, so you have to subtract the arrival times
16、 to compute the turnaround times. FCFS is 11 if you forget to subtract arrival time.6.6 What advantage is there in having different time-quantum sizes on different levels of a multilevel queueing system?6.10 Explain the differences in the degree to which the following scheduling algorithms discrimin
17、ate in favor of short processes:a. FCFSb. RRc. Multilevel feedback queues8.1 List three examples of deadlocks that are not related to a computer-system environment.8.2 Is it possible to have a deadlock involving only one single process? Explain your answer.8.8 Consider a system consisting of four re
18、sources of the same type that are shared by three processes, each of which needs at most two resources. Show that the system is deadlock-free.8.13 Consider the following snapshot of a system:Answer the following questions using the bankers algorithm:a.What is the content of the matrix Need?b.Is the
19、system in a safe state?c.If a request from process P1 arrives for (0,4,2,0), can the request be granted immediately?9.2 Explain the difference between internal and external fragmentation.9.3 Describe the following allocation algorithms:a. First fitb. Best fitc. Worst fit9.5 Given memory partitions o
20、f 100K, 500K, 200K, 300K, and 600K (in order), how would each of the First-fit, Best-fit, and Worst-fit algorithms place processes of 212K, 417K, 112K, and 426K (in order)? Which algorithm makes the most efficient use of memory?9.7 Why are page sizes always powers of 2?9.8 Consider a logical address
21、 space of eight pages of 1024 words each, mapped onto a physicalmemory of 32 frames.a. How many bits are there in the logical address?b. How many bits are there in the physical address?9.10 Consider a paging system with the page table stored in memory.a. If a memory reference takes 200 nanoseconds,
22、how long does a paged memory reference take?b. If we add associative registers, and 75 percent of all page-table references are found in the associative registers, what is the effective memory reference time? (Assume that finding a page-table entry in the associative registers takes zero time, if th
23、e entry is there.)9.16 Consider the following segment table:What are the physical addresses for the following logical addresses?a. 0,430b. 1,10c. 2,500d. 3,400e. 4,11210.1 Under what circumstances do page faults occur? Describe the actions taken by the operatingsystem when a page fault occurs.10.2 A
24、ssume a page reference string for a process with m frames (initially all empty). The page reference string has length p with n distinct page numbers occurring in it. For any page-replacement algorithms,a. What is a lower bound on the number of page faults?b. What is an upper bound on the number of p
25、age faults?10.3 A certain computer provides its users with a virtual-memory space of 232 bytes. The computer has 218 bytes of physical memory. The virtual memory is implemented by paging, and the page size is 4096 bytes. A user process generates the virtual address 11123456. Explain how the system e
26、stablishes the corresponding physical location. Distinguish between software and hardware operations.10.5 Assume we have a demand-paged memory. The page table is held in registers. It takes 8 milliseconds to service a page fault if an empty page is available or the replaced page is not modified, and
27、 20 milliseconds if the replaced page is modified. Memory access time is 100 nanoseconds. Assume that the page to be replaced is modified 70 percent of the time. What is the maximum acceptable page-fault rate for an effective access time of no more than 200 nanoseconds?10.11 Consider the following p
28、age reference string:1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6.How many page faults would occur for the following replacement algorithms, assuming one, two, three, four, five, six, or seven frames? Remember all frames are initially empty, so your first unique pages will all cost one
29、 fault each. LRU replacement FIFO replacement Optimal replacement10.20 What is the cause of thrashing? How does the system detect thrashing? Once it detects thrashing, what can the system do to eliminate this problem?11.1 Consider a file system where a file can be deleted and its disk space reclaime
30、d while links to that file still exist. What problems may occur if a new file is created in the same storage area or with the same absolute path name? How can these problems be avoided?11.7 Explain the purpose of the open and close operations.11.9 Give an example of an application in which data in a
31、 file should be accessed in the following order:a. Sequentiallyb. Randomly11.10 Some systems provide file sharing by maintaining a single copy of a file; other systems maintain several copies, one for each of the users sharing the file. Discuss the relative merits of each approach.12.5 Consider a sy
32、stem that supports the strategies of contiguous, linked, and indexed allocation. What criteria should be used in deciding which strategy is best utilized for a particular file?12.9 How do caches help improve performance? Why do systems not use more or larger caches if they are so useful?13.2 Consider the following I/O scenarios on a single-user PC.a. A mouse used with a graphical user interfaceb. A tape drive on a multitasking operating system (a
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1