操作系统期末历年题1

目录

(一)填空题

(二)选择题

1. 中断向量的内容为:a、子程序的开始地址b、中断处理程序的开始地址c、中断处理程序的开始地址d、处理程序的开始地址

2.避免死锁是通过以下方法实现的:A.提供足够的资源B.控制进程进程的适当顺序C.破坏4个必要充分条件中的一个D.防止系统进入不安全状态

3.在多路编程系统中。为了保证共享变量的完整性,进程应该互斥地进入各自的临界区,关键段指的是a缓冲区b数据段c同步机制d代码段

4.3个进程共享4种相同类型的资源,这些资源一次只能分配或释放一个。每个进程最多需要2个资源,所以这个系统是a,有些进程永远得不到资源。B.结果导致死锁C.从进程请求的资源可以立即得到满足。D.从进程请求的资源可以立即得到满足。

5.用户进程通过调用系统调用fork()创建一个新进程。在调用fork()之前,用户进程正在运行;在运行fork()期间。A. kernel模式B. user模式C. kernel模式或user模式D. internal模式

6.在多路编程系统中。多个进程可以并发地在内存中运行,并且互不干扰。a内存分配b内存保护c内存扩展d地址映射

7.死锁主要是由进程进程顺序错误引起的。A.资源分配不合理B.系统资源不足D.进程调度不合理C.作业调度不合理

8.(C)下列哪一种迁移是不可能的?A. running->ready B. running->waiting C. waiting->running D. running->terminate

9. (C)以下哪一项不包括在过程的上下文中?A. code  B. PCB  C.中断向量  D.内核堆栈

(三)判断题

1. (√)操作系统是由中断驱动的。

2. (X)可以利用假脱机技术来提高外围设备的速度。

3.(X)存储在引导控制块中的程序是操作系统的初始化程序。

4. (X)线程切换不会导致进程切换。

5. (X)进程资源分配图中的循环表示系统中存在死锁。

6. (X)死锁是指系统中所有进程都处于等待状态。

7. (X)当使用WAIT和SIGNAL操作来实现进程同步或互斥时,WAIT和SIGNAL的顺序必须正确,否则会导致死锁。

8. (X)信号量的效率比监控器的效率高,但使用信号量的效率低,容易导致僵局。

9. (√)等待进程不能自行唤醒。

10.(√)并发系统中运行的程序具有不连续特征。

(四)简答题

1. 请给出5个状态的流程迁移图,并说明迁移原因。

2. 什么是关键资源,什么是关键区域?什么条件

(五)计算题

1.使用FCFS调度算法和SJF调度算法时,这些进程的平均周转时间是多少?

2. 桌子上有一个盘子。一次只能放一个水果进去。 爸爸每次都在盘子里放一个苹果。妈妈每次都往盘子里放一个橘子。女儿把苹果从盘子里拿出来喂猫,儿子把橘子从盘子里舀出来喂猫。请使用信号量为父亲、母亲、女儿和儿子设计进程。

3.考虑以下系统快照,根据银行家算法回答以下问题。

1)计算矩阵NEED。

2)现在,系统是否处于安全状态?为什么?

3)如果进程P2请求更多的资源,请求[2]=(0,1,0,0),这个请求是否可以立即得到满足?为什么?


(一)填空题

1. Programming interface provided by operating system is system call

1. 操作系统提供的编程接口为系统调用

2. Privilege instruction refers to the instructions that can only he executed by operating system.

2。特权指令是指只能由操作系统执行的指令。

3. The 5 basic states of processes are new, ready, running, waiting and terminated.

3.进程的5种基本状态是:新建、就绪、运行、等待和终止。

4. In a system there are 10 tape-drivers shared by MI processc5,cach process needs 3 tape-rivers at most, then if M <=4,the system can be deadlock free?

4. 在一个系统中,MI进程5共享10个磁带机,缓存进程最多需要3个带河,如果M <=4,系统可以无死锁吗?

5. There are 3 jobs. Their running tine are 2.5. and 3 hours. Assume they arrive at the same time, running on the same processor in single programming method; running sequence J4,J3,.J2 will have the least average turnaround time.

5. 有3个工作。他们的跑步时间是2.5秒。3个小时。假设它们同时到达,以单一编程方法在同一处理器上运行;运行顺序J4,J3,J2的平均周转时间最少。

6. The necessary and sufficient condition for deadlock are mutual exclusion hold and wait, no preemption. and circular wait.

6. 发生死锁的充要条件是互斥、等待和不抢占,循环等待。

7. The value of a semaphore specifics some meaning ,if it is greater than or equal to zero, the value stands for the number of resources available, if it is less than zero. its absolute value stands for the number of processes waiting for this type of resource.

7. 信号量的值具有特定的含义,如果它大于或等于零,则该值代表可用资源的数量,如果它小于零。它的绝对值表示等待这种类型资源的进程数。

8. Two communication methods between processes are shared memory, and message passing.

8. 进程之间的两种通信方法是共享内存和消息传递。

9. Programs loaded into and running in memory refers to processes

9. 加载到内存中并在其中运行的程序指的是进程

10. 3 conditions that a good solution for critical section problems should satisfy are Mutual Exclusion, progress, and bounded waiting.

10. 临界截面问题的良好解应满足的3个条件是互斥、进展和有界等待。

  

(二)选择题

1. Contents of interrupt vector are B

A. begin address of sub-programs

B. begin addresses of interrupt handling programs

C. the address of begin addresses of interrupt handling programs

D. begin address of handling programs

1. 中断向量的内容为:a、子程序的开始地址b、中断处理程序的开始地址c、中断处理程序的开始地址d、处理程序的开始地址

2. Deadlock avoidance is implemented by D

A. providing sufficient resources

B. controlling proper sequence of processes progress

C. destroying one of the 4 necessary and sufficient conditions

D. preventing system enter into unsafe state

2.避免死锁是通过以下方法实现的:A.提供足够的资源B.控制进程进程的适当顺序C.破坏4个必要充分条件中的一个D.防止系统进入不安全状态

3. In multiprogramming system.in order to guarantee the integrality of shared variable, processes should enter their critical section mutual exclusively. Critical section refers to  D

A. a buffer

B. a data segment

C. synchronous mechanism

D. a code segment

3.在多路编程系统中。为了保证共享变量的完整性,进程应该互斥地进入各自的临界区,关键段指的是a缓冲区b数据段c同步机制d代码段

4. There are 4 same type of resources shared by 3 processes, these resources can only be allocated or released one at a time. Each process needs 2 resources at most, so this system is  D

A. some processes can never gain resources.

B. deadlock consequentially

C. resource requesting from process can be satisfied immediately

D. deadlock free consequentially

4.3个进程共享4种相同类型的资源,这些资源一次只能分配或释放一个。每个进程最多需要2个资源,所以这个系统是a,有些进程永远得不到资源。B.结果导致死锁C.从进程请求的资源可以立即得到满足。D.从进程请求的资源可以立即得到满足。

5. User process creates a new process by calling system call fork().before calling fork(), the user process is running in B ;during running fork(). the user process is running in A

A. kernel mode

B. user mode

C. kernel mode or user mode

D. internal mode

5.用户进程通过调用系统调用fork()创建一个新进程。在调用fork()之前,用户进程正在运行;在运行fork()期间。A. kernel模式B. user模式C. kernel模式或user模式D. internal模式

6. In multiprogramming systems. several processes can be running concurrently in memory and does not interfere each other. This is implemented by using B

A. memory allocation

B. memory protection

C. memory extension

D. address mapping

6.在多路编程系统中。多个进程可以并发地在内存中运行,并且互不干扰。a内存分配b内存保护c内存扩展d地址映射

7.Deadlock is mainly caused by   B  and wrong sequence of processes progress.

A. Improper resource allocation

B. shortage of system resource

D. improper process scheduling

C. improper job scheduling

7.死锁主要是由进程进程顺序错误引起的。A.资源分配不合理B.系统资源不足D.进程调度不合理C.作业调度不合理

8.( C )Which of the following migrations is impossible?

A. running->ready

B. running->waiting

C. waiting->running.

D. running->terminate

8.(C)下列哪一种迁移是不可能的?A. running->ready B. running->waiting C. waiting->running D. running->terminate

9.( C ) Which of the following is not included in the context of process?

A. code

B. PCB

C. interrupt vector

D. kernel stack

9. (C)以下哪一项不包括在过程的上下文中?A. code  B. PCB  C.中断向量  D.内核堆栈

  

(三)判断题

1. (√) Operating System is driven by interrupt.

1. (√)操作系统是由中断驱动的。

2. (X) Spooling technology can be used to increase the speed of slow peripheral equipment.

2. (X)可以利用假脱机技术来提高外围设备的速度。

3. (X) The program stored in boot control block is initialization program for OS.

3.(X)存储在引导控制块中的程序是操作系统的初始化程序。

4. (X) Switch between threads can not cause the switch between processes.

4. (X)线程切换不会导致进程切换。

5. (X) The cycle in process resource-allocation graph means there ls deadlock in the system.

5. (X)进程资源分配图中的循环表示系统中存在死锁。

6. (X) Deadlock means that all processes in the system are in waiting state.

6. (X)死锁是指系统中所有进程都处于等待状态。

7. (X) When operation WAIT and SIGNAL are used to realize processes synchronization or mutual exclusion, the sequence of WAIT and SIGNAL must be right,or deadlock will be caused.

7. (X)当使用WAIT和SIGNAL操作来实现进程同步或互斥时,WAIT和SIGNAL的顺序必须正确,否则会导致死锁。

8. (X) The efficiency of semaphore is higher than that of monitor, but using semaphores is easy to lead to deadlock.

8. (X)信号量的效率比监控器的效率高,但使用信号量的效率低,容易导致僵局。

9. (√) Awaiting process can not be waked up by itself.

9. (√)等待进程不能自行唤醒。

10.(√) Programs running in concurrent system has the feature discontinuity.

10.(√)并发系统中运行的程序具有不连续特征。

   

(四)简答题

1. Please give the migration diagram of process with 5 states, and indicate the migration reasons.

1. 请给出5个状态的流程迁移图,并说明迁移原因。

2. What is critical resources, and what is critical section? What conditions should

be satisfied for a good solution to critical section problem?

2. 什么是关键资源,什么是关键区域?什么条件

对临界截面问题的良好解满意吗?

ANSMER;

critical resource is one that can be used by only ono process at a time.

critical section is a program code segment in which the critical resource is accessed. good solution to critical section problem should satisfy 3 conditions: mutual exclusion, progress. bounded waiting.

ANSMER;

关键资源是在同一时间内只能被一个进程使用的资源。

临界段是访问关键资源的程序代码段。临界截面问题的良好解应满足互斥性、进步性3个条件。有界的等待。

   

(五)计算题

1.What is the average turnaround time for these processes with the FCFS scheduling algorithm and SJF scheduling algorithm?

1.使用FCFS调度算法和SJF调度算法时,这些进程的平均周转时间是多少?

 

 

2. There is a plate on the table. only one fruit is allowed to he put into it at a time.Father puts one apple into the plate every time. mother puts one orange into the plate every time. the daughter takes the apple from plate to cat, and the son lakes the orange from plate to cat. Please design processes for father, mother, daughter, and son by using semaphores.

2. 桌子上有一个盘子。一次只能放一个水果进去。 爸爸每次都在盘子里放一个苹果。妈妈每次都往盘子里放一个橘子。女儿把苹果从盘子里拿出来喂猫,儿子把橘子从盘子里舀出来喂猫。请使用信号量为父亲、母亲、女儿和儿子设计进程。

 

3.Consider the following snapshot of a system,answer the following questions according to banker’ s algorlthm.

3.考虑以下系统快照,根据银行家算法回答以下问题。

1) calculate matrix NEED.

2) Now, is the system ln safe state? Why?

3) If process P2 requests more resources, request[2]=(0,1,0,0), can this request be satisfied immediately? why?

1)计算矩阵NEED。

2)现在,系统是否处于安全状态?为什么?

3)如果进程P2请求更多的资源,请求[2]=(0,1,0,0),这个请求是否可以立即得到满足?为什么?

 

P1 and p2 can not finish,so there is not a safe sequence of processes,the system is in unsafe state,so request from P2 can not be satisfied immediately.

P1p2无法完成,所以没有一个安全的流程序列,系统处于不安全状态,所以不能立即满足p2的请求。

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
操作系统是现代计算机系统中的一个重要组成部分,它负责管理计算机的硬件和软件资源,为用户和应用程序提供一个良好的运行环境。在操作系统的学习过程中,进行期末考试是对学生知识掌握和能力评估的重要方式之一。 CSDN是一个专注于IT技术的社区平台,提供丰富的技术资源、文章和论坛,并且也有一些在线课程和考试库。在进行操作系统期末考试前,可以借助CSDN的考试库进行练习和复习,以提高考试水平。 操作系统期末考试库主要包括以下几个方面的内容: 1. 操作系统基本概念:包括操作系统的定义、功能、特点等基本概念的理解和解释。 2. 进程管理:包括进程的定义、进程的状态转换、进程调度算法等相关知识点。 3. 内存管理:包括内存的分段与分页管理、虚拟内存、页面置换算法等知识点。 4. 文件系统:包括文件的组织方式、文件访问控制、文件系统的实现原理等相关内容。 5. 输入输出管理:包括设备管理、磁盘调度算法、输入输出缓冲区管理等知识点。 对于操作系统期末考试的准备,可以通过以下几个步骤进行: 1. 阅读课本、笔记和相关教材,对考试范围内的知识点进行系统地复习和理解。 2. 使用CSDN的考试库进行模拟考试和练习,找出自己的薄弱环节,并适当调整复习计划。 3. 参加线下或线上的学习班和讲座,与其他同学和老师交流和讨论,获得更多的学习资源和经验。 4. 做好时间规划和复习计划,合理分配时间和精力,保持良好的学习状态和心态。 5. 注意做好笔记和总结,将知识点简洁明了地记录下来,以便复习和回顾。 综上所述,通过合理利用CSDN的考试库以及其他相关资源,结合自己的努力和认真复习,相信可以取得良好的成绩和对操作系统的深入理解。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值