您好,欢迎来到爱go旅游网。
搜索
您的当前位置:首页操作系统复习题

操作系统复习题

来源:爱go旅游网


What are the three main purposes of an operating system

What is the main advantage of multiprogramming

What are the main differences between operating systems for mainframe computers and personal computers

Define the essential properties of the following types of operating systems:

a. Batch

b. Interactive

c. Time sharing

d. Real time

e. Network

f. Distributed

How does the distinction between monitor mode and user mode function as a rudimentary (基本的)form of protection (security) system

What are the differences between a trap and an interrupt What is the use of each function

For what types of operations is DMA useful Explain your answer.

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 that large and eliminate the device

What are the five major activities of an operating system in regard to process management

What are the three major activities of an operating system in regard to memory management

What are the three major activities of an operating system in regard to secondary-storage management

What are the five major activities of an operating system in regard to file management

What is the purpose of the command interpreter Why is it usually separate from the kernel

What is the purpose of system calls

What is the main advantage of the layered approach to system design

What are the main advantages of the microkernel approach to system design

Describe the differences among short-term, medium-term, and long-term scheduling.

Describe the actions a kernel takes to context switch between processes.

Provide two programming examples of multithreading giving improved performance over a single-threaded solution.

Provide two programming examples of multithreading that would not improve performance over a single-threaded solution.

What are two differences between user-level threads and kernel-level threads Under what circumstances is one type better than the other

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 processor, how many possible different schedules are there Give a formula in terms of n.

Define the difference between preemptive and nonpreemptive scheduling. State why strict nonpreemptive scheduling is unlikely to be used in a computer

center.

Consider the following set of processes, with the 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 2

The 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 nonpreemptive 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. Which of the schedules in part a results in the minimal average waiting time (over all processes)

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 decisions on the information you have at the time the decision must be made.

Process Arrival Time Burst Time

P1 8

P2 4

P3 1

a. 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 scheduling 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 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 to compute the turnaround times. FCFS is 11 if you forget to subtract arrival time.

What advantage is there in having different time-quantum sizes on different levels of a multilevel queueing system

Explain the differences in the degree to which the following scheduling algorithms discriminate in favor of short processes:

a. FCFS

b. RR

c. Multilevel feedback queues

List three examples of deadlocks that are not related to a computer-system environment.

Is it possible to have a deadlock involving only one single process Explain your

answer.

Consider a system consisting of four resources 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.

Consider the following snapshot of a system:

Answer the following questions using the banker’s algorithm:

a. What is the content of the matrix Need

b. Is the system in a safe state

c. If a request from process P1 arrives for (0,4,2,0), can the request be granted immediately

Explain the difference between internal and external fragmentation.

Describe the following allocation algorithms:

a. First fit

b. Best fit

c. Worst fit

Given memory partitions of 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

Why are page sizes always powers of 2

Consider a logical address space of eight pages of 1024 words each, mapped onto a physical

memory of 32 frames.

a. How many bits are there in the logical address

b. How many bits are there in the physical address

Consider a paging system with the page table stored in memory.

a. If a memory reference takes 200 nanoseconds, 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 the entry is there.)

Consider the following segment table:

What are the physical addresses for the following logical addresses

a. 0,430

b. 1,10

c. 2,500

d. 3,400

e. 4,112

Under what circumstances do page faults occur Describe the actions taken by the operating

system when a page fault occurs.

Assume 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 page 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 . Explain how the system establishes the corresponding physical location. Distinguish between software and hardware operations.

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 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

Consider the following page 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 fault each.

LRU replacement

FIFO replacement

Optimal replacement

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

Consider a file system where a file can be deleted and its disk space reclaimed 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

Explain the purpose of the open and close operations.

Give an example of an application in which data in a file should be accessed in the following order:

a. Sequentially

b. Randomly

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.

Consider a system 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

How do caches help improve performance Why do systems not use more or larger caches if they are so useful

Consider the following I/O scenarios on a single-user PC.

a. A mouse used with a graphical user interface

b. A tape drive on a multitasking operating system (assume no device preallocation is available)

c. A disk drive containing user files

d. A graphics card with direct bus connection, accessible through memory-mapped I/O

For each of these I/O scenarios, would you design the operating system to use buffering, spooling, caching, or a combination Would you use polled I/O, or interrupt-driven I/O Give reasons for your choices.

What are the main differences between capability lists and access lists

What is the need-to-know principle Why is it important for a protection system to adhere to this principle

19.1 A password may become known to other users in a variety of ways. Is there a simple method for detecting that such an event has occurred Explain your answer.

The list of all passwords is kept within the operating system. Thus, if a user manages to read this list, password protection is no longer provided. Suggest a scheme that will avoid this problem. (Hint: Use different internal and external representations.)

让两个进程来实现如图所示的任务。其中进程P1依次运行S1,S2,S4,S5,S7子任务,进程P2依次运行S3,S6子任务。请使用PV操作实现两进程间的同步。请说明信号量初值。

答:可以用信号量描述如下(3分):

semaphore s13,s46,s67;

s13=0;s46=0;s67=0;//信号量初值都设置为0

进程P1程序框架如下:

……

S1;

V(s13);

S2;

S4;

V(s46);

S5;

P(s67);

S7

……

进程P2程序框架如下:

……

P(s13)

S3;

P(46);

S6;

V(67);

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- igat.cn 版权所有

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务