操作系统期末考试及参考答案
- 格式:pdf
- 大小:1.02 MB
- 文档页数:17
国开期末考试《操作系统》机考满分试题(第8套)第一部分:选择题(每题5分,共计25分)1. 以下哪个不属于操作系统的五大功能?A. 处理器管理B. 存储器管理C. 设备管理D. 网络管理E. 文件管理2. 在操作系统中,进程可以被定义为____。
A. 程序的一次执行过程B. 程序的静态表示C. 计算机系统中运行的程序D. 计算机系统中所有程序的总和E. 以上都不是3. 关于操作系统的描述,以下哪项是正确的?A. 操作系统的主要任务是为用户提供方便的编程环境B. 操作系统的主要任务是为用户提供方便的运行环境C. 操作系统的主要任务是为程序提供方便的编程环境D. 操作系统的主要任务是为程序提供方便的运行环境E. 以上都不是4. 下列哪种方式不是进程调度算法?A. 先来先服务(FCFS)B. 最短作业优先(SJF)C. 优先级调度D. 时间片轮转(Round Robin)E. 最高响应比优先(HRRN)5. 在虚拟存储器管理中,页面置换算法中____算法是最简单的一种。
A. 先进先出(FIFO)B. 最短剩余时间(SRT)C. 最短作业优先(SJF)D. 最高响应比优先(HRRN)E. 最近最少使用(LRU)第二部分:填空题(每题5分,共计25分)6. 在操作系统中,进程可以被定义为程序在某个数据集合上的运行过程,它对应了进程的静态描述,我们称之为____。
7. 操作系统的____功能主要是管理计算机中的硬件和软件资源,合理地组织计算机的工作流程,并为用户提供一个使用方便、可扩展的工作环境。
8. 在____调度算法中,每当处理机空闲时,系统就选取处于就绪队列的第一个进程投入运行。
9. 虚拟存储器管理中,页面置换算法中____算法是试图根据页面调入后再次被访问的远近选择淘汰的页面。
10. 在操作系统中,文件的逻辑结构有多种形式,其中最常用的是____结构。
第三部分:简答题(每题10分,共计30分)11. 简述进程和线程的区别。
2010―2011 学年度第二学期一、单项选择题(每题1分,共20分)1.操作系统的发展过程是( C )A、原始操作系统,管理程序,操作系统B、原始操作系统,操作系统,管理程序C、管理程序,原始操作系统,操作系统D、管理程序,操作系统,原始操作系统2.用户程序中的输入、输出操作实际上是由( B )完成。
A、程序设计语言B、操作系统C、编译系统D、标准库程序3.进程调度的对象和任务分别是( C )。
A、作业,从就绪队列中按一定的调度策略选择一个进程占用CPUB、进程,从后备作业队列中按调度策略选择一个作业占用CPUC、进程,从就绪队列中按一定的调度策略选择一个进程占用CPUD、作业,从后备作业队列中调度策略选择一个作业占用CPU4.支持程序浮动的地址转换机制是( 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、用于存贮系统文档13.文件系统中用( D )管理文件。
《操作系统原理》期末考试题班级学号姓名一、单项选择题(每题2分,共26分)1.操作系统是一种()。
A. 系统软件B. 系统硬件C. 应用软件D. 支援软件2.分布式操作系统与网络操作系统本质上的不同在于()。
A.实现各台计算机这间的通信B.共享网络中的资源C.满足较在规模的应用D.系统中多台计算机协作完成同一任务3.下面对进程的描述中,错误的是()。
A.进程是动态的概念B. 进程执行需要处理机C.进程是指令的集合D. 进程是有生命期的4.临界区是指并发进程中访问共享变量的()段。
A.管理信息B.信息存储C.数据D.程序5.要求进程一次性申请所需的全部资源,是破坏了死锁必要条件中的哪一条()。
A.互斥B.请求与保持C.不剥夺D.循环等待6.以下哪种存储管理不可用于多道程序系统中()。
A.单一连续区存储管理B.固定式区存储管理D. 段式存储管理 C.可变分区存储管理7.在可变式分区存储管理中,某作业完成后要收回其主存空间,该空间可能与1 / 8相邻空闲区合并,修改空闲区表,使空闲区数不变且空闲区起始地址不变的情况是()。
A.无上邻空闲区也无下邻空闲区B.有上邻空闲区但无下邻空闲区C.有下邻空闲区但无上邻空闲区D.有上邻空闲区也有下邻空闲区8.系统“抖动”现象的发生不是由()引起的。
A.置换算法选择不当B.交换的信息量过大C.主存容量不足D.请求页式管理方案9.在进程获得所需全部资源,唯却CPU时,进程处于()状态。
A.运行B.阻塞C.就绪D.新建10.要页式存储管理系统中,将主存等分成()。
A.块B.页C.段长D.段11.系统利用SPOOLING技术实现()。
A.对换手段B.虚拟设备C.系统调用D.虚拟存储12.设备从磁盘驱动器中读出一块数据的总时间为()。
A.等待时间+ 传输时间B.传输时间D.延迟时间+ 查找时间+ 传输时间 C.查找时间+ 传输时间13.如果允许不同用户的文件可以具有相同的文件名,通常采用()来保证按名存取的安全。
《操作系统原理》期末考试题班级学号姓名1.操作系统是一种( )。
A. 系统软件B. 系统硬件C. 应用软件D. 支援软件2.分布式操作系统与网络操作系统本质上的不同在于()。
A.实现各台计算机这间的通信B.共享网络中的资源C.满足较在规模的应用D.系统中多台计算机协作完成同一任务3.下面对进程的描述中,错误的是()。
A.进程是动态的概念B. 进程执行需要处理机C.进程是指令的集合D. 进程是有生命期的4.临界区是指并发进程中访问共享变量的()段。
A.管理信息B.信息存储C.数据D.程序5.要求进程一次性申请所需的全部资源,是破坏了死锁必要条件中的哪一条()。
A.互斥B.请求与保持C.不剥夺D.循环等待6.以下哪种存储管理不可用于多道程序系统中()。
A.单一连续区存储管理B.固定式区存储管理C.可变分区存储管理D.段式存储管理7.在可变式分区存储管理中,某作业完成后要收回其主存空间,该空间可能与相邻空闲区合并,修改空闲区表,使空闲区数不变且空闲区起始地址不变的情况是()。
A.无上邻空闲区也无下邻空闲区B.有上邻空闲区但无下邻空闲区C.有下邻空闲区但无上邻空闲区D.有上邻空闲区也有下邻空闲区8.系统“抖动”现象的发生不是由()引起的。
A.置换算法选择不当B.交换的信息量过大C.主存容量不足D.请求页式管理方案9.在进程获得所需全部资源,唯却CPU时,进程处于()状态。
A.运行B.阻塞C.就绪D.新建10.要页式存储管理系统中,将主存等分成()。
A.块B.页C.段长D.段11.系统利用SPOOLING技术实现()。
A.对换手段B.虚拟设备C.系统调用D.虚拟存储12.设备从磁盘驱动器中读出一块数据的总时间为()。
A.等待时间+ 传输时间B.传输时间C.查找时间+ 传输时间D.延迟时间+ 查找时间+ 传输时间13.如果允许不同用户的文件可以具有相同的文件名,通常采用()来保证按名存取的安全。
A.重名翻译机构B.建立索引表C.多级目录结构D.建立指针二、多项选择题(每题3分,共24分)1.操作系统有多种类型,允许多个用户以交互方式使用的操作系统,称为()。
国家开放大学2020年7月《1251操作系统》期末考试复习题及答案选择题和判断题中蓝色的为正确答案。
一、选择题(选择一个正确答案的代码填入括号中)•在计算机系统中,控制和管理各种软、硬件资源,有效地组织多道程序运行的系统软件称作()。
A.网络系统B.文件系统C.操作系统D.数据库系统•在计算机系统中,操作系统是( )。
A.处于裸机之上的第一层软件B.处于应用软件之上的系统软件C.处于硬件之下的底层软件D.处于系统软件之上的用户软件•现代操作系统的基本特征是()、资源共享和操作的异步性。
A.多道程序设计B.中断处理C.程序的并发执行D.实现分时与实时处理•以下不属于操作系统具备的主要功能的是()。
A.文档编辑B.中断处理C.内存管理D.CPU调度•为用户分配主存空间,保护主存中的程序和数据不被破坏,提高主存空间的利用率。
这属于操作系统的( )。
A.处理器管理B.作业管理C.文件管理D.存储管理•下列系统中,属于实时系统的是()。
A.方正排版系统B.计算机辅助设计系统C.火车订票系统D.办公自动化系统•为了使系统中所有的用户都能得到及时的响应,该操作系统应该是()。
A.多道批处理系统B.分时系统C.实时系统D.网络系统•下列不属于分时系统特征的是( )。
A.为多用户设计B.可靠性比实时系统要求高C.方便用户与计算机的交互D.需要中断机构及时钟系统的支持•以下著名的操作系统中,属于多用户、多进程、多任务分时系统的是()。
A.DOS系统B.UNIX系统C.Windows NT系统D.OS/2系统•操作系统内核与用户程序、应用程序之间的接口是()。
A.shell命令B.系统调用C.图形界面D.C语言函数•系统调用是由操作系统提供的内部调用,它()。
A.直接通过键盘交互方式使用B.只能通过用户程序间接使用C.是命令接口中的命令D.与系统的命令一样•进程与程序之间有密切联系,但又是不同的概念。
二者的一个本质区别是()。
《操作系统原理》期末考试题班级学号姓名一、单项选择题(每题2分,共26分)1.操作系统是一种( )。
A. 系统软件B. 系统硬件C. 应用软件D. 支援软件2.分布式操作系统与网络操作系统本质上的不同在于()。
A.实现各台计算机这间的通信B.共享网络中的资源C.满足较在规模的应用D.系统中多台计算机协作完成同一任务3.下面对进程的描述中,错误的是()。
A.进程是动态的概念B. 进程执行需要处理机C.进程是指令的集合D. 进程是有生命期的4.临界区是指并发进程中访问共享变量的()段。
A.管理信息B.信息存储C.数据D.程序5.要求进程一次性申请所需的全部资源,是破坏了死锁必要条件中的哪一条()。
A.互斥B.请求与保持C.不剥夺D.循环等待6.以下哪种存储管理不可用于多道程序系统中()。
A.单一连续区存储管理B.固定式区存储管理C.可变分区存储管理D.段式存储管理7.在可变式分区存储管理中,某作业完成后要收回其主存空间,该空间可能与相邻空闲区合并,修改空闲区表,使空闲区数不变且空闲区起始地址不变的情况是()。
A.无上邻空闲区也无下邻空闲区B.有上邻空闲区但无下邻空闲区C.有下邻空闲区但无上邻空闲区D.有上邻空闲区也有下邻空闲区8.系统“抖动”现象的发生不是由()引起的。
A.置换算法选择不当B.交换的信息量过大C.主存容量不足D.请求页式管理方案9.在进程获得所需全部资源,唯却CPU时,进程处于()状态。
A.运行B.阻塞C.就绪D.新建10.要页式存储管理系统中,将主存等分成()。
A.块B.页C.段长D.段11.系统利用 SPOOLING技术实现()。
A.对换手段B.虚拟设备C.系统调用D.虚拟存储12.设备从磁盘驱动器中读出一块数据的总时间为()。
A.等待时间 + 传输时间B.传输时间C.查找时间 + 传输时间D.延迟时间 + 查找时间 + 传输时间13.如果允许不同用户的文件可以具有相同的文件名,通常采用()来保证按名存取的安全。
华南农业大学期末考试试卷(A 卷)201X 学年第一学期 考试科目: 操作系统 考试类型:(闭卷)考试 考试时间: 120 分钟学号 姓名 年级专业(答案直接写在试卷上,卷面书写必须工整、清晰、规范)一、选择及填空题(本大题共25个空,每空1分,共25分)1. _________操作系统能及时处理由过程控制反馈的数据并响应。
A. 分布式B. 实时C. 分时D. 嵌入式2. 当CPU 处于系统态时,它可以执行的指令是计算机系统的________。
A. 只有访管指令B. 只有特权指令C. 所有指令D. 只有非特权指令3. 在“基址B+限长L ”内存保护方案中,合法的逻辑地址A 应该满足_________条件。
A. 0≤A <LB. 0≤A ≤LC. B ≤A <LD. B ≤A ≤L4. 分时操作系统的主要目标是提高或改善计算机系统的_________。
A. 实时性B. 资源利用率C. 交互性D. 软件运行速度5. Linux 中的伙伴系统是用于________。
A. 文件目录的查找B. 磁盘空间的管理C. 内存空间的管理D. 文件保护6. 在下列死锁的解决方法中,属于死锁预防策略的是________。
A. 银行家算法B. 资源有序分配C. 剥夺资源D. 资源分配图化简7. 进程创建时,操作系统不需要给新进程执行下面的________工作。
A. 分配唯一的PIDB. 分配内存空间C. 初始化PCBD. 抢占当前进程8. 虚拟存储器的目的是实现________。
A. 存储保护B. 程序迁移C.动态重定位D. 扩充主存容量9. 某分时系统将有50个用户同时上机,为保证2s 的响应时间,时间片最大应为_______。
A. 50msB. 40msC. 100msD. 20ms10. “选一个进程占用CPU ”是_________的功能。
A. 短程调度B. 中程调度C. 长程调度D. 高级调度11. 与系统“抖动”现象无关的原因是__________。
第一章引论1、在下列系统中,(B)是实时系统。
A、计算机激光照排系统B、航空定票系统C、办公自动化系统D、计算机辅助设计系统2、在单一处理器上执行程序,多道程序的执行是在(B)进行的。
A、同一时刻B、同一时间间隔内C、某一固定时间D、某一固定时间间隔内3、如果在设备处理时设置I/O进程,则不需要I/O进程工作时,I/O进程处于_挂起_状态。
允许多个用户在其终端上同时交互地使用计算机的OS称为分时系统,它通常采用时间片轮转策略为用户服务;允许用户把若干个作业提交计算机系统集中处理的OS称为多道批处理,衡量这种系统性能的一个主要指标是系统的系统吞吐量;在实时操作系统的控制下,计算机系统能及时处理由过程控制反馈的数据并作响应。
设计这种系统时,应首先考虑系统的实时性与可靠性。
5、(C)不是分时系统的基本特征:A、同时性B、独立性C、实时性D、交互性6、计算机操作系统的功能是(D)。
A.把源程序代码转换为标准代码B.实现计算机用户之间的相互交流C.完成计算机硬件与软件之间的转换D.控制、管理计算机系统的资源和程序的执行7、在分时系统中。
时间片一定时,(B),响应时间越长。
A.内存越多B.用户数越多C.内存越少D.用户数越少8、下面关于操作系统的叙述中正确的是(A)。
A.批处理作业必须具有作业控制信息。
B.分时系统不一定都具有人机交互功能。
C.从响应时间的角度看,实时系统与分时系统差不多。
D.由于采用了分时技术,用户可以独占计算机的资源。
9、分时操作系统通常采用(B)策略为用户服务。
A.可靠性和灵活性B.时间片轮转C.时间片加权分配D.短作业优先10、在(A)操作系统控制下,计算机系统能及时处理由过程控制反馈的数据并作出响应。
A.实时B.分时C.分布式D.单用户11、下面6个系统中,必须是实时操作系统的有(B)个。
计算机辅助设计系统航空订票系统过程控制系统机器翻译系统办公自动化系统计算机激光照排系统A.1B.2C.3D.412、设计实时操作系统时,首先应考虑系统的(B)。
《操作系统》期末考试综合练习题一、填空题1、操作系统是(控制)、(管理)系统资源,方便用户使用计算机的(程序)的集合。
2、操作系统具有(资源管理)和(提供人机接口)两大基本功能。
3、最常用的存储保护机构有(界地址寄存器)和(存储器)。
4、对称式多处理器系统(SMP)含有多个CPU,这些CPU具有(平等)地位。
5、将一个运行进程可访问的虚地址的集合称为(虚拟地址空间) 。
6、根据执行的程序的性质不同,处理器可分为(核心态)和(用户态)两种状态。
7、用信号量机制来控制打印机的共享使用。
如果系统中共有2台打印机,这时已经分配了一台给某个进程使用,此时信号量的值应该是(2).8、进程可以描述为:一组具有独立功能的程序在某个(数据集合)上的一次(执行过程) 。
9、当程序运行到某条语句时,才对其逻辑地址进行计算并转化为物理地址,这种技术叫做(动态)重定位。
10、.当程序装入内存时,就对其逻辑地址进行计算并转化为物理地址,这种技术叫做(静态)重定位。
11、通常我们通过破坏(环路等待)条件和(资源独占)条件来预防死锁的发生。
12、所谓死锁状态是指在系统中的(进程),由于竞争系统资源或由于彼此通信而永远(阻塞) 。
13、多道程序的操作系统具有(并行性)和(共享性)两大特性。
14、处理器调度的主要功能是按照某种原则,将处理器分配给(就绪队列的某个) 进程。
15、中断是指CPU对系统中发生的(异步事件)的响应。
16、操作系统中,对目录的设计包括(目录内容)和(目录结构)两个部分。
17、用信号量机制来控制打印机的共享使用。
如果系统中共有5台打印机,这时,信号量的初值应该是(5).18、在虚拟存储器的概念中,目标程序中的指令和数据放置的位置称为相对地址或者(相对)地址,而CPU能直接访问的主存的物理地址又称(实存地址)。
19、当一个进程执行Signal操作,完成对信号量“加1”后,这时信号量的值是“1”。
这时,系统中还有(至少一个)个进程等待该资源.20、一个计算机的数据总线的宽度叫做这个计算机的(.字长)。
考试试卷:A√卷、B卷(请在选定项上打√)考试形式:闭、开√卷(请在选定项上打√),允许带 入场考试日期: 年 月 日,考试时间: 120 分钟 任任课教师:__诚信考试,沉着应考,杜绝违纪。
考生姓名:学号:所属院系:_题序1-701234总分得分评卷人注意:本考卷分P a r t1、P a r t2两部分,第一部分为选择题共70分;第二部分为问答题共30分。
选择题答案请填入以下表格,只答在题目上的不给分。
问答题答案请写在答题纸上。
题号12345678910 1-1011-2021-3031-4041-5051-6061-70Part 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 interpreterC. Graphic user interface (GUI)D. System call2. A distributed system could be _________.A. A client-server systemB. A peer-to-peer systemC. A clustering systemD. All the above3.When operating system says Resource, it could beA.Memory spaceB.Global variableswork bandwidthD.All the abovepared to the OSes with microkernel, the monolithic counterpart sometimes shows advantage in .A. ScalabilityB. ModularityC. PerformanceD. Readability5.Which of the functionalities listed below must be supported by the operating system for handheld devices.A. Batch programmingB. Virtual memoryC. Time sharingD. Networking6.Which of the following types of operating systems has the best job throughput ?A. Time sharingB. InteractiveC. BatchD. Real time7. A CPU scheduler focuses on __________ scheduling.A. mixture-termB. short-termC. medium-termD. long-term8.The context-switch causes overhead by OS. The action affects many objects, but is not included.A. registerB. global variableC. stackD. memory9.Which of the following process state transitions is impossible to happen?A. from ready state to running stateB. from ready state to waiting stateC. from running state to ready stateD. from waiting state to ready state10. A process will change its state from “waiting” to “ready” when _____.A.it has been selected for execution by schedulerB.the event it had been waiting for has occurredC.its time slice is finishedD.it waits for some event11.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.ing the program shown as following:#include <sys/types.h>#include <stdio.h>#include <unistd.h>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 =20B. PARENT: value =10C. PARENT: value =15D. PARENT: value =2513. A semaphore array in Linux is often used as ______.A. a kind of direct communicationB. a kind of low-level communicationC. a kind of symmetrical communicationD. a kind of inter-process communication14.Which of the following statement is true ?A. Sometimes multithreading does not provide better performance than a single-threaded solutionB. Sometimes multithreading does the same performance as a single-threaded solutioC. Sometimes multithreading provides better performance than a single-threaded solutionD. All the above are true15.Threads in a process share the _________.A. Stack memoryB. Heap memoryC. Register valuesD. Global variables16.In general, multithreading shows some features benefiting user applications. Even though an operatingsystem does not support multithreading, those features could be brought with by use of __________.A. One to One ModelB. Kernel level threadC. User level threadD. None17.Which of the following scheduling algorithms could result in starvation ?A. First come first servedB. Round robinC. Shortest job firstD. Highest response_ratio next18.Consider a variant of the RR scheduling algorithm in which the entries in the ready queue are pointers tothe 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 queuesB. Multilevel feedback queuesC. First come first servedD. Round robin20.Sometimes two scheduling criteria are conflict with each other, and not satisfied both. Which of thefollowing pairs of scheduling criteria are ALWAYS non-conflicting?A. CPU utilization and response timeB. Average turnaround time and average waiting timeC. Average turnaround time and maximum waiting timeD. I/O device utilization and CPU utilization21.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 cycleB. A process is either CPU burst or I/O burstC. A process with CPU burst cycle is preferredD. A process with I/O burst cycle is preferredFor 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 timeP103P225P341P454P58122.For the FCFS scheduling algorithm, the average waiting time is_____.A. 14/5B. 25/5C. 44/5D. 33/523.For the SJF scheduling algorithm, the average waiting time is _____.A. 11/5B. 22/5C. 41/5D. 30/524.For the Round Robin (quantum is 2) scheduling algorithm, the average waiting time is ___.A. 44/5B. 34/5C. 29/5D. 15/525.The critical section in an OS is ________.A. a process schedulerB. a data sectionC. a synchronization mechanismD. a segment of code26.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 thatA. 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 aprocess 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 systemsB. Spinlock is often used in multiprocessor systemsC.Spinlock could be used in single-processor systemsD. Spinlock is not often used in multiprocessor systems30.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 inmultiprocessor 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 willbeA. A semaphore for resource sharing purpose, with the initial value NB. A semaphore for resource sharing purpose, with the initial value 1C. A semaphore for synchronization purpose, with the initial value ND. A semaphore for synchronization purpose, with the initial value 132.Which one of the following is not the necessary condition for a deadlock to occur?A. StarvationB. Mutual exclusionC. Hold and waitD. NO Preemption33.Which of the following methods can prevent the deadlock from the very beginning?A. Resource allocation in an increasing order of enumerationB. Banker’s algorithmC. Deadlock detectionD. Deadlock avoidance34.Consider the following snapshot of a system:Allocation Max AvailableABCD ABCD ABCD0 0 1 2 0 0 1 2 1 5 2 0P1 0 0 0 1 7 5 0P1P1 3 5 423 5 620 6 3 2 0 6 5 2P3P0 0 1 4 0 6 5 64Which 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 ofA. The variables in source codes converted to the binaryB. The variables in source codes compiled into object modulesC. Several object modules are linked together into a single programD. All the above36.An unsafe state implies ________.A. the existence of deadlockB. that deadlock will eventually occurC. that some unfortunate sequence of events might lead to a deadlockD. The scenario that the Dining Philosophers Problem described37.In a real computer system, neither the resources available nor the demands of processes for resources areconsistent 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 allocationB. Pure segmentationC. Pure pagingD. None of above39.Which of the following memory management method has no impact in terms of internal fragmentation?A. Two-level pagingB. SegmentationC. PagingD. Linux paging strategy40.To apply the demand paging memory management, the CPU with powerful MMU is a must. However,is NOT a necessity.A. InterruptB. Present bit defined in the segment table entryC. TLBD. Page table41.Assume that you are monitoring the rate at which the pointer in the clock algorithm (which indicates thecandidate 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 simultaneouslyB. the operation finding candidate pages for replacement is efficientC. the virtual memory system is extremely efficientD. that indicates many of the resident pages are not being accessed42.Suppose that a machine provides instructions that can access memory locations using the one-levelindirect 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. 3B. 2C. 1D. 043. A certain computer provides its users with a virtual-memory space of 232bytes. The computer has 218bytes 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. 69923B. 2715C. 1110D. 1112345644.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 multiprogrammingB. Decrease the degree of multiprogrammingC. Install a faster CPUD. Install a bigger paging disk45.Which of the following indicates that the system performs wellA. A process suffers deadlockB. A process suffers starvationC. A process suffers bad turnaround timeD. A process suffers thrashing46.Virtual memory management with paging does not requireA. the page replacementB. to process the page fault interruptC. to load some code or data into the contiguous memory spaceD. none of the above47.In order for a virtual memory management performing well, it is preferred thatA. processes do not have too much I/O operationsB. the program size should not be bigger than the whole memory spaceC. there are some large size contiguous memory spaceD. the locality of processes is well featuredFor 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 nanosecondsB. depends, sometimes 400 nanoseconds, and sometimes 200 nanosecondsC.200 nanosecondsD. 400 nanoseconds49.If we add TLBs, and 75 percent of all page-table references are found in the TLBs, what is the effectivememory reference time ? (Assume that finding a page-table entry in the TLBs takes zero time, if the entry is there.)A. 250 nanosecondsB. 350 nanosecondsC. 400 nanosecondsD. 200 nanoseconds50.If an OS is not facilitated with virtual memory management, thenA. A process has to be loaded fully in memory before execution and kept staying in memoryB. A process does not have to be loaded fully in memory before execution, neither does stay in memoryC. A process does not have to be loaded fully in memory before execution, however has to stay in memoryduring executionD. A process has to be loaded fully in memory before execution, however does not have to stay in memoryduring executionFor 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 withA. 200KBB. 300KBC. 500KBD. 600KB52.If the best-fit algorithm is equipped, the process of 112KB will be put in the partition withA. 500KBB. 200KBC. 300KBD. 600KB53.If the worst-fit algorithm is equipped, the process of 112KB will be put in the partition withA. 500KBB. 200KBC. 300KBD. 600KB54.Which of the following designs is not to share a file located in a remote machine.A. Maintaining several replicasB. IP address followed by a pathC. URLD. Virtual address55. A file’s attributes vary from one operating system to another, but typically consist ofA. File nameB. SectorsC. TypeD. The name of the creating program56.The per-process open-file table isA. unique and maintained by OS for all usersB. one of OS data structure for better performance of file system managementC. claimed by each process and for its own purposeD. an accounting data structure to tell how many files opened by the process57.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 above59.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 timesB. Some file systems are read only, not allowing any write operation.C. Some file systems are dedicated to write only once but read many timesD. The web site providing search service is an example facilitated the file system to write once but read manytimesB flash drive is popular nowadays. Usually it is not formatted withA. btrfsB. ISO 9660C. FA TD. EXT261.None of the disk-scheduling disciplines could avoid starvation, except ____.A. FCFSB. SSTFC. C-SCAND. C-LOOK62.Overheads are always associated with an interrupt service, resulting in worse performance. However, theydo not include the cost of ________A. saving process stateB. executing the instruction just next the interrupt pointC. restoring process stateD. flushing the instruction pipeline63.Look at the fact that requests are not usually uniformly distributed. For example, a cylinder containing thefile 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 cylindersB. Cache the metadata in primary memoryC. Back up the metadataD. Redesign the file system by discarding the indirection64.Which scheme of disk array provides no data redundancy ?A. RAID 3B. RAID 0C. RAID 1D. RAID 265.Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. The drive is currently serving arequest at cylinder 143, and the previous request was at cylinder 125. The queue of pending requests, in FIFO order, is86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130Starting 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, 86B. 143, 913, 948, 1022, 1470, 1509, 1750, 1774, 130, 86C. 143, 130, 86, 913, 948, 1022, 1470, 1509, 1750, 1774D. 143, 86, 1470, 913, 1774, 948, 1509, 1022, 1750, 13066.Some file systems allow disk storage to be allocated at different levels of granularity. For example, a filesystem could allocate 4KB of disk space as a single block, or as four 1024-byte blocks. Do you think the example isA. Absolutely nonsenseB. Probably true, but it is only for academic researchC. Practical, because there exists a popular file system using the schemeD. Absolutely true, all file systems use the scheme67.Which of the following statements is wrong from the operating system view?A. Memory sometimes is used as a diskB. Memory sometimes is used as read onlyC. Memory sometimes is used as a USB flash driveD. Memory sometimes is used as a disk cache68. A logical address is ________A. the address in an object fileB. the address in an executable fileC. the address in a CPU instruction together with operatorD. All the above69. A file system uses a scheme with support for extents. A file is a collection of extents, with each extentcorresponding to a contiguous set of blocks. This file system is calledA. Contiguous allocationB. Linked allocationC.Indexed allocationD. None of above70.Which reason does not make sense: The operating system generally treats removable disks as shared filesystems but assigns a tape drive to only one application at a time, becauseA. Disks have fast random-access time, so they give good performance for interleaved access streams. Bycontrast, tapes have high positioning timeB. The owner of the Tape cartridge may wish to store the cartridge off-site (far away from the computer) tokeep a copy of the data safe from a fire at the location of the computerC. 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 transferD. None of abovePart 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 PriorityP1 10 3P2 1 1P3 2 3P4 1 4P5 5 2The 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 same9 // 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 section16 unlock(integer i) {17 Number[i] = 0;18 }1920 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分)12345678910A D D C C CB B B B11121314151617181920A A D D D C C C C B21222324252627282930A A A D D D D CB B31323334353637383940A A A A D C CB B B41424344454647484950A AB BC CD D A A51525354555657585960A B C D A B C D A B61626364656667686970A B B B C C C D D DPart 2.1.Answer: 12 分a. Turnaround time(共10分,错1个扣0.5分)FCFS RR SJF PriorityP1 10 19 19 16P211 2 1 1P3 13 7 4 18P4 14 4 2 19P5 19 14 96b. 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 thecondition 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 millisec0.1 = −0.1P + 2400 P + 14000 P0.1 =16,400 PP =0.000006(答案正确的,给4分。