操作系统期末考试及参考答案

操作系统期末考试及参考答案
操作系统期末考试及参考答案

考试试卷:A√卷、B卷(请在选定项上打√)

考试形式:闭、开√卷(请在选定项上打√),允许带 入场

考试日期: 年 月 日,考试时间: 120 分钟 任任课教师:__

诚信考试,沉着应考,杜绝违纪。

考生姓名:学号:所属院系:_

题序1-701234总分

得分

评卷人

注意:本考卷分P a r t1、P a r t2两部分,第一部分为选择题共70分;第二部分为问答题共30分。选择题答案请填入以下表格,只答在题目上的不给分。问答题答案请写在答题纸上。

题号12345678910 1-10

11-20

21-30

31-40

41-50

51-60

61-70

Part One: Multiple Choice Questions (one mark each.)

Choose the best answer for the following questions. There is only one best answer for each question.

1.Operating systems provide certain levels of interfaces. However, is in general not provided by OS.

A. Application programming interface (API)

B. Command line interpreter

C. Graphic user interface (GUI)

D. System call

2. A distributed system could be _________.

A. A client-server system

B. A peer-to-peer system

C. A clustering system

D. All the above

3.When operating system says Resource, it could be

A.Memory space

B.Global variables

https://www.360docs.net/doc/d52138613.html,work bandwidth

D.All the above

https://www.360docs.net/doc/d52138613.html,pared to the OSes with microkernel, the monolithic counterpart sometimes shows advantage in .

A. Scalability

B. Modularity

C. Performance

D. Readability

5.Which of the functionalities listed below must be supported by the operating system for handheld devices.

A. Batch programming

B. Virtual memory

C. Time sharing

D. Networking

6.Which of the following types of operating systems has the best job throughput ?

A. Time sharing

B. Interactive

C. Batch

D. Real time

7. A CPU scheduler focuses on __________ scheduling.

A. mixture-term

B. short-term

C. medium-term

D. long-term

8.The context-switch causes overhead by OS. The action affects many objects, but is not included.

A. register

B. global variable

C. stack

D. memory

9.Which of the following process state transitions is impossible to happen?

A. from ready state to running state

B. from ready state to waiting state

C. from running state to ready state

D. from waiting state to ready state

10. A process will change its state from “waiting” to “ready” when _____.

A.it has been selected for execution by scheduler

B.the event it had been waiting for has occurred

C.its time slice is finished

D.it waits for some event

11.The main difference between a process and a program is that _________.

A. a process has its life cycle while a program has not.

B. a program has its life cycle while a process has not.

C. a program can own resources while a process cannot.

D. a process can own resources while a program cannot.

https://www.360docs.net/doc/d52138613.html,ing the program shown as following:

#include

#include

#include

int value = 10;

int main() {

pid_t pid;

pid = fork();

value += 10;

if(pid == 0) { /* child process */

value += 5; }

else if (pid > 0) { /* parent process */

wait(NULL);

printf("PARENT: value = %d", value); /* LINE A */

exit(0);

}

}

Which string will be output at Line A?

A. PARENT: value =20

B. PARENT: value =10

C. PARENT: value =15

D. PARENT: value =25

13. A semaphore array in Linux is often used as ______.

A. a kind of direct communication

B. a kind of low-level communication

C. a kind of symmetrical communication

D. a kind of inter-process communication

14.Which of the following statement is true ?

A. Sometimes multithreading does not provide better performance than a single-threaded solution

B. Sometimes multithreading does the same performance as a single-threaded solutio

C. Sometimes multithreading provides better performance than a single-threaded solution

D. All the above are true

15.Threads in a process share the _________.

A. Stack memory

B. Heap memory

C. Register values

D. Global variables

16.In general, multithreading shows some features benefiting user applications. Even though an operating

system does not support multithreading, those features could be brought with by use of __________.

A. One to One Model

B. Kernel level thread

C. User level thread

D. None

17.Which of the following scheduling algorithms could result in starvation ?

A. First come first served

B. Round robin

C. Shortest job first

D. Highest response_ratio next

18.Consider a variant of the RR scheduling algorithm in which the entries in the ready queue are pointers to

the PCBs. If there are two pointers to the same PCB:

A. It would not be the RR algorithm and be illegal.

B. The time slice would have to be adjusted in order to rebalance the CPU load.

C. The pointed process always gains twice the CPU time.

D. The time interrupt should be smart enough which makes the OS kernel more complicated.

19.Suppose the system is dominated by processes with short burst-time, ____ is the most appropriate choice.

A. Multilevel queues

B. Multilevel feedback queues

C. First come first served

D. Round robin

20.Sometimes two scheduling criteria are conflict with each other, and not satisfied both. Which of the

following pairs of scheduling criteria are ALWAYS non-conflicting?

A. CPU utilization and response time

B. Average turnaround time and average waiting time

C. Average turnaround time and maximum waiting time

D. I/O device utilization and CPU utilization

21.Talking about the scheduling for CPU burst cycle vs I/O burst cycle, which statement is true.

A. A scheduler does not care the process either in CPU burst cycle or I/O burst cycle

B. A process is either CPU burst or I/O burst

C. A process with CPU burst cycle is preferred

D. A process with I/O burst cycle is preferred

For the next 3 questions, considering the following set of processes, with the length of the CPU-burst time given in milliseconds:

Process Arrival time Burst time

P103

P225

P341

P454

P581

22.For the FCFS scheduling algorithm, the average waiting time is_____.

A. 14/5

B. 25/5

C. 44/5

D. 33/5

23.For the SJF scheduling algorithm, the average waiting time is _____.

A. 11/5

B. 22/5

C. 41/5

D. 30/5

24.For the Round Robin (quantum is 2) scheduling algorithm, the average waiting time is ___.

A. 44/5

B. 34/5

C. 29/5

D. 15/5

25.The critical section in an OS is ________.

A. a process scheduler

B. a data section

C. a synchronization mechanism

D. a segment of code

26.Which of the following statements is incorrect regarding Busy Waiting?

A. Busy waiting makes worse CPU throughput.

B. Busy waiting could be avoided by proper CPU scheduling.

C. Busy waiting does not just come with Critical Section Problem.

D. If a solution to the Critical Section Problem causes busy waiting, the solution is incorrect.

27.Which of the following statements is correct?

A. Critical section is a piece of code in a process for mutual exclusion.

B. Critical section is a piece of code in a process for process synchronization.

C. Critical section is a piece of code in a process for inter-process communication.

D. Critical section is a piece of code in a process for accessing critical (shared) resources.

28.For two-process Critical Section(CS) problem solution, the Progress condition does not mean that

A. Only processes wish to enter the section are the candidates.

B. If and only if there are some processes wish to enter the critical section, the Progress condition applies.

C.The decision to enter the critical section should be made within limited time, even though there exists a

process running in its critical section.

D. A process is allowed to enter its critical section many times while the others keep waiting.

29.Which one of the following statements is correct about spinlock?

A. Spinlock is appropriate for single-processor systems

B. Spinlock is often used in multiprocessor systems

C.Spinlock could be used in single-processor systems

D. Spinlock is not often used in multiprocessor systems

30.Which one of the following statements is correct about synchronization primitives ?

A. The primitive could be implemented by disabling interrupts, even in single-processor systems.

B. The primitive could not implemented by disabling interrupts, neither in single-processor systems nor in

multiprocessor systems.

C. The primitive could only be implemented by disabling interrupts for multiprocessor systems.

D. If used in user-level programs, the primitive could be implemented by disabling interrupts.

31.Hope the server limits its number to be concurrently connected no more than N clients. One solution will

be

A. A semaphore for resource sharing purpose, with the initial value N

B. A semaphore for resource sharing purpose, with the initial value 1

C. A semaphore for synchronization purpose, with the initial value N

D. A semaphore for synchronization purpose, with the initial value 1

32.Which one of the following is not the necessary condition for a deadlock to occur?

A. Starvation

B. Mutual exclusion

C. Hold and wait

D. NO Preemption

33.Which of the following methods can prevent the deadlock from the very beginning?

A. Resource allocation in an increasing order of enumeration

B. Banker’s algorithm

C. Deadlock detection

D. Deadlock avoidance

34.Consider the following snapshot of a system:

Allocation Max Available

ABCD ABCD ABCD

0 0 1 2 0 0 1 2 1 5 2 0

P

1 0 0 0 1 7 5 0

P

1

P

1 3 5 4

2

3 5 6

2

0 6 3 2 0 6 5 2

P

3

P

0 0 1 4 0 6 5 6

4

Which one is the safe sequence for the system?

A. < P0, P3, P4, P2, P1>

B. < P1, P2, P4, P3, P0>

C. < P2, P0, P4, P1, P3>

D. < P4, P3, P1, P2, P0>

35.The address binding could be by the way of

A. The variables in source codes converted to the binary

B. The variables in source codes compiled into object modules

C. Several object modules are linked together into a single program

D. All the above

36.An unsafe state implies ________.

A. the existence of deadlock

B. that deadlock will eventually occur

C. that some unfortunate sequence of events might lead to a deadlock

D. The scenario that the Dining Philosophers Problem described

37.In a real computer system, neither the resources available nor the demands of processes for resources are

consistent over long periods (months). Resources break or are replaced, new processes come and go, new resources are bought and added to the system. If deadlock is controlled by the banker’s algorithm, which of the following changes can be made safely (without introducing the possibility of deadlock) ?

A. Increase the number of processes.

B. Increase Max for one process (the process needs more resources than allowed, it may want more)

C. Increase Available (new resources added).

D. Decrease Available (resource permanently removed from system)

38.Which of the following memory management method helps to share a code segment across processes?

A. Contiguous memory allocation

B. Pure segmentation

C. Pure paging

D. None of above

39.Which of the following memory management method has no impact in terms of internal fragmentation?

A. Two-level paging

B. Segmentation

C. Paging

D. Linux paging strategy

40.To apply the demand paging memory management, the CPU with powerful MMU is a must. However,

is NOT a necessity.

A. Interrupt

B. Present bit defined in the segment table entry

C. TLB

D. Page table

41.Assume that you are monitoring the rate at which the pointer in the clock algorithm (which indicates the

candidate page for replacement) moves. What can you say about the system if you notice the pointer is moving fast ?

A. the program is accessing a large number of pages simultaneously

B. the operation finding candidate pages for replacement is efficient

C. the virtual memory system is extremely efficient

D. that indicates many of the resident pages are not being accessed

42.Suppose that a machine provides instructions that can access memory locations using the one-level

indirect addressing scheme. How many page faults incurred when all of the pages of a program are currently non-resident and the first instruction of the program is an indirect memory load operation ?

A. 3

B. 2

C. 1

D. 0

43. A certain computer provides its users with a virtual-memory space of 232bytes. 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, actually its page number is ___

A. 69923

B. 2715

C. 1110

D. 11123456

44.Consider a demand-paging system with the following time-measured utilizations:

CPU utilization 20%

Paging disk 97.7%

Other I/O devices 5%

Which of the following will improve CPU utilization ?

A. Increase the degree of multiprogramming

B. Decrease the degree of multiprogramming

C. Install a faster CPU

D. Install a bigger paging disk

45.Which of the following indicates that the system performs well

A. A process suffers deadlock

B. A process suffers starvation

C. A process suffers bad turnaround time

D. A process suffers thrashing

46.Virtual memory management with paging does not require

A. the page replacement

B. to process the page fault interrupt

C. to load some code or data into the contiguous memory space

D. none of the above

47.In order for a virtual memory management performing well, it is preferred that

A. processes do not have too much I/O operations

B. the program size should not be bigger than the whole memory space

C. there are some large size contiguous memory space

D. the locality of processes is well featured

For the next 2 questions, consider a paging system with the page table stored in memory.

48.If a memory reference takes 200 nanoseconds, how long does a paged memory reference take ?

A. 200 nanoseconds + the time to process the page entries which is a bit over 200 nanoseconds

B. depends, sometimes 400 nanoseconds, and sometimes 200 nanoseconds

C.200 nanoseconds

D. 400 nanoseconds

49.If we add TLBs, and 75 percent of all page-table references are found in the TLBs, what is the effective

memory reference time ? (Assume that finding a page-table entry in the TLBs takes zero time, if the entry is there.)

A. 250 nanoseconds

B. 350 nanoseconds

C. 400 nanoseconds

D. 200 nanoseconds

50.If an OS is not facilitated with virtual memory management, then

A. A process has to be loaded fully in memory before execution and kept staying in memory

B. A process does not have to be loaded fully in memory before execution, neither does stay in memory

C. A process does not have to be loaded fully in memory before execution, however has to stay in memory

during execution

D. A process has to be loaded fully in memory before execution, however does not have to stay in memory

during execution

For the next 3 questions, assume that five memory partitions are of size 100KB, 500KB, 200KB, 300KB, and 600KB (in order). The processes of 212KB, 417KB, 112KB and 426KB(in order) are applied to be put in place.

51.If the first-fit algorithm is equipped, the process of 112KB will be put in the partition with

A. 200KB

B. 300KB

C. 500KB

D. 600KB

52.If the best-fit algorithm is equipped, the process of 112KB will be put in the partition with

A. 500KB

B. 200KB

C. 300KB

D. 600KB

53.If the worst-fit algorithm is equipped, the process of 112KB will be put in the partition with

A. 500KB

B. 200KB

C. 300KB

D. 600KB

54.Which of the following designs is not to share a file located in a remote machine.

A. Maintaining several replicas

B. IP address followed by a path

C. URL

D. Virtual address

55. A file’s attributes vary from one operating system to another, but typically consist of

A. File name

B. Sectors

C. Type

D. The name of the creating program

56.The per-process open-file table is

A. unique and maintained by OS for all users

B. one of OS data structure for better performance of file system management

C. claimed by each process and for its own purpose

D. an accounting data structure to tell how many files opened by the process

57.As to the way accessing data of a file,

A. The sequential manner is better than the random one.

B. The random access is better than the sequential one.

C. Both the sequential and the random access are the right way.

D. Either the sequential or the random access is replaced by DBMS.

58.Which of the following design is practical by operating systems.

A. Automatically open a file while referenced for the first time, and close the file when the job terminates.

B. The user has to open and close the file explicitly.

C. The user has to open the file explicitly, but the file is closed automatically when the job terminates.

D. All the above

59.Regarding the file access permission, which of the following statements is NOT correct.

A. The “Cloud” providing SaaS is an example facilitated the file system to write once but read many times

B. Some file systems are read only, not allowing any write operation.

C. Some file systems are dedicated to write only once but read many times

D. The web site providing search service is an example facilitated the file system to write once but read many

times

https://www.360docs.net/doc/d52138613.html,B flash drive is popular nowadays. Usually it is not formatted with

A. btrfs

B. ISO 9660

C. FA T

D. EXT2

61.None of the disk-scheduling disciplines could avoid starvation, except ____.

A. FCFS

B. SSTF

C. C-SCAN

D. C-LOOK

62.Overheads are always associated with an interrupt service, resulting in worse performance. However, they

do not include the cost of ________

A. saving process state

B. executing the instruction just next the interrupt point

C. restoring process state

D. flushing the instruction pipeline

63.Look at the fact that requests are not usually uniformly distributed. For example, a cylinder containing the

file system FAT can be expected to be accessed more frequently than a cylinder that only contains files.

And the fact that file systems typically find data blocks via an indirection table, such as a FAT in DOS.

Which of the following ways would take advantage of this indirection to improve disk performance ?

A. Keep the metadata in the nearest corner of cylinders

B. Cache the metadata in primary memory

C. Back up the metadata

D. Redesign the file system by discarding the indirection

64.Which scheme of disk array provides no data redundancy ?

A. RAID 3

B. RAID 0

C. RAID 1

D. RAID 2

65.Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. The drive is currently serving a

request at cylinder 143, and the previous request was at cylinder 125. The queue of pending requests, in FIFO order, is

86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130

Starting from the current head position, what is the sequence of cylinder number that the disk arm moves to satisfy all the pending requests, for the SSTF algorithms?

A. 143, 913, 948, 1022, 1470, 1509, 1750, 1774, 4999, 130, 86

B. 143, 913, 948, 1022, 1470, 1509, 1750, 1774, 130, 86

C. 143, 130, 86, 913, 948, 1022, 1470, 1509, 1750, 1774

D. 143, 86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130

66.Some file systems allow disk storage to be allocated at different levels of granularity. For example, a file

system could allocate 4KB of disk space as a single block, or as four 1024-byte blocks. Do you think the example is

A. Absolutely nonsense

B. Probably true, but it is only for academic research

C. Practical, because there exists a popular file system using the scheme

D. Absolutely true, all file systems use the scheme

67.Which of the following statements is wrong from the operating system view?

A. Memory sometimes is used as a disk

B. Memory sometimes is used as read only

C. Memory sometimes is used as a USB flash drive

D. Memory sometimes is used as a disk cache

68. A logical address is ________

A. the address in an object file

B. the address in an executable file

C. the address in a CPU instruction together with operator

D. All the above

69. A file system uses a scheme with support for extents. A file is a collection of extents, with each extent

corresponding to a contiguous set of blocks. This file system is called

A. Contiguous allocation

B. Linked allocation

C.Indexed allocation

D. None of above

70.Which reason does not make sense: The operating system generally treats removable disks as shared file

systems but assigns a tape drive to only one application at a time, because

A. Disks have fast random-access time, so they give good performance for interleaved access streams. By

contrast, tapes have high positioning time

B. The owner of the Tape cartridge may wish to store the cartridge off-site (far away from the computer) to

keep a copy of the data safe from a fire at the location of the computer

C. Historically tape cartridges are often used to send large volumes of data from a producer to the consumer.

Such a tape cartridge is reserved for that particular data transfer

D. None of above

Part Two: (30 marks)

1. ( 12 marks) 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. Suppose it is used FCFS, SJF, a non-preemptive priority (a smaller priority number implies a higher priority), and RR (quantum = 1) scheduling.

a. What is the turnaround time of each process for each of the scheduling algorithms ?

b. Which of the schedules results in the minimal average waiting time (over all processes)?

2. ( 6 marks) Lamport's bakery algorithm is intended to improve the safety in the usage of shared resources among multi ple threads by means of mutual exclusion, briefed as following.

1 lock(integer i) {

2 Choosing[i] = true;

3 Number[i] = 1 + max(Number[1], ..., Number[NUM_THREADS]);

4 Choosing[i] = false;

5 f f o r (j = 1; j <= NUM_THREADS; j++) {

6 // Wait until thread j receives its number:

7 w w h i l e (Choosing[j]) { /* nothing */ }

8 // Wait until all threads with smaller numbers or with the same

9 // number, but with higher priority, finish their work:

10 w w h i l e ((Number[j] != 0) && ((Number[j], j) < (Number[i], i))) {

11 /* nothing */

12 }

13 }

14 }

15 //critical section

16 unlock(integer i) {

17 Number[i] = 0;

18 }

19

20 Thread(integer i) {

21 w w h i l e (true) {

22 lock(i);

23 // The critical section goes here...

24 unlock(i);

25 // n o n-c r i t i c a l s e c t i o n...

26 }

27 }

(1) Suppose Thread(i) and Thread(j) are running concurrently, will they occasionally get the same Number[] ?

i.e. Number[i] == Number[j]. If so, please give a scenario.

(2) If the Choosing array is not applied, i.e. Line 2, Line 4 and Line 7 are deleted, will the algorithm conflict with Critical Section Requirements of Mutual Exclusion, Progress and Bounded Waiting. If so, please give a scenario.

3. ( 4 marks) 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?

4. ( 8 marks) The EXT2 file system defines an index array with 15 pointers to locate all data blocks of a file.

(1) The first 12 items of the index array accommodate the locations of the first 12 data block.

(2) The 13th item points to an index block called the indirect block, which contains index entries, each being a pointer to a data block.

(3) The 14th item points to an index block containing entries, where each entry is a pointer to yet another indirect block as described in (2).

(4) The 15th item points to an index block containing entries where each entry is a pointer to another index block as described in (3).

Suppose the EXT2 data block is of size 4096 bytes, and an index entry is of size 4 bytes. Please answer how would be the maximal size of a file ?

操作系统试卷参考答案和评分标准

Part 1. Answer Sheet:(每小题1分,共计70分)

12345678910

A D D C C C

B B B B

11121314151617181920

A A D D D C C C C B

21222324252627282930

A A A D D D D C

B B

31323334353637383940

A A A A D C C

B B B

41424344454647484950

A A

B B

C C

D D A A

51525354555657585960

A B C D A B C D A B

61626364656667686970

A B B B C C C D D D

Part 2.

1.Answer: 12 分

a. Turnaround time(共10分,错1个扣0.5分)

FCFS RR SJF Priority

P1 10 19 19 16

P211 2 1 1

P3 13 7 4 18

P4 14 4 2 19

P5 19 14 96

b. Shortest Job First(2分)

2.Answer: 6 分(2小题各 3 分)

(1) Number[i] = 1 + max(Number[1], ..., Number[NUM_THREADS]);

This line of statement is not an atomic operation.If there is a breakout by the scheduler before and after the assignment operation, “=”, it may result in the snapshot, in which Number[i] == Number[j]

(2) Demo

/* we have no choosing mechanism.

Pi Pj

*/

->reg = max(.....) + 1;

->reg = max(...) + 1;

->set number[j] = reg;

->for(index = 0; index < n; index++)

->run when index == i;

->while((number[index]!=0&&(number[index,index]< number[j,j]));

/******* NOTE! the process i hasn't set number[i],so the

condition is false *********/

-> enter critical section

->set number[i] = reg;

->while((number[index]!=0 && (number[index],index) < number[i],i)));

/*-------------------------------------------------------------*/

/** here we can conclude that Pi can enter critical section as well as Pj **/

3.Answer: 4 分

0.2 _sec = (1 ? P) ×0.1 _sec + (0.3P) ×8 millisec + (0.7P) ×20 millisec

0.1 = ?0.1P + 2400 P + 14000 P

0.1 =16,400 P

P =0.000006

(答案正确的,给4分。答案不正确但是表达式正确,给2分)

4.Answer:8 分

LINUX的直接地址指针有12个,还有一个一级索引,一个二级索引,一个三级索引。因此

可管理的最大blocks为12 + (4096/4) + (4096/4)2 + (4096/4)3 = 12 + 210 + 220 + 230

可管理的最大文件为4KB * blocks = 48KB + 4MB + 4GB + 4TB

(答案正确的,给8分。计算得出48KB、4MB、4GB、4TB,各给2分)

4299165744KB * 1024

操作系统期末试卷(含答案)

操作系统复习题1 一、判断题 1.分时系统中,时间片设置得越小,则平均响应时间越短。() 2.多个进程可以对应于同一个程序,且一个进程也可能会执行多个程序。() 3.一个进程的状态发生变化总会引起其他一些进程的状态发生变化。() 4.在引入线程的OS中,线程是资源分配和调度的基本单位。() 5.信号量的初值不能为负数。() 6.最佳适应算法比首次适应算法具有更好的内存利用率。() 7.为提高对换空间的利用率,一般对其使用离散的分配方式。() 8.设备独立性是指系统具有使用不同设备的能力。() 9.隐式链接结构可以提高文件存储空间的利用率,但不适合文件的随即存取。() 10.访问控制矩阵比访问控制表更节约空间。() 二、选择题 1.在设计分时操作系统时,首先要考虑的是(A);在设计实时操作系统时,首先要考虑的是(B);在设计批处理系统时,首先要考虑的是(C)。 A,B,C :(1)灵活性和适应性;(2)交互性和响应时间;(3)周转时间和系统吞吐量;(4)实时性和可靠性。 2.对一个正在执行的进程:如果因时间片完而被暂停执行,此时它应从执行状态转变为(D)状态;如果由于终端用户的请求而暂停下来,则它的状态应转变为(E)状态;如果由于得不到所申请的资源而暂停时下来,则它的状态应转变为(F)状态。D,E,F:(1);静止阻塞(2);活动阻塞(3);静止就绪(4);活动就绪(5)执行。 3.我们如果为每一个作业只建立一个进程,则为了照顾短作业用户,应采用(G);为照顾紧急作业用户,应采用(H);为能实现人机交互,应采用(I);而能使短作业、长作业和交互作业用户满意时,应采用(J)。 G,H,I,J:(1);FCFS调度算法(2);短作业优先调度算法;(3)时间片轮转算法;(4)多级反馈队列调度算法;(5)基于优先权的剥夺调度算法。 4.由固定分区发展为分页存储管理方式的主要推动力是(K);由分页系统发展为分段系统,进而发展为段页式系统的主要动力分别是(L)和(M)。 K,L,M:(1)提高内存利用率;(2)提高系统吞吐量;(3)满足用户需要;(4)更好地满足多道程序进行的需要;(5)既满足用户需求,又提高内存利用率。 5.在存储管理中,不会产生内部碎片的存储管理方式是(N);支持虚拟存储器,但不能以自然的方式提供存储器的共享和存取保护机制的存储管理方式是(O)。 N:(1)分页式存储管理;(2)分段式存储管理;(3)固定分区式存储管理;(4)段页式存储管理。 O:(1)段页式存储管理;(2)请求分区页式存储管理;(3)请求分段式存储管理;(4)可变分区存储管理;(5)固定分区存储管理;(6)单一连续分区式存储管理。 6.磁盘调度主要是为了优化(P),下列算法中能避免磁盘粘着的现象的是(Q)。P:(1)寻道时间;(2)旋转延迟时间;(3)传输时间。 Q:(1)SSTF;(2)FCFS;(3)SCAN;(4)CSCAN;(5)FSCAN。 7.文件系统中,目录管理最基本的功能是(R),位示图的主要功能是(S),FAT表的主要功能是(T)。 R,S,T:(1)实现按名存取;(2)提高文件存储空间利用率;(3)管理文件存储器的空闲空间;(4)指出分配给文件的盘块(首个盘块除外)的地址;(5)管理文件存储器的空闲空间,并指出分配给文件的盘块(首个盘块除外)的地址。8.文件系统采用多级目录结构,可以(U)和(V)。 U,V:(1)缩短访问文件存储器时间;(2)节省主存空间;(3)解决不同用户文件的命名冲突;(4)方便用户读写文件;(5)提高检索目录的速度。 9.计算机系统中信息资源的安全包括(W)、(X)和(Y)三个方面,其中程序被删除属于(W)方面的威胁,数据被非法截取属于(X)方面的威胁,消息被更改属于(Y)方面的威胁。W,X,Y:(1)保密性;(2)完整性;(3)可用性;(4)方便性。 三、填空题 1.操作系统最基本的特征是(1)和(2),最主要的任务是(3)。 2.引入进程的主要目的是(4),进程存在的唯一标志是(5)。 3.(6)是指通过破坏死锁产生的必要条件来防止死锁的发生。引起死锁的四个必要条件中,(7)是不应该被破坏的,但对某些特殊的资源(如打印机),该条可通过(8)来破坏;而其他能被破坏的三个必要条件分别是(9)、(10)和(11)。 4.虚拟存储器管理的基础是(12)原理,在请求分页管理方式中,页表中的状态位用来只是对应页(13)修改位用来只是对应页(14),引用位则是供(15)使用;而在请求分段系统还增加了增补位,它用来指示(16)。 5.设备驱动程序是(17)与(18)之间的通信程序如果系统中有3台相同的单显和2台相同的彩显则必须为它们配置(19)种设备驱动程序 6.廉价磁盘冗余阵列可组成一个大容量磁盘系统,它利用(20)技术来提高磁盘系统的存取进度,而利用(21)技术来增加磁盘系统的可靠性 7.包过滤防火墙工作在(22)层,采用代理服务技术的防火墙则工作在(23)层 文件系统对文件存储空间采用(23)分配方式,它通过(24)来管理空闲的文件存储空间。 四、问答题 1.假设某多道程序设计系统中有供用户使用的内存100k,打印机1台。系统采用可变分区管理内存:对打印机采用静态分配,并假设输入输出操作的时间忽略不计:采用最短剩余时间优先的进程调度算法,进程剩余执行时间相同时采用先来先服务算法;进程调度时机在执行进程结束时或有新进程到达时。现有一进程序列如下: 假设系统优先分配内存的低地址区域,且不需移动已在主存中的进程,请: (1)给出进度调度算法选中进程的次序,并说明理由。 (2)全部进程执行结束所用的时间是多少 2.请用信号量解决以下的过独木桥问题:同一方向的行人可连续过桥,当某一方向的行人必须等待:另一方向的行人必须等待:当某一方向无人过桥是,另一方向的行人可以过桥。 3.提高内存利用率的途径有哪些 4.何谓脱机输入/输出技术 5. 将目录文件当作一般数据文件来处理有什么优缺点 操作系统复习题1答案 一、判断题 1、错 2、对 3、错 4、对 5、对 6、错 7、错 8、错 9、对10、错 二、选择题 1、A :(2);B:(4);C:(3)。 2、D:(4);E:(3);F:(2)。 3、G:(2);H:(5);I:(3);J:(4)。 4、K:(1);L:(3);M:(5)。 5、N:(2);O:(2)。 6、P:(1)寻道时间;Q:(5)。 7、R:(1);S:(3);T:(5)。8、U:(3);V:(5)。9、W:(3);X:(1);Y:(2)。 三、填空题 (1)并发;(2)资源共享;(3)管理资源;(4)使程序能够正确地并发执行;(5)进程控制快PCB;(6)预防死锁;(7)互斥条件;(8)SPOOLing技术;(9)

计算机操作系统教程课后答案

第一章绪论 1.什么是操作系统的基本功能? 答:操作系统的职能是管理和控制汁算机系统中的所有硬、软件资源,合理地组织计算 机工作流程,并为用户提供一个良好的工作环境和友好的接口。操作系统的基本功能包括: 处理机管理、存储管理、设备管理、信息管理(文件系统管理)和用户接口等。 2.什么是批处理、分时和实时系统?各有什么特征? 答:批处理系统(batchprocessingsystem):操作员把用户提交的作业分类,把一批作业编成一个作业执行序列,由专门编制的监督程序(monitor)自动依次处理。其主要特征是:用户脱机使用计算机、成批处理、多道程序运行。 分时系统(timesharingoperationsystem):把处理机的运行时间分成很短的时间片,按时间片轮转的方式,把处理机分配给各进程使用。其主要特征是:交互性、多用户同时性、独立性。 实时系统(realtimesystem):在被控对象允许时间范围内作出响应。其主要特征是:对实时信息分析处理速度要比进入系统快、要求安全可靠、资源利用率低。 3.多道程序(multiprogramming)和多重处理(multiprocessing)有何区别? 答;多道程序(multiprogramming)是作业之间自动调度执行、共享系统资源,并不是真正地同时执行多个作业;而多重处理(multiprocessing)系统配置多个CPU,能真正同时执行多道程序。要有效使用多重处理,必须采用多道程序设计技术,而多道程序设计原则上不一定要求多重处理系统的支持。 4.讨论操作系统可以从哪些角度出发,如何把它们统一起来? 答:讨论操作系统可以从以下角度出发: (1)操作系统是计算机资源的管理者; (2)操作系统为用户提供使用计算机的界面; (3)用进程管理观点研究操作系统,即围绕进程运行过程来讨论操作系统。

最新计算机操作系统期末考试题及答案

2006―2007 学年度第二学期 一、单项选择题(每题1分,共20分) 1.操作系统的发展过程是( C ) A、原始操作系统,管理程序,操作系统 B、原始操作系统,操作系统,管理程序 C、管理程序,原始操作系统,操作系统 D、管理程序,操作系统,原始操作系统 2.用户程序中的输入、输出操作实际上是由( B )完成。 A、程序设计语言 B、操作系统 C、编译系统 D、标准库程序 3.进程调度的对象和任务分别是( C )。 A、作业,从就绪队列中按一定的调度策略选择一个进程占用CPU B、进程,从后备作业队列中按调度策略选择一个作业占用CPU C、进程,从就绪队列中按一定的调度策略选择一个进程占用CPU D、作业,从后备作业队列中调度策略选择一个作业占用CPU 4.支持程序浮动的地址转换机制是( A、动态重定位 ) A、动态重定位 B、段式地址转换 C、页式地址转换 D、静态重定位 5.在可变分区存储管理中,最优适应分配算法要求对空闲区表项按( C )进行排列。 A、地址从大到小 B、地址从小到大 C、尺寸从小到大 D、尺寸从大到小 6.设计批处理多道系统时,首先要考虑的是( 系统效率和吞吐量 )。 A、灵活性和可适应性 B、系统效率和吞吐量 C、交互性和响应时间 D、实时性和可靠性 7.当进程因时间片用完而让出处理机时,该进程应转变为( )状态。 A、等待 B、就绪 C、运行 D、完成 8.文件的保密是指防止文件被( )。 A、篡改 B、破坏 C、窃取 D、删除 9.若系统中有五个并发进程涉及某个相同的变量A,则变量A的相关临界区是由 ( )临界区构成。 A、2个 B、3个 C、4个 D、5个 10.按逻辑结构划分,文件主要有两类:(记录式文件)和流式文件。 A、记录式文件 B、网状文件 C、索引文件 D、流式文件 11.UNIX中的文件系统采用(、流式文件)。 A、网状文件 B、记录式文件 C、索引文件 D、流式文件 12.文件系统的主要目的是()。 A、实现对文件的按名存取 B、实现虚拟存贮器 C、提高外围设备的输入输出速度 D、用于存贮系统文档 13.文件系统中用()管理文件。 A、堆栈结构 B、指针 C、页表 D、目录 14.为了允许不同用户的文件具有相同的文件名,通常在文件系统中采用()。 A、重名翻译 B、多级目录 C、约定 D、文件名 15.在多进程的并发系统中,肯定不会因竞争( )而产生死锁。 A、打印机 B、磁带机 C、CPU D、磁盘 16.一种既有利于短小作业又兼顾到长作业的作业调度算法是( )。 A、先来先服务 B、轮转 C、最高响应比优先 D、均衡调度 17.两个进程合作完成一个任务。在并发执行中,一个进程要等待其合作伙伴发来消息,或者建立某个条件后再向前执行,这种制约性合作关系被称为进程的()。 A、互斥 B、同步 C、调度 D、伙伴 18.当每类资源只有一个个体时,下列说法中不正确的是()。 A、有环必死锁 B、死锁必有环 C、有环不一定死锁 D、被锁者一定全在环中 19.数据文件存放在到存储介质上时,采用的逻辑组织形式是与( )有关的。 A、文件逻辑结构 B、存储介质特性 C、主存储器管理方式 D、分配外设方式 20.在单处理器的多进程系统中,进程什么时候占用处理器和能占用多长时间,取决于( )。 精品文档

N套_操作系统期末试卷(含答案)

一、选择题 1、在现代操作系统中引入了(),从而使并发和共享成为可能。 A.单道程序 B. 磁盘 C. 对象 D.多道程序 2、( )操作系统允许在一台主机上同时连接多台终端,多个用户可以通过各自的终端同时交互地使用计算机。 A.网络 B.分布式 C.分时 D.实时 3、从用户的观点看,操作系统是()。 A. 用户与计算机硬件之间的接口 B.控制和管理计算机资源的软件 C. 合理组织计算机工作流程的软件 D.计算机资源的的管理者 4、当CPU处于管态时,它可以执行的指令是()。 A. 计算机系统中的全部指令 B. 仅限于非特权指令 C. 仅限于访管指令 D. 仅限于特权指令 5、用户在程序中试图读取某文件的第100个逻辑块时,使用操作系统提供的()接口。 A. 系统调用 B.图形用户接口 C.原语 D.键盘命令 6、下列几种关于进程的叙述,()最不符合操作系统对进程的理解 A.进程是在多程序并行环境中的完整的程序。 B.进程可以由程序、数据和进程控制块描述。 C.线程是一种特殊的进程。 D.进程是程序在一个数据集合上运行的过程,它是系统进行资源分配和调度的一个独立单位。 7、当一个进程处于()状态时,称其为等待(或阻塞)状态。 A. 它正等待中央处理机 B. 它正等待合作进程的一个消息 C. 它正等待分给它一个时间片 D. 它正等待进入内存 8、一个进程释放一种资源将有可能导致一个或几个进程()。 A.由就绪变运行 B.由运行变就绪 C.由阻塞变运行 D.由阻塞变就绪 9、下面关于线程的叙述中,正确的是()。 A.不论是系统支持线程还是用户级线程,其切换都需要内核的支持。 B.线程是资源的分配单位,进程是调度和分配的单位。 C.不管系统中是否有线程,进程都是拥有资源的独立单位。 D.在引入线程的系统中,进程仍是资源分配和调度分派的基本单位。 10、设有3个作业,它们同时到达,运行时间分别为T1、T2和T3,且T1≤T2≤T3,若它们在单处理机系统中按单道运行,采用短作业优先调度算法,则平均周转时间为()。 A. T1+T2+T3 B. (T1+T2+T3)/3 C. T1+T2/3+2*T3/3 3+2*T2/3+T1 11、在下面的I/O控制方式中,需要CPU干预最少的方式是()。 A.程序I/O方式 B.中断驱动I/O控制方式 C.直接存储器访问DMA控制方式D.I/O通道控制方式 12、有m个进程共享同一临界资源,若使用信号量机制实现对一临界资源的互斥访问,则信号量的变

操作系统复习题及参考答案

操作系统复习题及参考 答案 Company number:【WTUT-WT88Y-W8BBGB-BWYTT-19998】

中南大学网络教育课程 《操作系统》复习题及参考答案 一、判断题: 1.操作系统的目的是提供一个让用户能方便地、高效地执行程序的环境。 [ ] 2.在单CPU环境下可以实现“多道程序系统”。 [ ] 操作系统是多用户多任务操作系统。 [ ] 4.资源共享是现代操作系统的一个基本特征。 [ ] 5.就绪状态、执行状态和挂起状态是进程的三种基本状态。 [ ] 6.程序在并发执行时会失去封闭性。 [ ] 7.进程是程序的一次执行,两个同时存在的进程所对应的程序总是不同的。 [ ] 8.在单处理机系统中,多个进程并行执行是指它们同时处于进程的“运行状态”。 [ ] 9.进程状态可由就绪状态转换到阻塞状态 [ ] 10.进程状态可由阻塞状态转移到运行状态(不考虑挂起状态)。 [ ] 11.独占型设备使用前必须先请求分配。 [ ] 12.一个批处理型作业的调度可能要经历高级调度、低级调度和中级调度三个阶段。 [ ] 13.作业周转时间是指作业需要的运行时间。 [ ] 14.预防死锁是指在资源动态分配过程中,用某种方法去防止系统进入不安全状态。 [ ] 15.死锁与程序的死循环一样。 [ ] 16.绝对装入方式需要对内存地址进行重定位。 [ ] 17.“对换”是指把内存中暂不能运行的数据调到外存。 [ ] 18.具有快表的存储管理系统中,CPU每次存储数据都只访问一次内存。 [ ]

19.在进行页面置换时,被淘汰的页都要回写到辅存。 [ ] 20.在虚拟存储系统中,操作系统为用户提供了巨大的存储空间。因此,用户地址空间的 大小可以不受任何限制 [ ] 21.磁带是可直接存取的设备。 [ ] 22.在文件的索引存取方法中,允许随意存取文件中的一个记录。 [ ] 23.文件的目录通常存放在外存中。 [ ] 24.在文件的直接存取方法中,允许随意存取文件中的一个记录。 [ ] 二、填空题: 1.操作系统的基本任务是________。 2.常用的操作系统有_______、_______、 _______、________。 3.人工操作方式的缺点主要是________、________。 4.多道批处理系统具有________、_________和_________特征。 5.分时系统的四个主要特征是__________、__________、__________、________。 6.操作系统主要是对_________、_________、_________、_________四种资源进行管理。 7.按设备的共享属性分类可分为_________、_________、_________。 8.程序顺序执行时的特征有_________、_________、_________。 9.程序的并发执行的特征有_________、_________、_________。 10.处于执行状态的进程,若其“时间片结束”,则该进程在三种基本状态中应从________ 状态变为_________状态。 11.运行过程中,进程可能具有_________、_________、_________三种状态。

北京大学操作系统期末试题有答案

操作系统原理试题 一. 名词解释题 1. 中断—— 2. 进程控制块(PCB)――它是进程实体的一部分,是操作系统最重要的记录型数据结构, 是进程存在的唯一标识 3. 虚时钟 4. 段式管理 5. 文件控制块(FCB) 6. 对换(SWAPPING) 7. 系统调用 8. 绝对路径名 9. 特别文件 10.虚设备技术 11.管道 12.中断接收 13.恢复现场 14.页式管理 15.作业步 16.字符流文件 17.通道 18.页面淘汰 19.多道程序设计 20.死锁 21.当前目录 22.快表 23.作业调度 24.原语 25.中断屏蔽 26.地址映射 27.文件目录 28.死锁避免 29.原语 31. CPU 状态 32.虚存

二 . 填空题 1. 分时系统追求的目标是 __及时响应 ___. 2. 用户进程从目态 (常态)转换为管态 (特态)的唯一途径是 ___ 中断 ________ . 3. 从静态的观点看 , 操作系统中的进程是由程序段、数据和 __ 作业控制块 PCB__ 三 部分组成 . 4. 在系统内核中必须包括的处理模块有进程调度、原语管理和 __中断处理 __. 5. 批处理操作系统中 , 作业存在的唯一标志是 _作业控制块 PCB ___. 6. 操作系统中的一种同步机制 , 由共享资源的数据及其在该数据上的一组操作组成 , 该同步机制称为 _管程 ______________ . 7. 在可变分区存储管理中 , 为实现地址映射 , 一般由硬件提供两个寄存器 , 一个是基 址寄存器 , 另一个是 _限长寄存器 ___. 8. 联想寄存器 (相联存储器 ) 的最重要、最独到的特点是 _按内容并行查找 ___. 9. 在虚拟段式存储管理中 , 若逻辑地址的段内地址大于段表中该段的段长 , 则发生 __ 地址越界 __中断 . 10. 文件系统中若文件的物理结构采用顺序结构 , 则文件控制快 FCB 中关于文件的物 理位置应包括 ___ 首块地址和文件长度 _. 11. 在操作系统设计时确定资源分配算法 , 以消除发生死锁的任何可能性 , 这种解决死 锁的方法是 __死锁预防 __. 12. 选择对资源需求不同的作业进行合理搭配 , 并投入运行是由 _作业调度算法 ___来完 成的. 13. 实时系统应具有两个基本特征 : 及时性和 ___可靠性 ___. 14. 磁带上的文件只能采用 _顺序 ______ 存取方式 . 15. 不让死锁发生的策略可以分成静态和动态的两种 , 死锁避免属于 __动态的 ___. 16. 在 UNIX 系统中 , 文件分成三类 , 即普通文件 , 目录文件和 ___特殊文件 __. 17. 在磁盘调度策略中有可能使 I/O 请求无限期等待的调度算法是 __最短寻道时间优先 18. 进程获得了除CPU 外的所有资源,一旦获得CPU 即可执行,这时进程处于—就绪 _ 状态 . 19. ______________________________________________________ 为实现CPU 与外部设备的并行工作,系统必须引入一通道 ____________________________________ 硬件基础. 20. 操作系统为保证不经文件拥有者授权 , 任何其它用户不能使用该文件所提出的解决 措施是 ___文件保密 __. 21. 两个或两个以上程序在计算机系统中同处于开始和结束之间的状态 , 这就称为 __ 并发 ___. 33. 磁盘调度 34. 缓冲技术 36. 进程调度 37. 虚设备 39. 死锁预防 40. 临界资源 — 42. 交换技术 43. 互斥区 段时间内只允许一个进程访问的资源,也称为独立资源

计算机操作系统期末考试题及答案(模拟卷一)

2012计算机操作系统期末考试试题及答案 操作系统试卷A 一、简答题(每题5分,共30分) 1.什么是虚拟设备? 2.What’s the differrence between a process and a program? 3.What’s Hyper-Treading technology? 4.死锁的必要条件是什么? 5.为什么将文件控制块分成主部和次部两部分? 6.若系统有同类资源m个,被n个进程共享,问:当m>n和m<=n时每个进程最多可以请求多少个这类资源,使系统一定不会发生死锁?为什么? 二、填空题(每空1分,共10分) 1.操作系统的两个重要特性是:(1) 和(2) 。 2.只能在管态下执行的指令称为(3) 。处理机状态由目态转换为管态的唯一途径是(4) ,管态到目态的转换可以通过修改(5) 来实现。 3.进程在其生存期内可以处于如下三种基本状态之一:运行态、就绪态和等待态。当一个就绪进程(6) 时,其状态由就绪变为运行,当一个运行进程被抢占处理机时,其状态由运行变为(7) ,当一个运行进程因某事件受阻时,其状态由运行变为(8) ,当进程所等待的事件已经发生时,该进程状态由(9) 变为就绪。 4.线程是进程内的一个相对独立的(10)。 三、计算题(每题10分,共40分) 1.设某计算机系统采用虚拟页式存储管理方法,进程的虚拟地址空间为64KB,页面尺寸为4KB。假设当前进程的页表如右图所示(页表以二进制形式表示),请将虚拟地址8196和2050转换为物理地址。 2.设某计算机系统采用虚拟页式存储管理方法,内存中为该进程分配4个物理页架, 开始时内存页架为空,假设进程在一段时间内的页面访问序列如下:6,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1,请画图表示采用以下页面淘汰算法时的缺页中断次数:(1)最佳页面淘汰算法(OPT);(2)先进先出页面淘汰算法(FIFO);(3)使用过最久的先淘汰(LRU)。 3.在UNIX系统中,设磁盘物理块大小为1KB,每个索引块可以保存256个索引项,请画出UNIX文件的物理结构。假设某文件大小为1028KB,请计算访问以下逻辑块时需要多少次I/O传输:(1)8;(2)300;(3)16。 4.设有周期性实时任务集如下表所示,用最早截止期优先算法(EDF算法)和速率单调算法(RMS算法)是否可以调度?画出相应的Gantt图。 四、算法设计(每题10分,共20分) 1.设有一个可以装A、B两种物品的仓库,其容量无限大,但要求仓库中A、

操作系统期末考试试题及答案精选

四、解答题(共20分) 1.什么是操作系统它的主要功能是什么(共8分) 操作系统是控制和管理计算机系统内各种硬件和软件资源、有效地组织多道程序运行的系统软件(或程序集合),是用户与计算机之间的接口 操作系统的主要功能包括:存储器管理、处理机管理、设备管理、文件管理以及用户接口管理。 2.操作系统中存储器管理的主要功能是什么什么叫虚拟存储器(共8分) 存储器管理的主要功能是:内存分配,地址映射,内存保护,内存扩充。(4分) 虚拟存储器是用户能作为可编址内存对待的存储空间,在这种计算机系统中虚地址被映象成实地址。或者:简单地说,虚拟存储器是由操作系统提供的一个假想的特大存储器。(4分) 3.什么是文件的逻辑组织和物理组织(共4分) 文件的逻辑组织——用户对文件的观察和使用是从自身处理文件中数据时 采用的组织方式来看待文件组织形式。这种从用户观点出发所见到的文件组织形式称为文件的逻辑组织。 文件的物理组织——文件在存储设备上的存储组织形式称为文件的物理组织。 三、填空题(每空2分,共30分) 1.通常,进程实体是由程序段,相关的数据段和PCB 这三部分组成,其中PCB 是进程存在的惟一标志。 2.从用户的源程序进入系统到相应程序在机器上运行,所经历的主要处理阶段有编辑阶段,编译阶段,连接阶段,装入阶段和运行阶段。 3.在UNIX系统中,文件的类型主要包括普通文件,目录文件,特别文件。 4.虚拟设备是通过 SPOOLing 技术把独占设备变成能为若干用户共享的设备。 5. Windows NT是采用微内核结构的操作系统,它的进程的功能发

生了变化,它只是资源分配的单位,不是调度运行的单位,后者的功能由线程完成。 五、应用题(共20分) 5.进程所请求的一次打印输出结束后,将使进程状态从( D) A、运行态变为就绪态 B、运行态变为等待态 C、就绪态变为运行态 D、等待态变为就绪态 6.采用动态重定位方式装入的作业,在执行中允许(C )将其移动。 A、用户有条件地 B、用户无条件地 C、操作系统有条件地 D、操作系统无条件地 7.分页式存储管理中,地址转换工作是由(A )完成的。 A、硬件 B、地址转换程序 C、用户程序 D、装入程序 9.对记录式文件,操作系统为用户存取文件信息的最小单位是(C )。 、文件 D 、记录 C 、数据项 B 、字符A. 10.为了提高设备分配的灵活性,用户申请设备时应指定(A )号。 A、设备类相对 B、设备类绝对 C、相对 D、绝对 11.通常把通道程序的执行情况记录在(D )中。 A、PSW B、PCB C、CAW D、CSW 14.共享变量是指(D )访问的变量。 A、只能被系统进程 B、只能被多个进程互斥 C、只能被用户进程 D、可被多个进程 15.临界区是指并发进程中访问共享变量的( D)段。 A、管理信息 B、信息存储 C、数据 D、程序 16.若系统中有五台绘图仪,有多个进程均需要使用两台,规定每个进程一次仅允许申请一台,则至多允许( D)个进程参于竞争,而不会发生死锁。 A、5 B、2 C、3 D、4 17.产生系统死锁的原因可能是由于(C )。 A、进程释放资源 B、一个进程进入死循环 C、多个进程竞争,资源出现了循环等待 D、多个进程竞争共享型设备 21.引入多道程序设计的主要目的在于(BD ) A、提高实时响应速度 B、充分利用处理机,减少处理机空闲时间 、有利于代码共享C.

操作系统作业参考答案及其知识点

操作系统作业参考答案及其知识点 第一章 思考题: 10、试叙述系统调用与过程调用的主要区别? 答: (一)、调用形式不同 (二)、被调用代码的位置不同 (三)、提供方式不同 (四)、调用的实现不同 提示:每个都需要进一步解释,否则不是完全答案 13、为什么对作业进程批处理可以提高系统效率? 答:批处理时提交程序、数据和作业说明书,由系统操作员把作业按照调度策略,整理为一批,按照作业说明书来运行程序,没有用户与计算机系统的交互;采用多道程序设计,可以使CPU和外设并行工作,当一个运行完毕时系统自动装载下一个作业,减少操作员人工干预时间,提高了系统的效率。 18、什么是实时操作系统?叙述实时操作系统的分类。 答:实时操作系统(Real Time Operating System)指当外界事件或数据产生时,能接收并以足够快的速度予以处理,处理的结果又能在规定时间内来控制监控的生产过程或对处理系统做出快速响应,并控制所有实时任务协调一致运行的操作系统。 有三种典型的实时系统: 1、过程控制系统(生产过程控制) 2、信息查询系统(情报检索) 3、事务处理系统(银行业务) 19、分时系统中,什么是响应时间?它与哪些因素有关? 答:响应时间是用户提交的请求后得到系统响应的时间(系统运行或者运行完毕)。它与计算机CPU的处理速度、用户的多少、时间片的长短有关系。 应用题: 1、有一台计算机,具有1MB内存,操作系统占用200KB,每个用户进程占用200KB。如果用户进程等待I/0的时间为80%,若增加1MB内存,则CPU的利用率提高多少? 答:CPU的利用率=1-P n,其中P为程序等待I/O操作的时间占其运行时间的比例1MB内存时,系统中存放4道程序,CPU的利用率=1-(0.8)4=59% 2MB内存时,系统中存放9道程序,CPU的利用率=1-(0.8)9=87% 所以系统CPU的利用率提高了28% 2、一个计算机系统,有一台输入机和一台打印机,现有两道程序投入运行,且程序A先开始做,程序B后开始运行。程序A的运行轨迹为:计算50ms,打印100ms,再计算50ms,打印100ms,结束。程序B的运行轨迹为:计算50ms,输入80ms,再计算100ms,结束。

计算机操作系统3套期末考试题及答案

计算机专业计算机操作系统试题 2003年7月 一、选择题(选择一个正确的答案的代号填入括号中,共38分) 1.操作系统核心部分的主要特点是( )。 A.一个程序模块B.主机不断电时常驻内存 C.有头有尾的程序D.串行顺序执行 2.操作系统中用得最多的数据结构是( )。 A.堆栈B.队列 C.表格D.树 3. 索引式(随机)文件组织的一个主要优点是( )o A.不需要链接指针B.能实现物理块的动态分配 C.回收实现比较简单D.用户存取方便 4.文件目录的主要作用是( )。 A.按名存取B.提高速度 C.节省空间D.提高外存利用率 5.在操作系统管理中,面向用户的管理组织机构称为( )。 A.用户结构B.实际结构 C.物理结构D.逻辑结构 6.单机操作系统的共享资源主要是指( )。 A.内存、CPU和基本软件B.键盘、鼠标、显示器 C.打印机、扫描仪D.软盘、硬盘、光盘 7.为方便用户,操作系统负责管理和控制计算机系统的( )。 A.软件资源B.硬件和软件资源 C.用户有用资源D.硬件资源 8.设备I/O方式有如下三种:( )、( )和( )。 A.假脱机B.询问 C.联机D.中断 E.通道F.脱机 9.操作系统五大功能中作业管理包含( )和( );文件管理又称( );存储管理主要讲解( );设备管理是最原始的( );进程管理实质上是( )。 A.CPU的执行调度管理B.用户任务管理 C. 信息管理D.监控程序管理 E.人机交互界面管理F.内存管理 10.计算机在接受用户请求后处理数据以及在数据处理结束时,将结果送到终端显示器。例如,导弹控制系统应选择安装( );计算机订票系统应选择安装( );计算机语言学习系统应选择安装( )。A.批处理操作系统B.分时操作系统 C.实时操作系统D.网络操作系统 E.分布式操作系统 二、是非题(正确的划√,错的划×,其它符号按错论。共20分) ( )1.系统调用是操作系统和用户进程的接口,库函数也是操作系统和用户的接口。

操作系统期末考试试题

一、单项选择 1、在存储管理方案中,__D_____ 可与覆盖技术配合. A、页式管理 B、段式管理 C、段页式管理 D、可变分区管理 2、在存储管理中,采用覆盖与交换技术的目的是___A______。 A、节省主存空间 B、物理上扩充准存容量 C、提高CPU效率 D、实现主存共享 3、动态重定位技术依赖于___B______。 A、重定位装入程序 B、重定位寄存器 C、地址机构 D、目标程序 4、虚拟存储器的最大容量____A______。 A、为内外存容量之和 B、由计算机的地址结构决定 C、是任意的 D、有作业的地址空间决定 5、在虚拟存储系统中,若进程在内存中占3块(开始时为空),采用先进先出页面淘汰算法,但执行访问页号序列为1、2、3、4、1、2、5、1、、2、3、4、5、6时,将产生___D___次缺页中断。 A、7 B、8 C、9 D、10 6、设内存的分配情况如下图所示。若要申请一块40K字节的内存空间,若采用最佳适应算法,则所得到的分区首址为____C___。 A、100K B、190K C、330K D、410K 7、很好地解决了“零头”问题的存储管理方法是____A____。 A、页式存储管理 B、段式存储管理 C、多重分区管理 D、可变分区管理 8、系统“抖动”现象的发生是由___A___引起的。 A、置换算法选择不当 B、交换的信息量过大 C、内存容量不足 D、请求页式管理方案 9、在可变式分区存储管理中的拼接技术可以_____A___。 A、集中空闲区 B、增加主存容量 C、缩短访问周期 D、加速地址转换 10、分区管理中采用“最佳适应”分配算法时,宜把空闲区按____A__次序等记在空闲区表中。 A、长度递增 B、长度递减 C、地址递增 D、地址递减 11、在固定分区分配中,每个分区的大小是_C__。 A、相同 B、可以不同但根据作业长度固定 C、可以不同但预先固定 D、所作业长度变化

操作系统期中考试试题参考答案)

操作系统(A卷) 一、单项选择题(20分,每题1分, 共20题) 1、操作系统是一种(B)。 A.通用软件 B.系统软件 C.应用软件 D.软件包 2、操作系统是对(C)进行管理的软件。 A.软件 B.硬件C.计算机资源 D.应用程序 3、操作系统中采用多道程序设计技术提高CPU和外部设备的(A)。 A.利用率 B.可靠性 C.稳定性 D.兼容性 4、操作系统的基本类型主要有(B)。 A.批处理系统、分时系统、多任务系统 B.实时操作系统、批处理操作系统、分时操作系统 C.单用户系统、多用户系统、批处理系统 D.实时系统、分时系统、多用户系统 5、所谓(B)是指将一个以上的作业放入主存,并且同时处于运行状态,这些作业共享处理机的时间和外围设备等其他资源。 A.多重处理B.多道程序设计 C.实时处理 D.共行执行 6、(C)操作系统允许用户把若干个作业提交给计算机系统。 A.单用户 B.分布式C.批处理 D.监督 7、下面6个系统中,必须是实时操作系统的有(C)个。计算机辅助设计系统;航空订票系统;过程控制系统;机器翻译系统;办公自动化系统;计算机激光照排系统。 A.1 B.2 C.3 D.4 8、在操作系统中,(C)是进行系统资源分配、调度和管理的最小单位。 A.程序 B.指令C.进程 D.作业 9、(D)不是操作系统关心得主要问题。 A.管理计算机裸机 B.设计、提供用户程序与计算机硬件系统的界面 C.管理计算机系统资源 D.高级程序设计语言的编译程序 10、批处理系统的主要缺点是(A)。 A.失去了交互性 B.CPU的利用率降低 C.不具备并行性 D.以上都错 11、系统调用的目的是(A)。 A.请求系统服务 B.终止系统服务 C.申请系统资源 D.释放系统资源 12、进程和程序的本质区别是(D)。 A.存储在内存和外存 B.顺序和非顺序执行机器指令 C.分时使用和独占使用计算机资源 D.动态和静态的特征 13、在进程管理中,当(D)时进程从执行状态转换为就绪状态。 A.进程被进程调度选中 B.等待某一事件 C.等待的事件发生D.时间片用完 14、如果P、V操作S的初值为4,当前值为-2,那么表示有(B)个等待进程。 A.1 B.2 C.3 D.4 15、系统中有4个并发的进程都需要同类资源3个,系统不会发生死锁的最小资源数是(C)。 A.5 B.7 C.9 D.10 16、在下列(A)情况下,系统会出现死锁。 A.若干进程因竞争资源而无休止地互相等待它方释放已占有的资源

计算机操作系统习题及答案

第3章处理机调度1)选择题 (1)在分时操作系统中,进程调度经常采用_D_ 算法。 A. 先来先服务 B. 最高优先权 C. 随机 D. 时间片轮转 (2)_B__ 优先权是在创建进程时确定的,确定之后在整个进程运行期间不再改变。 A. 作业 B. 静态 C. 动态 D. 资源 (3)__A___ 是作业存在的惟一标志。 A. 作业控制块 B. 作业名 C. 进程控制块 D. 进程名 (4)设有四个作业同时到达,每个作业的执行时间均为2小时,它们在一台处理器上按单道方式运行,则平均周转时间为_ B_ 。 A. l小时 B. 5小时 C. 2.5小时 D. 8小时 (5)现有3个同时到达的作业J1、J2和J3,它们的执行时间分别是T1、T2和T3,且T1<T2<T3。系统按单道方式运行且采用短作业优先算法,则平均周转时间是_C_ 。 A. T1+T2+T3 B. (T1+T2+T3)/3 C. (3T1+2T2+T3)/3 D. (T1+2T2+3T3)/3 (6)__D__ 是指从作业提交给系统到作业完成的时间间隔。 A. 运行时间 B. 响应时间 C. 等待时间 D. 周转时间 (7)下述作业调度算法中,_ C_调度算法与作业的估计运行时间有关。 A. 先来先服务 B. 多级队列 C. 短作业优先 D. 时间片轮转 2)填空题 (1)进程的调度方式有两种,一种是抢占(剥夺)式,另一种是非抢占(非剥夺)式。 (2)在_FCFS_ 调度算法中,按照进程进入就绪队列的先后次序来分配处理机。 (3)采用时间片轮转法时,时间片过大,就会使轮转法转化为FCFS_ 调度算法。 (4)一个作业可以分成若干顺序处理的加工步骤,每个加工步骤称为一个_作业步_ 。 (5)作业生存期共经历四个状态,它们是提交、后备、运行和完成。 (6)既考虑作业等待时间,又考虑作业执行时间的调度算法是_高响应比优先____ 。 3)解答题 (1)单道批处理系统中有4个作业,其有关情况如表3-9所示。在采用响应比高者优先调度算法时分别计算其平均周转时间T和平均带权周转时间W。(运行时间为小时,按十进制计算) 表3-9 作业的提交时间和运行时间

计算机操作系统(第三版_汤小丹等)课后习题答案(全)整理后

第一章操作系统引论 1.设计现代OS的主要目标是什么? 答:(1)有效性 (2)方便性 (3)可扩充性 (4)开放性 2.OS的作用可表现在哪几个方面? 答:(1)OS作为用户与计算机硬件系统之间的接口;(2)OS作为计算机系统资源的管理者;(3)OS实现了对计算机资源的抽象。 3.为什么说OS实现了对计算机资源的抽象? 答:OS首先在裸机上覆盖一层I/O设备管理软件,实现了对计算机硬件操作的第一层次抽象;在第一层软件上再覆盖文件管理软件,实现了对硬件资源操作的第二层次抽象。OS 通过在计算机硬件上安装多层系统软件,增强了系统功能,隐藏了对硬件操作的细节,由它们共同实现了对计算机资源的抽象。 4.试说明推动多道批处理系统形成和发展的主要动力是什么? 答:主要动力来源于四个方面的社会需求与技术发展:(1)不断提高计算机资源的利用率;(2)方便用户; (3)器件的不断更新换代;(4)计算机体系结构的不断发展。 5.何谓脱机I/O和联机I/O? 答:脱机I/O 是指事先将装有用户程序和数据的纸带或卡片装入纸带输入机或卡片机,在外围机的控制下,把纸带或卡片上的数据或程序输入到磁带上。该方式下的输入输出由外围机控制完成,是在脱离主机的情况下进行的。而联机I/O方式是指程序和数据的输入输出都是在主机的直接控制下进行的。 6.试说明推动分时系统形成和发展的主要动力是什么? 答:推动分时系统形成和发展的主要动力是更好地满足用户的需要。主要表现在:CPU 的分时使用缩短了作业的平均周转时间;人机交互能力使用户能直接控制自己的作业;主机的共享使多用户能同时使用同一台计算机,独立地处理自己的作业。 7.实现分时系统的关键问题是什么?应如何解决? 答:关键问题是当用户在自己的终端上键入命令时,系统应能及时接收并及时处理该命令,在用户能接受的时延内将结果返回给用户。解决方法:针对及时接收问题,可以在系统中设置多路卡,使主机能同时接收用户从各个终端上输入的数据;为每个终端配置缓冲区,暂存用户键入的命令或数据。针对及时处理问题,应使所有的用户作业都直接进入内存,并且为每个作业分配一个时间片,允许作业只在自己的时间片内运行,这样在不长的时间内,能使每个作业都运行一次。 8.为什么要引入实时OS? 答:实时操作系统是指系统能及时响应外部事件的请求,在规定的时间内完成对该事件的处 理,并控制所有实时任务协调一致地运行。引入实时OS 是为了满足应用的需求,更好地满 足实时控制领域和实时信息处理领域的需要。 9.什么是硬实时任务和软实时任务?试举例说明。 答:硬实时任务是指系统必须满足任务对截止时间的要求,否则可能出现难以预测的结果。 举例来说,运载火箭的控制等。软实时任务是指它的截止时间并不严格,偶尔错过了任务的截止时间,对系统产生的影响不大。举例:网页内容的更新、火车售票系统。 10.在8位微机和16位微机中,占据了统治地位的是什么操作系统? 答:单用户单任务操作系统,其中最具代表性的是CP/M和MS-DOS。 11.试列出Windows OS 中五个主要版本,并说明它们分别较之前一个版本有何改进。 答:(1)Microsoft Windows 1.0是微软公司在个人电脑上开发图形界面的首次尝试。(2)Windows 95是混合的16位/32位系统,第一个支持32位。带来了更强大、更稳定、更实用的桌面图形用户界面,结束了桌面操作系统间的竞争。(3)Windows 98是微软公司的混合16位/32位Windows 操作系统,改良了硬件标准的支持,革新了内存管理,是多进程操作系统。(4)Windows XP是基于Windows 2000的产品,拥有新用户图形界面月神Luna。简化了用户安全特性,整合了防火墙。(5)Windows Vista 包含了上百种新功能;特别是新版图形用户界面和Windows Aero全新界面风格、加强的搜寻功能(Windows Indexing Service)、新媒体创作工具

安徽大学计算机操作系统期末考试题及答案定稿版

安徽大学计算机操作系统期末考试题及答案精 编W O R D版 IBM system office room 【A0816H-A0912AAAHH-GX8Q8-GNTHHJ8】

安徽大学2011―2012 学年度第二学期 一、单项选择题(每题1分,共20分) 1.操作系统的发展过程是( C ) A、原始操作系统,管理程序,操作 系统 B、原始操作系统,操作系统,管理 程序 C、管理程序,原始操作系统,操作 系统 D、管理程序,操作系统,原始操作 系统 2.用户程序中的输入、输出操作实际上 是由( B )完成。 A、程序设计语言 B、操作系 统 C、编译系统 D、标准库 程序3.进程调度的对象和任务分别是 ( C )。 A、作业,从就绪队列中按一定的调度策略选择一个进程占用CPU B、进程,从后备作业队列中按调度策略选择一个作业占用CPU C、进程,从就绪队列中按一定的调度策略选择一个进程占用CPU D、作业,从后备作业队列中调度策略选择一个作业占用CPU 4.支持程序浮动的地址转换机制是( A、动态重定位 ) A、动态重定位 B、段式地址转换 C、页式地址转换 D、静态重定位 5.在可变分区存储管理中,最优适应分配算法要求对空闲区表项按 ( C )进行排列。

A、地址从大到小 B、地址从小到大 C、尺寸从小到大 D、尺寸从大到小 6.设计批处理多道系统时,首先要考虑的是( 系统效率和吞吐量 )。 A、灵活性和可适应性 B、系统效率和吞吐量 C、交互性和响应时间 D、实时性和可靠性 7.当进程因时间片用完而让出处理机时,该进程应转变为( B )状态。 A、等待 B、就绪 C、运行 D、完成 8.文件的保密是指防止文件被 ( C )。 A、篡改 B、破坏 C、窃取 D、删除9.若系统中有五个并发进程涉及某个相同的变量A,则变量A的相关临界区 是由( D )临界区构成。 A、2个 B、3个 C、4个 D、5个 10.按逻辑结构划分,文件主要有两类:(记录式文件)和流式文件。 A、记录式文件 B、网状文件 C、索引文件 D、流式文件 11.UNIX中的文件系统采用(、流式文件)。 A、网状文件 B、记录式文件 C、索引文件 D、流式文件 12.文件系统的主要目的是 ( A )。 A、实现对文件的按名存取 B、实现虚拟存贮器 C、提高外围设备的输入输出速度 D、用于存贮系统文档

相关文档
最新文档