重庆大学操作系统全英文期末考试题(带答案)
2022年重庆大学英语考试真题卷精选全文

精选全文完整版(可编辑修改)2022年重庆大学英语考试真题卷(本卷共分为2大题50小题,作答时间为180分钟,总分100分,60分及格。
)单位:姓名:考号:一、单项选择题(共48题,每题2分。
每题的备选项中,只有一个最符合题意)1.What does "He wisely refused to spend his money" meanA.It was wise of him to refuse to spend his money.B.He refused to spend his money in a wise manner.C.He was short of money and didn't want to buy anything.D.He refused, in a wise manner, to spend his money.2.The following are all correct responses to "Who told the news to the teacher " EXCEPT ______ .A.Jim did this.B.Jim did so.C.Jim did that.D.Jim did.3.Quality is ______ counts most.A.whichB.thatC.whatD.where4.In his plays Shakespeare ______ his characters live through their language.A.would makeB.had madeC.madeD.makes5.The square itself is five hundred yards wide, five times ______ the size of St. Peter's in Rome.A./B.that ofC.which isD.of6.Which of the following sentences expresses "probability"A.You must leave immediately.B.You must be feeling rather tired.C.You must be here by eight o'clock.D.You must complete the reading assignment on time.7.When he first started in university, he really felt at ______ with his major--economics.A.shoreB.bankC.oceanD.sea8.On the road motorists should be aware of cyclists and be ______ towards them.A.considerableB.consideringC.considerateD.considered9.The company has capitalized ______ the error of judgment made by its business competitor.A.inB.overC.withD.on10.Sally was a bit shy, but the teacher found her quite ______ discussinga recent film with others.A.at homeB.at mostC.at houseD.at heart11.Tim has failed three courses this semester, so he will have to ______ them next semester.A.remakeB.repeatC.reapplyD.revise12.Keep this reference book; it may come in ______ one day.A.handyB.usefulC.convenientD.helpful13.The questions that the speaker raised were well ______ the average adult.A.pastB.onC.beyondD.through14.Teachers in this school were encouraged to use drama as a(n) ______ of learning.A.designB.instrumentC.agencyD.tool15.First, we need to find out what his scheme is, and then act ______ . A.sensitivelyB.imaginativelyC.efficientlyD.accordingly16.At first Jim was not quite clear what he was going to do after university, but now he seems ______ on becoming a computer programmer. A.fitB.setC.disposedD.decided17.When invited to talk about his achievements, he refused to blow his own ______ and declined to speak at the meeting.A.trumpetB.whistleC.bugleD.flute18.In spite of the treatment, the pain in his leg grew in ______ . A.gravityB.extentC.intensityD.amount19.Bus services between Town Centre and Newton Housing Estate will be ______ until the motorway is repaired.A.discontinuedB.suspendedC.haltedD.ceased20.The moon, being much nearer to the Earth than the Sun, is the ______ cause of the tides.A.principalB.basicC.initialD.elementary21.Teddy came to my ______ with a cheque of $ 200 to pay my room rate, after I phoned him that my wallet had been stolen.A.attendanceB.assistanceC.rescueD.safety22.The police have asked that ______ who saw the accident should get in touch with them.A.somebodyB.oneC.anyoneD.someone23.I'd sooner you ______ deliver the sofa tomorrow.A.didn'tB.shouldn'tC.wouldn'tD.mustn't24.When he finally emerged from the cave after 30 days, John was ______ pale.A.enormouslyB.startlinglyC.uniquelyD.dramatically25.______ ghost exists in the world. That's your illusion.A.No such a thing asB.No such a thing as aC.No such thing as aD.No such thing as26.______ allowing for his age, he still acts very immaturely.A.ButB.YetC.AlthoughD.Even27.He promised to return the book the next day without ______ .A.failB.defaultC.troubleD.failure28.By cutting down trees we ______ the natural habitat of birds and animals.A.damageB.injureC.hurtD.harm29.The government is doing a ______ of people's changing social habits. A.planB.surveyC.projectD.research30.Although he was on a diet, the food ______ him enormously. A.inspiredB.temptedC.overcameD.encouraged31.The title of the book was on the ______ of my tongue, but I just could not think of it.A.endB.tipC.backD.point32.If you want this pain killer, you'll have to ask the doctor for a ______ . A.receiptB.recipeC.subscriptionD.prescription33.Fred has ______ kind of humour that can only be appreciated by those willing to search beneath the surface.A.an obviousB.a hiddenC.a subtleD.a controlled34.A thorough check of the accounts has revealed ______ a tax evader. A.him beingB.him to beC.that he beD.that he had been35.Mrs. Smith is afraid that she and her husband don't see ______ on New Year's resolutions.A.face to faceB.eye to eyeC.hand to handD.heart to heart36.______ of the department, I would like to thank Mr. Jones for his stimulating lecture.A.On behalfB.On accountC.In personD.Instead37.Fewer and fewer of today's workers expect to spend their working lives in the same field, ______ the same company.A.all elseB.much worseC.less likelyD.let alone38.The ______ in David's character has hindered him from advancing in his career.A.weaknessB.shortcomingC.demeritD.defect39.______ I realised the consequences, I would never have done that. A.UnlessB.IfC.WhenD.Had40.Flag Day is a legal holiday only in the state of Pennsylvania, ______ Betsy Ross sewed the first American flag.A.whichB.whereC.thatD.has41.She said she wouldn't call us the next day, ______sheA.wouldB.wouldn'tC.didD.didn't42.They bought the land with a ______ to building a new office block. A.purposeB.reasonC.viewD.goal43.Maggie tiptoed over and took the clock away because she hated to hear______ it when she was trying to get some sleep.A.soundingB.hummingC.tickingD.ringing44.His argument does not ______ up to close scrutiny.A.holdB.standC.comeD.look45.Be careful with John; I think he has ______ motives for being so generous.A.ultimateB.ulteriorC.interiorD.hidden46.The vast majority of people in any given culture will ______ to established standards of that culture.A.confineB.conformC.confrontD.confirm47.It's a shame ______ able to give them any advice.A.not to have beenB.to have not beenC.to have been notD.to not have been48.They ______ so tired if they ______ for a whole day.A.wouldn't feel ... didn't walkB.wouldn't feel ... weren't walkingC.wouldn't be feeling ... weren't walkingD.wouldn't be feeling ... hadn't been walking二、多项选择题(共48题,每题2分。
2022年重庆大学软件工程专业《操作系统》科目期末试卷B(有答案)

2022年重庆大学软件工程专业《操作系统》科目期末试卷B(有答案)一、选择题1、某进程访问页面的序列如下所示。
若工作集的窗口大小为6,则在t时刻的工作集为()。
A.(6,0,3,2)B. (2,3,0,4)C.(0,4,3,2,9)D.(4,5,6,0,3,2)2、为了使多个进程能有效地同时处理输入和输出,最好使用()结构的缓冲技术。
A.缓冲池B.循环缓冲C.单缓冲D.双缓冲3、在请求分页系统中,页面分配策略与页面置换策略不能组合使用的是()。
A.可变分配,全局置换B.可变分配,局部置换C.固定分配,全局置换D.固定分配,局部置换4、下列关于虚拟存储的叙述中,正确的是()A.虚拟存储只能基于连续分配技术B.虚拟存储只能基于非连续分配技术C.虚拟存储容量只受外存容量的限制D.虚拟存储容量只受内存容量的限制5、解决主存碎片问题较好的存储器管理方式是()A.可变分区B.分页管理C.分段管理D.单一连续分配6、一个多道批处理系统中仅有P1,和P2两个作业,P2比P1晚5ms到达。
它们的计算和I/O操作顺序如下:P1:计算60ms,I/O 80ms,计算20msP2:计算120ms,I/O 40ms,计算40ms。
若不考虑调度和切换时间,则完成两个作业需要的时间最少是()。
A.240msB.260msC.340msD.360ms7、下面说法错误的有()。
I分时系统中,时间片越短越好。
II.银行家算法是防止死锁发生的方法之。
III若无进程处于运行状态,则就绪和等待队列均为空。
A. I和IIB. II和IIIC. I和IIID. I、II和II8、文件系统采用多级目求结构的目的是()。
A.减少系统开销B.节约存储空间C.解决命名冲突D.缩短传送时间9、下列选项中,磁盘逻辑格式化程序所做的T作是()I.对磁盘进行分区II.建立文件系统的根目录III.确定磁盘扇区校验码所占位数IV.对保存空闲磁盘块信息的数据结构进行初始化,A. 仅IIB.仅II、IVC.仅III,IVD.仅I、II、IV10、下列关于线程的叙述中,正确的是()。
2022年重庆大学计算机科学与技术专业《操作系统》科目期末试卷B(有答案)

2022年重庆大学计算机科学与技术专业《操作系统》科目期末试卷B(有答案)一、选择题1、某文件系统物理结构采用三级索引分配方法,如果每个磁盘块的大小为1024B.每个盘块索引号占用4B,请问在该文件系统中,最大文件的大小最接近的是()A.8GBB.16GBC.32GBD.2TB2、()结构的文件最适合于随机存取的应用场合。
A.流式B.索引C.链接D.顺序3、作业8:00到达系统,估计运行时问为1h。
若从10:00开始执行该作业,其响应比为()。
A.2B.1C.3D.0.54、在操作系统中,一方面每个进程具有独立性,另一方面进程之间具有相互制约性。
对于任何两个并发进程,它们()。
A.必定无关B.必定相关C.可能相关D.可能相同5、下列关于进程和线程的叙述中,正确的是()A.不管系统是否支持线程,进程都是资源分配的基本单位,B.线程是资源分配的基本单位,进程是调度的基本单位C.系统级线程和用户级线程的切换都需要内核的支持D.同一进程中的各个线程拥有各自不同的地址空间6、假定某页式管理系统中,主存为128KB,分成32块,块号为0,1,2,3,....31:某作业有5块,其页号为0,1,2,3,4,被分别装入主存的3,8,4,6,9块中。
有一逻辑地址为[3,70]。
试求出相应的物理地址(其中方括号中的第一个元素为页号,第二个元素为页内地址,按十进制计算)()。
A.14646B.24646C.24576D.345767、()存储管理方式提供一维地址结构。
A.分段B.分页C.分段和段页式D.以上都不对8、在单处理器系统中,可并行的是()I.进程与进程II.处理器与设备III.处理器与通道IV.设备与设备A.I、II和IIIB.I、II和IVC.I、III和IVD.II、III和IV9、一个多道批处理系统中仅有P1,和P2两个作业,P2比P1晚5ms到达。
它们的计算和I/O操作顺序如下:P1:计算60ms,I/O 80ms,计算20msP2:计算120ms,I/O 40ms,计算40ms。
2022年重庆大学数据科学与大数据技术专业《操作系统》科目期末试卷A(有答案)

2022年重庆大学数据科学与大数据技术专业《操作系统》科目期末试卷A(有答案)一、选择题1、处理外部中断时,应该山操作系统保存的是()A.程序计数器(PC)的内容B.通用寄存器的内容C.快表(TLB)中的内容D.Cache中的内容2、 OS通常为用户提供4种使用接口,它们是终端命令、图标菜单、系统调用和()A.计算机高级指令B.宏命令C.类似DOS的批命令文件或UNIX的shell文件D.汇编语言3、若系统中有5台绘图仪,有多个进程需要使用两台,规定每个进程一次仪允许申请一台,则最多允许()个进程参与竞争,而不会发生死锁。
A.5B.2C.3D.44、采用资源剥夺法可以解除死锁,还可以采用()方法解除死锁。
A.执行并行操作B.撤销进程C.拒绝分配新资源D.修改信号量5、并发进程执行的相对速度是()A.由进程的程序结构决定的B.由进程自己来控制的C.与进程调度策略有关的D.在进程被创建时确定的6、下列关于SPOOLing技术的叙述中,错误的是()A.需要外存的文持B.需要多道程序设计技术的支持C.可以让多个作业共享一台独占设备D.由用户作业控制设备与输入/输出之间的数据传送7、 I/O中断是CPU与通道协调I作的种于段,所以在()时,便要产生中断。
A.CPU执行“启动I/O”指令而被通道拒绝接收B.通道接受了CPU的启动请求C.通道完成了通道程序的执行D.通道在执行通道程序的过程中8、考虑一个文件存放在100个数据块中。
文件控制块、索引块或索引信息都驻留内存。
那么如果().不需要做任何磁盘I/O操作。
A.采用连续分配策略,将最后一个数据块搬到文件头部,B.采用单级索引分配策略,将最后一个数据块插入文件头部C.采用隐式链接分配策略,将最后一个数据块插入文件头部D.采用隐式链接分配策略,将第一个数据块插入文件尾部,9、如果当前读写磁头正在53号柱面上执行操作,依次有4个等待访问的请求,柱面号,依次为98,37,124,65,当采用()算法时,下一次磁头才可能到达37号柱面。
操作系统期末试题及答案

《操作系统》期末试卷姓名一、选择题( 15*2 分=30 分)1 、在操作系统中, JCB 是指(A )A.作业控制块B.进程控制块 C.文件控制块 D.程序控制块2、并发进程之间 ( D )A. 彼此无关B. 必须同步C. 必须互斥D. 可能需要同步或互斥3、运行时间最短的作业被优先调度,这种调度算法是( C ) 。
A.优先级调度 B.响应比高者优先C.短作业优先D.先来先服务4、某页式存储管理系统中,地址寄存器长度为 24 位,其中页号占 14 位,则主存的分块大小是( C )字节A. 210 B. 211 C. 214 D. 2245 、( D ) 是一种只能进行 P 操作和 V 操作的特殊变量。
A.调度 B.进程 C.同步D.信号量6、在操作系统中,并发性是指若干事件( )A.在同一时刻 B.一定在不同时刻C.在某一时间间隔内D.依次在不同时间间隔内7、很好地解决了“碎片”问题的存储管理方法是( A ) 。
A. 页式存储管理B. 段式存储管理C. 静态分区管理D. 可变分区管理8、多道程序设计是指 ( D )A. 在实时系统中并发运行多个程序B. 在分布系统中同一时刻运行多个程序C. 在一台处理机上同一时刻运行多个程序D. 在一台处理机上并发运行多个程序9 、设有 3 个进程共享同一程序段而每次最多允许两个进程进入该程序,若用 PV 操作作同步机制 , 则信号量 S 的取值范围为 ( ) 。
A.2,1,0,-1B.3,2,1,0C.2,1,0,-1,-2D.1,0,-1,-210、在提供虚拟存储的系统中,用户的逻辑地址空间主要受( C )的限制。
A. 内存空闲块的大小 B.外存的大小C.计算机编址范围D.页表大小11、采用时间片轮转法调度是为了 ( ) 。
A.多个终端都能得到系统的及时响应B.先来先服务 c 优先数高的进程先使用处理器 D.紧急事件优先处理12 、 ( )必定会引起进程切换。
操作系统期末考试试题及答案PDF

操作系统期末考试试题及答案PDF一、单项选择题(每题2分,共20分)1. 在现代操作系统中,进程和程序的主要区别是()。
A. 进程是一个动态的概念,程序是一个静态的概念B. 进程是程序的执行过程,程序是进程的代码集合C. 进程是程序的代码和数据的集合,程序是进程的执行过程D. 进程是程序的代码集合,程序是进程的执行过程2. 在操作系统中,进程调度的目的是()。
A. 决定进程的执行顺序B. 提高CPU的利用率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. 下列关于操作系统的用户界面的说法,不正确的是()。
2022年重庆大学软件工程专业《操作系统》科目期末试卷A(有答案)

2022年重庆大学软件工程专业《操作系统》科目期末试卷A(有答案)一、选择题1、下列选项中,操作系统提供给应用程序的接口是()。
A.系统调用B.中断C.库函数D.原语2、执行系统调用的过程包括如下主要操作:①返回用户态②执行陷入(trap)指令③传递系统调用参数④执行相应的服务程序正确的执行顺序是()A.②->③->①->④B.②->④->③->①C.③->②->④->①D.③->④->②->①3、()有利于CPU繁忙型的作业,而不利于1/0繁忙型的作业(进程)。
A.时间片轮转调度算法B.先来先服务调度算法C.短作业(进程)优先调度算法D.优先权调度算法4、一个进程的读磁盘操作完成后,操作系统针对该进程必做的是(),A.修改进程状态为就绪态B.降低进程优先级C.给进程分配用户内存空间D.增加进程时间片大小5、进程调度算法中,可以设计成可抢占式的算法有()。
A.先来先服务调度算法B.最高响应比优先调度算法C.最短作业优先调度算法D.时间片轮转调度算法6、I/O交通管制程序的主要功能是管理()的状态信息。
A.设备、控制器和通道B.主存、控制器和通道C.CPU、主存和通道D.主存、辅存和通道7、下列关于SPOOLing的叙述中,不正确的是()A.SPOOLing系统中必须使用独占设备B.SPOOLing系统加快了作业执行的速度C.SPOOLing系统使独占设备变成了共享设备D.SPOOLing系统利用了处理器与通道并行上作的能力8、在磁盘上容易导致存储碎片发生的物理文件结构是()A.链接B.连续C.索引D.索引和链接9、下面关于目录检索的论述中,正确的是()。
A.由于散列法具有较快的检索速度,因此现代操作系统中都用它来替代传统的顺序检索方法B.在利用顺序检索法时,对树形目录应采用文件的路径名,应从根目录开始逐级检索C.在利用顺序检索法时,只要路径名的一个分量名未找到,便应停止查找D.在顺序检索法的查找完成后,即可得到文件的物理地址,10、在一个操作系统中对内存采用页式存储管理方法,则所划分的页面大小()。
操作系统英文版课后习题答案整理word文档良心出品

l.lWhat are the three main purpo ses of an op erat ing system? ⑴ In terface betwee n the hardware and user; (2) man age the resource of hardware and software; (3) abstracti on of resource;Answer:• To provide an environment k>r a computer user to< execute programs on computtr hardware in a ccnvenient and efficient manner• Tb 吕 lk>cat 特 the 艺t?parattz resources of the compuler as nteded to strive the prtjblem given* The allocation p TOCESS should be as fair and efficient as possible.• Asa ct>ntroJ p a>gram it serves two major functions : (1) sup ervision of the execution of user programs to p re vent errors and improper use of the computer, and (2) manage ment of the «p erat it) JI and control of [/O devices.1.2 List the four steps that are necessary to run a program on a completely dedicated machine. Prep rocess ing > Process ing > Linking > Executi ng.Answer乩 Reserve machine time*b. Manually load program into memory.c. Load starting address and begin execution.d.Monitor and control execution of program fnim ct>nsoie.1.6 Define the esse ntial prop erties of the follow ing types of op erat ing systems: a. Batch b. In teractive c. Time shari ng d. Real time e. Network f. DistributedAnswerBatch. Jobs with similar needs are batched together and run through the computer as a grcup by anoperator or automatic job st^quencer.[咆jrformHrk :电 is increased by atteiTipting to keep CPU andI/O devices busv 試 all times throughoff-lineoperation, Kptx?ling, and multiprogramming* Batch is good for executing large jobs that netxlinteraction; it can be siubmilted and picked up laterInteractive. Thkin J of many short transactiorifd where the results ofthe next transaction may be unpredictable. Response rirne needs to be short (seconds] since the user submils and w^iih For the result.Time sharing. This systems u&es 匚n scheduling and mLiltiprt)gramming toprtividt* economical interactive of a system. The CP 匚 占w 让 chem rap idly fn>nn one user to another Instead of havinga job defined by spooled card images^ each program re^dsa” b. c.its next control card from the terminal, and output is normally printed immediately to the screen. Real time. Often usvd in a dedicated application, tliis system reads information fram sensors and mustrespond within a fixed amount of time to ensure correct performance- Network.Distributed .This system distributes computation arntmg se¥t?ral physical prtxzesKors, Theprt>cesst>rs do not share memory or a cltKk. Instead, each prixessor has its t>wn kxzal memory. They communicate with each other through various communicatitm lines, such as a high-speed bus or telephone line.1.7 hardware. When is it approp riate for the op erat ing system to forsake this principle and to waste " resources? Why is such a system not really wasteful?Answer Single*user systems shtiuId maximize use of the systenn for the user. A GUI might “waste" CPU cy<les, but it optimizes the user's interaction with the system.2.2 How does the distinction between monitor mode and user mode function as a rudimentary form of p rotecti on (security) system?亠 ■ ■Answer; By establishing a set of privileged instructions that can be executed only when in the mt>niu)r mode, the operating system is assured of ct^ntrolling the entire system at all times.2.3 What are the differe nces betwee n a tra p and an in terru pt? What is the use of each fun cti on?Answer An interrupt is a ha rd w a re-genera ted change-of-flow within the system. An interrupt handler is summoned to deal with the c<iuse oF the interrupt; control is then re*turned to the interrupted context and instruction. A trap is a sof t wa re-genera ted in terru p 匕 An interrupt can bv usvd to signal the coiTipJctk*n of an [/O to obviate the need fnr du\ icy poiling. A trap can be used to call operating system routines or to catch arithmetic errors.2.5 Which of the follow ing in structi ons should be p rivileged? a. Set value of timer. b. Read the clock. c. Clear memory.d. Turn off i nterru pts.e. Switch from user to mon itor mode.d. Wehave stressed the n eed for an op erat ing system to make efficie ntuse of the comp ut ing3OS Exercise BookClass No. NameAnswer: The following instructions should be privileged: a. Set value of timer. b. Clear memory. c. Turn off interruptacL Switch from user to monitor mode.2.8 Protect ing the op erati ng system is crucial to en suri ng that the comp uter system op erates correctly. P rovisi on of this p rotecti on is the reas on beh ind dual-mode op erati on, memory pr otecti on, and the timer. To allow maximum flexibility, however, we would also like to p lace mini mal con stra ints on the user. The followi ngis a list of op erati ons thatof in structi ons that must be p rotected? a. Change to user mode. b. Change to mon itor mode. c. Read from mon itor memory. d. Write into mon itor memory.e. Fetch an in structi on from mon itor memory.f. Tur n on timer in terru pt.g. Turn off timer in terru pt.Answen The minimal set of instructions that must be protected are:Read from monitor memory* Write into monitor me mor v.*Turn off timer interrupt.3.6 List five services p rovided by an op erat ing system. Exp lain how each p rovides convenience to the users. Explainalso in which cases it would be impossible for user-levelpr ograms to p rovide these services.Answer:are no rmally p rotected.What is the minimal seta. Change to monitor mod 匕b. c.Program execution. The operating system loads the contents (or sections) of a file into memory and begins its execution. A user-level pm呂ram could not be trusted to properly allocate CPU time.I/O' op e rat ions. Disks, tapes, serial lines^ and other devices must be communicated with at a \ ery low level. The user need only specify the device and the operation to perform on it, while the system converts that request into device- or controller-specific commands. User-level programs cannot be trusted to only access devices they should have access to nnd to only access them when they art otherwise unused.File-system manipulation. There arv many details in file creation, deletion, alkKation, and naming that users should not have to perform. Blocks of disk spact? are used by files and must be tracked.Deleting a file requires removing the name file information and freeing the 说[located bk>cks.[Protections must also be checked to assure prtiper file access. User prt^grams could neither ensure adherence tct protection methexJs nor be trusted to allocate only free blocks and deallocate blocks on file deletion.Communications. Message passing between systems requires messages be turned into packets of information, sent to the network contnUlei; transmitted across a communications medium, and reassembled by the destination system. Packet ordering and data correction must take place. Again, user programs might not coordinate access to the network device, or they might reevi^T packets destined for other processes. • Error detection. Error detection occurs at both the hardware and sofirware levels. At the hardware le\-el, all data transfers must be inspected to ensure that data have not been c(>rrupted in transit AU data on media must bi checked to be sure they have not changed since they were written to the media. At the software level, media must be checked for data consistency;for instance, do the number of allt>cated and unallocated blocks of storage match the total number on the device. There, errors are frequently prexzess-independent (for instance, the corruption of data on a disk), so there must be a global program (ttiE op erating system) that handles all type 吕 of errors. Also, by having errors processed by the operating system, p rocesses need not contain code to catch and correct all thE errors possible on a syst Em.3.7What is the purpose of system calls?Answer System ualls(J1U>W user-lewl lii request ices uf tl咤uperdting sv;»-tem.3.10 What is the purpose of system programs?jVnswcr: Evstem p rograms can be thought of bundlcz^ uf useful systctu oils. Tbevprovide basic functicrahty to users and so users de not need to write their own programs to sol、忙common problems.4.1MS-DOS pr ovided no means of con curre nt pr ocess ing. Discuss three major comp licati ons that con curre nt p rocess ing adds to an op erat ing system.5OS Exercise BookClass No. NameAnswer:A method of time sharing must be implemented to allow each of several processes to have access to the systen'i. This method inxoJvcs the prompt ion of processes that do not voluntarily giA-e up the CPU (by using A system cal], for instance) <ind the kernel being reentrant (so more than one prtxzess may be executing kernel code concurrently).Processes and system resources must hav E protections and must be prciteck?d frtiTn each other Any given process must be limited in the amount of memory it can use and the operations it can perform on devices like disks.Care must be taken in the kernel to pre\ ent deadkxzks between processe 鬲 so prcicesses aren't waiting for each other's allcxated rest>urces.4.6full at any one time. Modify the algorithm to allow all buffers to be utilized fully.Answer No answer.5.1 P rovide two p rogram ming exa mp les of multithread ing givi ng imp rove p erforma nee over a sin gle-threaded soluti on.Answer (1) A server that services each request in a sep a rate thread. (2) A paral* lelized application such as matrix multi plication where different p arts of the matrix may be worked on in parallel. (3) An interactive GUI program such as a dibugger where a thread is used to monitor user input, another thread represents the running flppHcation, and a third thread monitors performance.5.3 What are two differences between user-level threads and kernel-level threads? Under what circumsta nces is one type better tha n the other?r■Answer Context switching between user tlireads is quite similar tG switching between kernel threads, although it is dependent on the threads library and how it maps user threads to kernel threads. In general, context switching between user threads involves taking a user thread of its LWP and replacing it with another thread. This act typically involves saving and restoring the st^te of the registers.6.3 Con sider the follow ing set of p rocesses, with the len gth of the CPU-burst time give n in millisec on ds: P rocessP1 P2 P3 F4 P5The p rocessesare assumed to have arrived in the orderThe correct p roducer— con sumer algorithm in Secti on 4.4 allows only n-1 buffers to beBurst 10 1 2 1 5Time P riority 3 1 3 4 2P1, P2, P3, P4, P5, all at time 0.a.Draw four Gantt charts illustrati ng the executi on of these p rocesses using FCFS, SJF, a nonpreemp tive p riority (a smaller p riority n umber imp lies a higher p riority), and RR (qua ntum = 1) scheduli ng.b.What is the tur narou nd time of each pr ocess for each of the scheduli ng algorithms in part a?c.What is the wait ing time of each p rocess for each of the scheduli ng algorithms in p art a?d.Which of the schedules in p art a results in the mini mal average wait ing time (over all pr ocesses)?An swer:AnswerThe four Gantt charts area.b- Turnaround timeFCFS円101113卩414 卩519RR■19274SJF191 ^riority18196Waiting time (turnaround time minus burst time)FCFS RR卩210Ih11卩413卩514 SJF214Prit^ritv•J61618d. Shortest Job First6.4 Suppose that the followingpr ocess will run the listed amou nt of time. In an sweri ng the questi ons, use nonpreemp tivescheduli ng and base all decisi ons on the in formati on you have at the time the decisi onp rocesses arrive for execution at the times in dicated. Each70.110.4a. What is the average tur narou nd time for these p rocesses with the FCFS scheduli ng algorithm?b. What is the average turnaround time for these processes with the SJF scheduling algorithm?c. The SJF algorithm is supp osed to impr ove p erforma nee, but no tice that we chose to run p rocessP1 at time 0 because we did not know that two shorter p rocesses wouldarrive soon. Comp ute what the average turn arou nd time will be if the CPU is left idle for the first 1 un it and the n SJF scheduli ng is used. Remember that p rocesses and P2 are wait ing duri ng this idle time, so their wait ing time may in crease. This algorithm could be known as future-k no wledge scheduli ng.Answer; a. 10,53b. 9.53c. 6.86Remember that turnaround time LS finishing time minus arrival time^ so you have h) subtract the arrival times to compute the turnaround times. F 匚FS is 11 if yw forget subtract arrival time.6.10 Explain the differe nces in the degree to which the follow ing scheduli ng algorithms discrim in ate in favor of short p rocesses: a. FCFS b. RRc. Multilevel feedback queuesAnswen孔 FCFS —discriminates against sliort jobs since any short jobs arriving after long jobs will have a kmger waiting time.b. RR 一treats all jobs equally (giving them eqiiaL bursts of CPU time) so short Qbm will be able toleave the system faster since they will finish first.c. Multilevel feedback queues —work similar to the RR algorithm —they discriminate favorably towardshort jt>bs.7.7 Show that, if the wait and sig nal op erati ons are not executed atomically, then mutual exclusi on may be violated.Answer No answer,must be made.ClassOS Exercise BookNo.NameAi rhal rimeBuist 1 i[uvPi7.8 The Slee pin g-Barber Pr oblem. A barbersho p con sists of a wait ing room with n chairsand the barber room containing the barber chair. If there are no customers to be served,the barber goes to slee p. If a customer en ters thebarbersho p and all chairs are occu pi ed,then the customer leaves the sho p.lf the barber is busy but chairs are available, the nthe customer sits in one of the free chairs. If the barber is aslee p, the customer wakes up the barber. Write a p rogram to coord in ate the barber and the customers.Answer: Please refer to the supporting Web site for source code solution.8.2 Is it possible to have a deadlock involving only one single process? Explain your answer.Answer No. This follows directly from the hold-and-wait condition.8.4 Con sider the traffic deadlock dep icted in Figure 8.11.a. Show that the four n ecessary con diti ons for deadlock in deed hold in this exa mple.b. State a sim pie rule that will avoid deadlocks in this system.Answer No answerCon Sider the follow ing snap shot of a system:Allocati onMax AvailableA B C DA B C D A B C D P0 0 0 1 2 0 0 1 2 1 5 2 0P1 1 0 0 0 1 7 5 0 P2 13 54 2 35 6P 3 0 6 3 2 0 6 5 2P40 0 1 40 6 5 6An swer the follow ing questi ons using th e ban kera. What is the content of the matrix Need?b. Is the system in a safe state?c. If a request from p rocess immediately?Answer:A. Deadlock cannot occur because preempticin exists.b. Yes. A process may never acquire all the resources 让 needs if they are continuously preempted by aseries of reqviests such as those of process C.9.5 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 efficie nt use of memory?8.13 s algorithm:P1 arrives for (0,4,2,0), can the request be gran ted9OS Exercise BookClassNo. NameAnswer:212K is put in 500K partition 417K is put in BOOK partidon112K is put in 288K partition (new partition 288K = 500K = 212K) e. 426 K must wa 让212K 仏 put in 300K partidon 417K is put in 500K partition1I2K is put in 2nOK parti tin n 426K put in 600K partidon212K is put in 600K partition417K is put in 500K partitio 口 112K is put in 388K partidon 426K must waitIn this example. Best-fit turns out to be the best9.8 Con Sider a logical address sp ace of eight p ages 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 p hysical address?Answera. Logical addrej^s: 13 bitsb.卩hvsical address: 15 bits9.16 Con Sider the follow ing segme nt table: Segme nt Base Len gtha. First-fit:d ・ f. Best-fit:8- h* k. Worst-fit:m. n.600 14 100 580 96What are the p hysical addresses for the follow ing logical addresses? a. 0,430 b. 1,10 c. 2,500 d. 3,400 e. 4,112Answena. 219 + 43(1-649illegal reference, trap ki Dpvra ting systemillegal reference, trap tu op grating system10.2 Assume that you have a page referenee string for a process with m frames (initiallyall emp ty). The p age refere nee stri ng has len gth p with n disti net p age n umbers occur init. For any p age-re pl aceme nt algorithms,a. What is a lower bou nd on the n umber of p age faults?b. What is an upper bou nd on the n umber of p age faults?Answer a. tr b.卩10.11 Con Sider the follow ing p age refere nee stri ng: 1, Z 3, 4, 2,1,5, 6, Z 1,2, 3, 7, 6, 3, Z 1, Z 3, 6.How many p age faults would occur for the follow ing repl aceme nt algorithms, assum ing one, two, three, four, five, six, or seve n frames? Remember all frames are in itially emp ty, so your first uni que p ages will all cost one fault each.LRU rep laceme nt FIFO rep laceme nt Op timal rep laceme nt0 1 2 3 4219 2300 90 1327 1952 b. 2300 + 10 = 2310c. d. 1327 + 400= 17271111.7 Explain the purp ose of the openAnswer :■ The open operatit>n informs the system that the named file is about to become active^* Tlie cloiie «peration informs the system that tlie named file is no longer in active use by the user who issued the 匚lose operation.11.9 Give an example of an application in which data in a file should be accessed in the followi ng order: a. Seque ntially b. Ran domlyAnsiver :Print the content of the file.Print the content of record /. This record can be found using hashing or index techniques.11.12 theseusers to be able to access one file.a. How would you sp ecify this p rotecti on scheme in UNIX?b. Could you suggest ano ther pr otecti on scheme that can be used more effectively for this purpose tha n the scheme p rovided by UNIX?Answera. There are two methods for achieving this:Answer:ClassOS Exercise BookNo.NameNumber of framesLRU FIFO Optimal12 3 48-5 00 8 6 4and close op erati ons.a. b. Con sider a system that supports 5000 users. Suppose that you want to allow 4990 ofi. Create an access list with the names of all 4990ii. Put these 4990 users in one group and set the group access accordingly. This scheme cannot alwaysbe implemented since user groups are restricted by th# system.b. The univErse access information applies to all users unless their name appears in the access-controlHst with different access permission. With this scheme you simply put the names of the remaining ten users in the access control list but no access privileges alh)wcd.■r2Tl _Consider _a filecurrently consisting of 100 blocks.__Assume that _the file control block(ande in dex block, in the case of i ndexed allocati on) is already in memory. Calculate how any disk I/O op erati ons are required for con tiguous, li nked, and in dexed (sin gle-level) locati on strategies, if, for one block, the follow ing con diti ons hold. In thecase, assume that there is no room to grow in the beg inning, but there to be added is stored inAnswer198 9813.2 Con Sider the follow ing I/O see narios on a sin gle-user PC.a. A mouse used with a grap hieal user in terfaeeb. A tape drive on a multitask ing op erat ing system (assume no device p realloeati on is available) e. A disk drive containing user filesd. A gra phics eard with direet bus conn eeti on, aeeessible through memory-ma pped I/OFor each of these I/O see narios, would you desig n the op erat ing system to use bufferi ng, spo oli ng, eaehi ng, or a comb in ati on? Would you use p olled I/O, or in terru pt-drive n I/O? Give reas ons for your choices.teon tiguousalloeati onis room to grow in the end. Assume that the block in formatio nmemory.a. The block is added at the beg inning.b. The block is added in the middle. e. The block is added at the end.d. The block is removed from the begi nning.e. The block is removed from the middle.f. T he block is removed from the end.ContiffljQus LinkedIndexeda. b.201 101 52 3 52 10013OS Exercise BookClass No. NameAnswenA mouse used with a graphical user interfaceBuffering may bt? needed to record mouse movement during times when higher- priority op erations aretaking place. Spooling and caching are inap propriat 巳 Interrupt driven I/O is m 〔>st appropriate^ A t 日pe drive on a multitasking operating system (assume no device preallocation is availabl £) Buffering may be needed to manage through put difference behveen the tape drive and the souro? or destination of the I/O, C 白匚hing can bv used to hold copies of daU that resides on the tape, for faster access. Spooling could be used to stage data to the device when multiple users desire to read from or write to it. Interrupt driven I/G is likely to allow the best performance. A disk drive containing user filesBuffering can be used to hold data while in transit from user space to the disk, and visa versa. Caching can be used to hold disk-resident data for impmvtd performance. Spociling is not necessary because disks are shared-access devices. Interrupt- driven I/O is best for devices such as disks that transfer data at slow rates-A graphics card with direct bus connection, accessible through memory-rnapped I/O 'Buffering may be needed to control multiple access and for performance (doublebuffering can be used to hold the next screen image while displaying the current one). Caching and 5pooling are not necessary^ due to IH E fast and shared-access natures of the device. Folling and in term pts are only useful for input and for I/O completion detection, neither of which is needed for a memory^mapped device.14.2Suppose that a disk drive has 5000 cylinders,numbered 0 to 4999. The drive is currentlyserving a request 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, 130Start ing from the curre nt head p ositi on, what is the total dista nee (in cyli nders) that the disk arm moves to satisfy all the pending requests, for each of the follow ing diskscheduli ng algorithms? a. FCFS b. SSTF c. SCAN d. LOOK e. C-SCANa. b.d.Answer:a. The FCFS schedule bi 143, 86, 1470, 913, 1774, 94S, 1509, 1022, 1750, 130. The tntal seekdistance is 7081.b. The SSTF schedule is 143, 130, 86, 913, 948, 1D22, 1470, 1509, 1750, 1774. The total seekdistance is 1745.c. The SCAN schedule is 143, 913, 94«, 1022,1470, 1509, 1750, 1774, 4999,130, 86. The total seekdistance is 9769.The LCX)K scheduJe is 143, 913, 94H, 1022, 1470, 1509, 1750, 1774, 130, H6. The total seekdistance is 3319.e. The C-SCAN schedule is 143,913,948,1022,1470,1509.1750,1774,4999;130. Thetotal seek distance is 9813.{Bonus.} The C-LOOK schedule is 143” 913,94& 1022,1470,1509,1750,1774,86,130. The tohal seek distance is 3363.1.1 1.62.3 2.53.7 6.3 6。
操作系统全英文期末考试题

一.选择题(20分,每题1分)1. Generally speaking, which one is not the major concern for a operating system in the following four options( D )the computerthe system resourcesand apply the interface between user's program and computer hardware systemprogramming language complier2.The main disadvantage of batch system is ( C )A.CPU utilization is lowB.Can not concurrentck of interactionD.Low degree of automation3.A process transforms from waiting state to ready state is caused by the ( B )A.Interrupt eventB.Process schedulingC.Create a process for a programD.Waiting for some events4.The concurrent process is refers to ( C )A.The process can be run in parallelB.The process can be run in orderC.The process can be run in the same timeD.The process can not be interrupted5.In multi-process system, in order to ensure the integrity of public variables, the processes should be mutually exclusive access to critical areas. The so-called critical area is ( D )A.A bufferB.A date areaC.Synchronization mechanismD.A program6.The orderly use of resources allocation strategy can destroy the condition ( D ) to avoid deadlock.A.Mutual exclusiveB.Hold and waitC.No preemptionD.Circular waiter's applications use the system resources to complete itsoperation by the support and services of ( C )A.clicking the mouseB.Keyboard commandC.System callD.Graphical user interface8.There are four jobs arrived at the same time and the execution time of each job is 2h. Now they run on one processor at single channel,then the average turnaround time is ( B )9. the job scheduling algorithms, ( B ) is related to the job's estimated running time.A.FCFS scheduling algorithmB.Short-job-first scheduling algorithmC.High response ratio algorithmD.Balanced scheduling10.In memory management, the purpose of using the overlay and swapping is ( C )A.Sharing main memoryB.Expanding main memory physicallyC.Saving main memory spaceD.Improving CPU utilization11.In the page-replacement algorithm,which one can cause the Belady phenomenon ( A )A.FIFOB.LRUC.CLOCKINGD.OPT12.The following description of the system in safe state,which one is correct( B )A.It must cause deadlock if the system is in insecure stateB.It may cause deadlock if the system is in insecure stateC.It may cause deadlock if the system is in secure stateD.All are wrong13.Generally, when we talk about"Memory Protection", the basic meaning is ( C )A.Prevent hardware memory from damagingB.Prevent program from losing in memoryC.Prevent the cross-border call between programsD.Prevent the program from being peeped14.The actual capacity of virtual memory is equal to ( B )A.The capacity of external memory(disk)B.The sum of the capacity of external memory and main memoryC.The space that the CPU logical address givesD.The smaller one between the option B and C15.Physical file's organization is determined by ( D )A.ApplicationsB.Main memory capacityC.External memory capacityD.Operating system16.A computer system is configured with two plotters and three printers,in order to properly drive these devices,system should provide ( C ) device driver program.17.When there are fewer number of channels in system ,it may cause "bottlenecks".To solve this problem,which of the follow options is not the effective way( A )A.improving the speed of CPUing the virtual device technologyC.Adding some hardware buffer on the devicesD.Increasing the path between devices and channels18.When I/O devices and main memory are exchanging data, it can be achieved without CPU's frequently intervention,this way of exchanging data is called ( C )A.PollingB.InterruptsC.Direct memory accessD.None of them19.The following description of device management, which one is not correct( B )A.All external devices are managed by the system in uniformB.Channel is a software of controlling input and outputC.The I/O interrupt events from the I/O channel are managed by device managementD.One of the responsibility of the operating system is to use the hardware effectively20.The operating system used ( A ), it realized a mechanism that we can use more space to save more time.A.SPOOLINGB.Virtual storageC.ChannelD.Overlay二.填空题(20分,每空1分)1.Software may trigger an interrupt by executing a special operation called a system call .(P7)2.If there is only one general-purpose CPU,then the system is a single-processor system.(p12)3. A process can be thought of as a program in execution. (p79)4.As a process executes,it changes process may be in one of the following states:new,running,waiting,ready or terminated .(p83)5.Long-term(job) scheduling is the selection of processes that will beallowed to contend for the Short-term(CPU) scheduling is the selection of one process from the ready queue. (p116)6.The process executing in the operating system may be either independent processes or cooperating processes. Cooperating processes require an interprocess communication mechanism to communicate with each ,communication is achieved through two schemes: share memory and message passing. (p116)modern operating systems, resource allocation unit is process, processor scheduling unit is thread .(p127)modern operating systems provide kernel support for threads;among these are Windows,as well as Solaris and Linux .(p146)scheduling is the basis of multiprogrammed operating systems.(p153)FCFS algorithm is nonpreemptive;the RR algorithm is preemptive. ,a waiting process is never again able to change state,because the resources it has requested are held by other waiting situation is called deadlock . (p245)main purpose of a computer system is to execute programs,together with the data they access,must be in main memory(at least partially) during execution.(P274)13. The various memory-management algorithms differ in may comparing different memory-management strategies,we use the follow considerations:Hardwaresupport,Performance,Fragmentation,Relocation,Swapping,Sharing and protection . (p310)14.A process is thrashing if it is spending more time paging than executing.15.Virtual memory is a technique that enables us to map a largelogical address space onto a smaller physical memory.(p365)16.When we solve the major problems of page replacement and frame allocation,the proper design of a paging system requires that we consider page size,I/O,locking,process creation,program structure,and other issues.(p366)17.The operating system abstracts from the physical properties of its storage devices to define a logical storage unit,the file . (p373)18.Since files are the main information-storage mechanism in most computer system,file protection is needed.(p408)19.The seek time is the time for the disk arm to move the heads to the cylinder containing the desired sector.(P457)20.The hardware mechanism that enables a device to notify the CPU is called an interrupt .(p499)三.简答题(30分,每题6分)1.What is the operating systemWhat role does the operating system play in a computer开放题,解释操作系统概念,操作系统可以实现哪些基本功能关键词:a.管理系统资源,控制程序运行,改善人机界面,为其他应用软件提供支持。
操作系统全英文期末考试题(带答案)

一.选择题(20分,每题1分)1. Generally speaking, which one is not the major concern for a operating system in the following four options?( D )A.Manage the computerB.Manage the system resourcesC.Design and apply the interface between user's program and computer hardware systemD.High-level programming language complier2.The main disadvantage of batch system is ( C )A.CPU utilization is lowB.Can not concurrentck of interactionD.Low degree of automation3.A process transforms from waiting state to ready state is caused by the ( B )A.Interrupt eventB.Process schedulingC.Create a process for a programD.Waiting for some events4.The concurrent process is refers to ( C )A.The process can be run in parallelB.The process can be run in orderC.The process can be run in the same timeD.The process can not be interrupted5.In multi-process system, in order to ensure the integrity of public variables, the processes should be mutually exclusive access to critical areas. The so-called critical area is ( D )A.A bufferB.A date areaC.Synchronization mechanismD.A program6.The orderly use of resources allocation strategy can destroy the condition ( D ) to avoid deadlock.A.Mutual exclusiveB.Hold and waitC.No preemptionD.Circular waiter's applications use the system resources to complete its operation by the support and services of ( C )A.clicking the mouseB.Keyboard commandC.System callD.Graphical user interface8.There are four jobs arrived at the same time and the execution time of each job is 2h. Now they run on one processor at single channel,then the average turnaround time is ( B )A.1hB.5hC.2.5hD.8h9.Among the job scheduling algorithms, ( B ) is related to the job's estimated running time.A.FCFS scheduling algorithmB.Short-job-first scheduling algorithmC.High response ratio algorithmD.Balanced scheduling10.In memory management, the purpose of using the overlay and swapping is ( C )A.Sharing main memoryB.Expanding main memory physicallyC.Saving main memory spaceD.Improving CPU utilization11.In the page-replacement algorithm,which one can cause the Belady phenomenon? ( A )A.FIFOB.LRUC.CLOCKINGD.OPT12.The following description of the system in safe state,which one is correct?( B )A.It must cause deadlock if the system is in insecure stateB.It may cause deadlock if the system is in insecure stateC.It may cause deadlock if the system is in secure stateD.All are wrong13.Generally, when we talk about"Memory Protection", the basic meaning is ( C )A.Prevent hardware memory from damagingB.Prevent program from losing in memoryC.Prevent the cross-border call between programsD.Prevent the program from being peeped14.The actual capacity of virtual memory is equal to ( B )A.The capacity of external memory(disk)B.The sum of the capacity of external memory and main memoryC.The space that the CPU logical address givesD.The smaller one between the option B and C15.Physical file's organization is determined by ( D )A.ApplicationsB.Main memory capacityC.External memory capacityD.Operating system16.A computer system is configured with two plotters and three printers,in order to properly drive these devices,system should provide ( C ) device driver program.A.5B.3C.2D.117.When there are fewer number of channels in system ,it may cause "bottlenecks".To solve this problem,which of the follow options is not the effective way?( A )A.improving the speed of CPUing the virtual device technologyC.Adding some hardware buffer on the devicesD.Increasing the path between devices and channels18.When I/O devices and main memory are exchanging data, it can be achieved without CPU's frequently intervention,this way of exchanging data is called ( C )A.PollingB.InterruptsC.Direct memory accessD.None of them19.The following description of device management, which one is not correct?( B )A.All external devices are managed by the system in uniformB.Channel is a software of controlling input and outputC.The I/O interrupt events from the I/O channel are managed by device managementD.One of the responsibility of the operating system is to use the hardware effectively20.The operating system used ( A ), it realized a mechanism that we can use more space to save more time.A.SPOOLINGB.Virtual storageC.ChannelD.Overlay二.填空题(20分,每空1分)1.Software may trigger an interrupt by executing a special operation called a system call .(P7)2.If there is only one general-purpose CPU,then the system is a single-processor system.(p12)3. A process can be thought of as a program in execution. (p79)4.As a process executes,it changes state.Each process may be in one of the following states:new,running,waiting,ready or terminated .(p83)5.Long-term(job) scheduling is the selection of processes that will beallowed to contend for the CPU.And Short-term(CPU) scheduling is the selection of one process from the ready queue. (p116)6.The process executing in the operating system may be either independent processes or cooperating processes. Cooperating processes require an interprocess communication mechanism to communicate with each other.Principally,communication is achieved through two schemes: share memory and message passing. (p116)7.In modern operating systems, resource allocation unit is process, processor scheduling unit is thread .(p127)8.Most modern operating systems provide kernel support for threads;among these are Windows,as well as Solaris and Linux .(p146)9.CPU scheduling is the basis of multiprogrammed operating systems.(p153)10.The FCFS algorithm is nonpreemptive;the RR algorithm is preemptive.11.Sometimes,a waiting process is never again able to change state,because theresources it has requested are held by other waiting processes.This situation is called deadlock . (p245)12.The main purpose of a computer system is to execute programs.These programs,together with the data they access,must be in main memory(at least partially) during execution.(P274)13. The various memory-management algorithms differ in may aspects.In comparing different memory-management strategies,we use the follow considerations:Hardware support,Performance,Fragmentation,Relocation, Swapping,Sharing and protection . (p310)14.A process is thrashing if it is spending more time paging than executing.15.Virtual memory is a technique that enables us to map a large logical address space onto a smaller physical memory.(p365)16.When we solve the major problems of page replacement and frame allocation,the proper design of a paging system requires that we consider page size,I/O,locking,process creation,program structure,and other issues.(p366) 17.The operating system abstracts from the physical properties of its storage devices to define a logical storage unit,the file . (p373)18.Since files are the main information-storage mechanism in most computer system,file protection is needed.(p408)19.The seek time is the time for the disk arm to move the heads to the cylinder containing the desired sector.(P457)20.The hardware mechanism that enables a device to notify the CPU is called an interrupt .(p499)三.简答题(30分,每题6分)1.What is the operating system?What role does the operating system play in a computer?开放题,解释操作系统概念,操作系统可以实现哪些基本功能?关键词:a.管理系统资源,控制程序运行,改善人机界面,为其他应用软件提供支持。
重庆大学操作系统全英文期末考试题(带答案)

XX大学2011 ——2012 学年第一学期《操作系统》期末考试试题(A)一.二.选择题(20分,每题1分)1. Generally speaking, which one is not the major concern for a operating system in the following four options?( D )A.Manage the computerB.Manage the system resourcesC.Design and apply the interface between user's program and computer hardware systemD.High-level programming language complier2.The main disadvantage of batch system is ( C )A.CPU utilization is lowB.Can not concurrentck of interactionD.Low degree of automation3.A process transforms from waiting state to ready state is caused by the ( B )A.Interrupt eventB.Process schedulingC.Create a process for a programD.Waiting for some events4.The concurrent process is refers to ( C )A.The process can be run in parallelB.The process can be run in orderC.The process can be run in the same timeD.The process can not be interrupted5.In multi-process system, in order to ensure the integrity of public variables, the processes should be mutually exclusive access to critical areas. The so-called critical area is ( D )A.A bufferB.A date areaC.Synchronization mechanismD.A program6.The orderly use of resources allocation strategy can destroy the condition ( D ) to avoid deadlock.A.Mutual exclusiveB.Hold and waitC.No preemptionD.Circular waiter's applications use the system resources to complete its operation by the support and services of ( C )A.clicking the mouseB.Keyboard commandC.System callD.Graphical user interface8.There are four jobs arrived at the same time and the execution time of each job is 2h. Now they run on one processor at single channel,then the average turnaround time is ( B )A.1hB.5hC.2.5hD.8h9.Among the job scheduling algorithms, ( B ) is related to the job's estimated running time.A.FCFS scheduling algorithmB.Short-job-first scheduling algorithmC.High response ratio algorithmD.Balanced scheduling10.In memory management, the purpose of using the overlay and swapping is ( C )A.Sharing main memoryB.Expanding main memory physicallyC.Saving main memory spaceD.Improving CPU utilization11.In the page-replacement algorithm,which one can cause the Belady phenomenon? ( A )A.FIFOB.LRUC.CLOCKINGD.OPT12.The following description of the system in safe state,which one is correct?( B )A.It must cause deadlock if the system is in insecure stateB.It may cause deadlock if the system is in insecure stateC.It may cause deadlock if the system is in secure stateD.All are wrong13.Generally, when we talk about"Memory Protection", the basic meaning is ( C )A.Prevent hardware memory from damagingB.Prevent program from losing in memoryC.Prevent the cross-border call between programsD.Prevent the program from being peeped14.The actual capacity of virtual memory is equal to ( B )A.The capacity of external memory(disk)B.The sum of the capacity of external memory and main memoryC.The space that the CPU logical address givesD.The smaller one between the option B and C15.Physical file's organization is determined by ( D )A.ApplicationsB.Main memory capacityC.External memory capacityD.Operating system16.A computer system is configured with two plotters and three printers,in order to properly drive these devices,system should provide ( C ) device driver program.A.5B.3C.2D.117.When there are fewer number of channels in system ,it may cause "bottlenecks".To solve this problem,which of the follow options is not the effective way?( A )A.improving the speed of CPUing the virtual device technologyC.Adding some hardware buffer on the devicesD.Increasing the path between devices and channels18.When I/O devices and main memory are exchanging data, it can be achieved without CPU's frequently intervention,this way of exchanging data is called ( C )A.PollingB.InterruptsC.Direct memory accessD.None of them19.The following description of device management, which one is not correct?( B )A.All external devices are managed by the system in uniformB.Channel is a software of controlling input and outputC.The I/O interrupt events from the I/O channel are managed by device managementD.One of the responsibility of the operating system is to use the hardware effectively20.The operating system used ( A ), it realized a mechanism that we can use more space to save more time.A.SPOOLINGB.Virtual storageC.ChannelD.Overlay三.填空题(20分,每空1分)1.Software may trigger an interrupt by executing a special operation called a system call .(P7)2.If there is only one general-purpose CPU,then the system is a single-processor system.(p12)3. A process can be thought of as a program in execution. (p79)4.As a process executes,it changes state.Each process may be in one of the following states:new,running,waiting,ready or terminated .(p83)5.Long-term(job) scheduling is the selection of processes that will beallowed to contend for the CPU.And Short-term(CPU) scheduling is the selection of one process from the ready queue. (p116)6.The process executing in the operating system may be either independent processes or cooperating processes. Cooperating processes require an interprocess communication mechanism to communicate with each other.Principally,communication is achieved through two schemes: share memory and message passing. (p116)7.In modern operating systems, resource allocation unit is process, processor scheduling unit is thread .(p127)8.Most modern operating systems provide kernel support for threads;among these are Windows,as well as Solaris and Linux .(p146)9.CPU scheduling is the basis of multiprogrammed operating systems.(p153)10.The FCFS algorithm is nonpreemptive;the RR algorithm is preemptive.11.Sometimes,a waiting process is never again able to change state,because the resources it has requested are held by other waiting processes.This situation is called deadlock . (p245)12.The main purpose of a computer system is to execute programs.These programs,together with the data they access,must be in main memory(at least partially) during execution.(P274)13. The various memory-management algorithms differ in may aspects.In comparing different memory-management strategies,we use the follow considerations:Hardware support,Performance,Fragmentation,Relocation, Swapping,Sharing and protection . (p310)14.A process is thrashing if it is spending more time paging than executing.15.Virtual memory is a technique that enables us to map a large logical address space onto a smaller physical memory.(p365)16.When we solve the major problems of page replacement and frame allocation,the proper design of a paging system requires that we consider page size,I/O,locking,process creation,program structure,and other issues.(p366) 17.The operating system abstracts from the physical properties of its storage devices to define a logical storage unit,the file . (p373)18.Since files are the main information-storage mechanism in most computer system,file protection is needed.(p408)19.The seek time is the time for the disk arm to move the heads to the cylinder containing the desired sector.(P457)20.The hardware mechanism that enables a device to notify the CPU is called an interrupt .(p499)四.简答题(30分,每题6分)1.What is the operating system?What role does the operating system play in acomputer?开放题,解释操作系统概念,操作系统可以实现哪些基本功能?关键词:a.管理系统资源,控制程序运行,改善人机界面,为其他应用软件提供支持。
(完整word版)操作系统英文版课后习题答案整理(word文档良心出品)

1.1What are the three main purposes of an operat ing system?⑴ In terface betwee n the hardware and user;(2) man age the resource of hardware and software;(3) abstracti on of resource;Answer;•Tb provide an environment ksr a computer user to execute programs on computer h日rchvare in n convenient and efficient manner.•Tb allocate the separate resources of the computer as needed to st)ke the problem given.The allcxation prtxzess should b? as fair and efficient as possible.•Asa control program it serves two major functions; (1) supervision of the execution 由user programs to prevent errors and improper use of the computer, and (2) management of the operatioji and control of I/O devices.1.2 List the four steps that are necessary to run a program on a completely dedicated machine. Preprocessing > Process ing > Linking > Executi ng.Answer:乩Reserxe machine time*b* Manually load program into memory.u Load starting address and begin exe匚Lition.cL Monitor and control execution of program fr(im console.b. In teractivec. Time shar ingd. Real timee. Networkf. DistributedAnswera” Batch, Jobs w计h similar reeds are batched together and run through the computer as a group by ^r\operator or automatic jc)b s^quenc^r. [^rformanct? i$ incr^a^ed by atteiTipting to keep CPU 3nd I/O devices busv 311 timesi through buffering, off-line operation^ spooling, and multiprogramming. Batch is good for executing 】arge jobs thjit need little interacticm; it can be submitted and piuked up later.b. Interactive. This system is cumpofied of m^nv short transactions where the results of thenext transactiiin may be unpredictablen Respond time needs tn be short (sectwids) since the user submits and waik for the result.u Time sharing. This systems u 船呂匚Pl sch<*duling ^nd multi programming to pmvidu eConoiniCcil interactive use of 蛊system. The CPL switches rapidly iri>m one user tn another Instead of having a job defined by spcxiled card images^ each program readsits next control card from the terminab and output is normally printed immediately to the screen.(_L Real time. Often tisvci in a dedicated application, this system reads information from sensors and must respond within a fixed amount of time to ensure correct performance.work.f.Distributed .This system distributes computation among several physical processors” TheprtKessors do not share menion- or a clock. Instead, each pnxzessor has its own kxzalmemory. They communicate with each other through various communication lines f such asa high-speed bus or telephone line.1.7 Wehave stressed the need for an operating system to make efficient use of the computing hardware. When is it appropriate for the operating system to forsake this principle and to waste ” resources? Why is such a system not really wasteful?Answer Single-user systems should maximize use of the system for the user A GUImight "xvastc * GPL' cycles, but it optimizes the user T s interaction with the system.2.2 How does the distinction between monitor mode and user mode function as a rudimentary form of protecti on (security) system?Answer: By establishing a set of privileged instructions that can be executed only when in tlie m(snitnr mt)de f the tiperating system is assured of controlling the entire system at all times.2.3 What are the differences between a trap and an interrupt? What is the use of eachfun cti on?Answer An interrupt is a ha rd \ v a re-^en era ted change-of-flow within the system. An interrupt handler is summoried to deal with the cause oF the interrupt; control is then re turned to the interrupted context and instruction. A trap is a software-j;enerated interrupt. An interrupt can be uwd to signal the compJrtio n “f an I/O obviate the nevd for polling. A trap can be used ti> call operating svstem routines or to catch arithmetic errors.2.5 Which of the follow ing in structi ons should be privileged?a. Set value of timer.b. Read the clock.c. Clear memory.d. Turn off interrupts.e. Switch from user to monitor mode.3OS Exercise BookClass No. NameAnswer: The following instructions should be privileged:Set value of timer,b.Clear memory.Jc.Turn off interrupts.d.Switch from user to monitor mode*2.8 Protecting the operating system is crucial to ensuring that the computer system operates correctly. Provision of this protection is the reason behind dual-mode operation, memory protection, and the timer. To allow maximum flexibility, however, we would also like to place mini mal con stra ints on the user.The following is a list of operations that are normally protected. What is the minimal setof in structi ons that must be protected?a. Change to user mode.b. Change to mon itor mode.c. Read from mon itor memory.d. Write into mon itor memory.e. Fetch an instruction from monitor memory.f. Tur n on timer in terrupt.g. Turn off timer interrupt.Answer: The minimal 5et of instructions that must be protected are:a.Change to monitor mtxle.b.Read from moni tor memory*c.Write into monitor me mor v.Jd.Turn off timer interrupt3.6 List five services provided by an operat ing system. Explain how each provides convenience to the users. Explain also in which cases it would be impossible for user-level programs to provide these services.Answer;«Program execution. The operating system loads thv contents (or sections) of a file into menidry and begins its execution. A user-level program could not be trusted to properly allocate CPU time.•I/O operations. Disks, tapes, serial lines;and other devices must be communicated with ata very low level. The user need only specify the dev ice and the operation to perform (in it,while the system converts that request into <ie\r ict^ or contr<i11er-spec i fit commands.User-level pnjgrams cannot be trusted to only access devices they should have access to and to only access them when they otherwise unused.«File-system manipulation, fhere are manv details in file creation, deletion/ alkKation, and naming that users should not have to perform. Blocks of disk space are used by files and must be tracked, deleting a file requires remo\ ing the name file information and freeing the <ilkx:ated blocky I^ratections must also be checked to assure proper file access. User prc^grams could neither ensure adherence to protect]on methcxis nor be trusted to allocate only free block吕and deallocate bkxzks on file deletion.J•Communications. Message passing between systems requires messages be turned into packets of information, sent to the network controller, trannmitted across a community tk>ns medium, and reassembled by the destination system.卩acket ordering and data correction must take place. Again, user program吕might not c(sordinate ac cess to the network dev ice, or they might receive packets destined tor other processes^»Error detection. Error detection (occurs at both the hardware and soFtwart? levels. At tlie hardware level, all data transfers must be inspected to ensure that data hax e not beencorrupted in transit All data on media must be checked to be sure they have not changed since they uritten to the media. At the software level, media must bechecked for data ccnsistencj^; for instance, do the number of allocated and unallocated blocks of storage match the total number on the device. There, errors are frequently pnxzess-independent (for instance, the 匚omiption of data on a disk)5 sc there must be a global program (the operating system) that handles all h pes of errors. Also, by having errors pmc essed by the operating system, processes need not contain code to catch and ccjrrect all the ernjrs possible on a system.3.7 What is the purpose of system calls?Answer; Sv>ttn'. dlltnv ustr-levtl lu request str\ ices nt 11 it? uperating svs-tem.3.10 What is the purpose of system programs?J V USWCE Svstcm programs can be thought of as bundle!ti of useful system oils. Thev r provide bcisic functidcaliU users and sci users do not need to wnte their cwn programs to s<>k r e comnicMi problems,4.1 MS-DOS provided no means of con curre nt process ing. Discuss three major complicati onsthat con curre nt process ing adds to an operat ing system.5OS Exercise BookClass No. NameAnswer:*A method of time sharing must be implemented to allow each of several prcxzesses to have access to the system. This method involves the preemption of processes that do notvoluntarily give up the CPU (by using a system ca1]r for instance) and the kernel being reentrant (so more than one prtxzess may be executing kernel code concurrently).・[Vocesses and system resources must have protections and must be protected from each other. Any given process must be limited in the amount of memory it can use and tlie ope Mt ions 让can perform on devices like di^ks.•Care must be taken in the kernel to prevent deadkxzks between prucesses, so processesaren*t waiting for each other's allocated rest>urces,4.6 The correct producer —consumer algorithm in Section 4.4 allows only n-1 buffers to befull at any one time. Modify the algorithm to allow all buffers to be utilized fully.Answer: No answer.5.1 Provide two program ming examples of multithread ing givi ng improve performa nee overa sin gle-threaded soluti on.Answer (1) A Web server that services each request in a separate Lliread. (2) A parallelized application such as matrix multiplication where different parts of the matrix may be worked on in parallel. (3) An intEivictin GUI program such as a debugger where a thread is used to monitor user input, another thread represents the running application, and a third thread monitors performance.5.3 What are two differences between user-level threads and kernel-level threads? Underwhat circumsta nces is one type better tha n the other?Answer: Context switching between user threads is quite sinniliir to switching between kernel threads, although it is dependent on the threads library and how it maps user threads to kernel threads. In general, context switching between user threads involves taking a user thread of its LWP and replacing it with another thread. This act typically involves saving and restoring the stttte of the registers.6.3 Consider the following set of processes, with the length of the CPU-burst time given inmillisec on ds:Process Burst Time PriorityP1103P211P323F414P552The processes are assumed to have arrived in the order P l, F2, F3, F4, P5, all at time 0.a.Draw four Gantt charts illustrati ng the executi on of these processes using FCFS, SJF, a non preemptive priority (a smaller priority n umber implies a higher priority), and RR (qua ntum = 1) scheduli ng.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)?An swer:Answer;a.The four Gantt charts areb.Turnaround timeFCFS RR SJF Priority101919 16112 1 113 741814421919149 6 匚Waiting time (turnaround time minus burst time)FCFS RR SJF Priority卩】0996Pz10100心115216P*133118Ps14941d. Shortest Job First6.4 Suppose that the following processes arrive for execution at the times indicated. Eachprocess will run the listed amou nt of time. In an sweri ng the questi ons, use non preemptive scheduling and base all decisions on the information you have at the time the decisionmust be made.PtXKCSS Ai ri\ al Time Burst Time0.087OS Exercise BookClass No. NameP20.44l.D1a. 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 performa nee, but no tice that we chose to run process P1 at time0 because we did not know that two shorter processes would arrive soon. Compute what the average turnaround time will be if the CPU is leftidle for the first 1 un it and the n SJF scheduli ng is used. Remember that processes P1 and P2 are wait ing dur ing this idle time, so their wait ing time may in crease. Thisalgorithm could be known as future-k no wledge scheduli ng.Answera.10.53b.9.53c.6,86Remember that turnaround time LS finishing time minus arrival time, so have to subtract the arrival tinier to compute thu turnaround times. FCFS is 11 if you forget to subtract arrival time.6.10 Explain the differences in the degree to which the following scheduling algorithms discrim in ate in favor of short processes:a.FCFSb.RRc.Multilevel feedback queuesAnswer:a.FCFS—discriminates against short jobs since any short jobs arriving after long jobs willhave a longer waiting time.b.RR一treats all jobs equally (giving them equal bursts of CPU time) so short jobs will beable to leave the system faster since they will finish first.c.Multilevel feedback queues—work similar to the RR algorithm—thev discriminatefa^r i>rably toward slusrt jobs.7.7 Show that, if the wait and sig nal operati ons are not executed atomically,then mutual exclusi on may be violated.Answer No answer.7.8 The Sleepi ng-Barber Problem. A barbershop con sists of a wait ing room with n chairs and the barber room containing the barber chair. If there are no customers to be served,the barber goes to sleep. If a customer en ters the barbershop and all chairs are occupied,then the customer leaves the shop .If the barber is busy but chairs are available, the nthe customer sits in one of the free chairs. If the barber is asleep, the customer wakes up the barber. Write a program to coord in ate the barber and the customers.Answer: Please refer to the support ing Web s its for source code solution,8.2 Is it possible to have a deadlock involving only one single process? Explain your answer.Answer Ncx I'his folknvs directly from the hold-and-wait condition.8.4 Con sider the traffic deadlock depicted in Figure 8.11.a. Show that the four n ecessary con diti ons for deadlock in deed hold in this example.b. State a simple rule that will avoid deadlocks in this system.Answer No answer.8.13 Con sider the follow ing sn apshot of a system:Allocati on Max AvailableA B C D A B C D A B C DP00 0 1 20 0 1 2 1 5 2 0P1 1 0 0 0 1 7 5 0P2 1 3 5 4 2 3 5 6P30 6 3 20 6 5 2P40 0 1 40 6 5 6An swer the follow ing questi ons using th e ban ker 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 gran tedimmediately?Answer;A. Deadlcx^k cannot ixrcur because preemption exists,b. Yes. A process may never acquire all the resources 让needs if they are continuouslypreempted by a series of requests such as those of process C.9.5 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 efficie nt use of memory?Answer:a. First-fit:b* 212K is put in 500K partitionc. 417K is put in 600K partitiond* 112K is put in 288K partition (new partition 288K = 500K - 212K)e.426K must waitf.Best-fit:g.212K is put in 300K partition9OS Exercise BookClass No. Nameh.417K is put in 500K partitioni.112K is put in 200K partitionj.426K is put in 600K partitionk.Worst-fit:L 212K is put in 600K partitionm. 417K is put in 500K partitionn. 112K is put in 388K partitionc 426K must waitIn this example, Best-fit turns out to be the bE%t*9.8 Con sider a logical address space of eight pages of 1024 words each, mapped onto a physicalmemory of 32 frames.a. How many bits are there in the logical address?b. How many bits are there in the physical address?Answera,l.ogica) address: 13 bitsb.Physical address: 15 bitsJ9.16 Con sider the follow ing segme nt table:Segme nt Base Len gth02196001230014290100313275804195296What are the physical addresses for the follow ing logical addresses?a. 0,430b. 1,10c. 2,500d. 3,400e. 4,112Answer:a.219 + 430 = 649b.2300 + 10 = 2510u ill亡月ed reference, trap ki operating systemd.1327 -b 400 = 1727e.illegal reference, trap to operating system10.2 Assume that you have a page referenee string for a process with m frames (initiallyall empty). The page refere nee stri ng has len gth p with n disti net page n umbers occur init. For any page-replacement algorithms,a. What is a lower bou nd on the n umber of page faults?b. What is an upper bou nd on the n umber of page faults?Answer:a* nb»p1, 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 replaceme ntFIFO replaceme ntOptimal replaceme nt11OS Exercise BookClassNo.NameNumbei of frames1 2 3 4 5 6 711.7 Expla in the purpose of the ope n and close operati ons.Answer :» The o[fen operation informs the system that the named file is about to bect>me active^ * Tlie cluse operation informs the system that the named file )s nt> lunger in active use by the user who issued the dose operation.11.9 Give an example of an application in which data in a file should be accessed in the followi ng order: a. Seque ntially b. Ran domlyAnswer :a. Print the 匚 on tent of the file,b. Print the content of record /. This record can be found using hashing or index tech niques.11.12 Con sider a system that supports 5000 users. Suppose that you want to allow 4990 of these users to be able to access one file.a. How would you specify this protection scheme in UNIX?b. Could you suggest ano ther protecti on scheme that can be used more effectively for this purpose tha n the scheme provided by UNIX?Answer:a. There are twc methods for achieving this : L Create an access control list withtlu? names of all 4990 users.ii. Put these 4990 users in one ^roup and set the group access accordingly. This scheme cannot always be implemented since user groups are restricted by the system. b. The universe access information applies to all users unless their name appears in the access-control list with different access permission. With this scheme you simply put the names of the remaining ten users in the access control list but \v 让h no access pri\ ileges allovcexfLRUFIFOOptimal 20 20 20 18 18 15 15 16 11 10 14 8 8 10 7 7 10 7 7 77Answer12.1 Consider a file currently consisting of 100 blocks. Assume that the file control block (andthe index block, in the case of indexed allocation) is already in memory. Calculate howmany disk I/O operations are required for contiguous, linked, and indexed (single-level)allocati on strategies, if, for one block, the follow ing con diti ons hold. In thecon tiguousallocati on case, assume that there is no room to grow in the beg inning, but there is room to grow in the end. Assume that the block in formatio n to be added is stored in memory.a. The block is added at the beg inning.b. The block is added in the middle.c. The block is added at the end.d. The block is removed from the begi nning.e. The block is removed from the middle.f. The block is removed from the end.AnswerLinked Indexeda. 201 1 1b. 1015211 3 1d. 198 1 0e. 9852 0f. 0 100 013.2 Con sider the follow ing I/O sce narios on a sin gle-user PC.a. A mouse used with a graphical user in terfaceb. A tape drive on a multitasking operating system (assume no device preallocation is available)c. A disk drive containing user filesd. A graphics card with direct bus conn ecti on, accessible through memory-mappedI/OFor each of these I/O scenarios, would you design the operating system to use buffering, spooli ng, cachi ng, or a comb in ati on? Would you use polled I/O, or in terrupt-drive n I/O? Give reas ons for your choices.Answer:a. A mouse used with a graphical user interfaceBuffering may be needed to record mouse movement during times when higher- priority operations are taking place. Spooling and caching are inappropriate. Inter rupt driven I/O is most appropriate^b” A tape drive on a multitasking operating system (assume no device preAlkxzation is available)Buffering may be needed to manage throughput d让ferEria? behveen the tape drive and the sounzt? or destination of the I/O, C臼匚hing can be used to hold copies of that resides on the tape, for faster access. Spooling could be used to stage data to the device whenmultiple users desire to read from or write to it” Interrupt driven [/O is likely to allow the best performance.13OS Exercise BookClass No. Name匸* A disk drive containing user tilesBuffering can be used to hold data while in transit from user space to the disk, and visaversa. Caching can be used to hold disk-resident data for improved perfor mance.Spoc^ling is not necessary because disks are shared-access devices. Interrupt- driven T/O is best for devices such as disks that transfer data at slow rates,d. A graphics card w让h direct bus coi^nection, accessible through mem<irv-mapped I/OBuffering may be needed to control multiple access and for performance (doublebuffering can be used to hold the next screen image while displaying the current tme). Caching and spooling are not necessary r due to the fast and shared-access natures of the device. Polling and interrupts are only useful for input and for【/O completion detec tion f neither of which is needed for a mem()r y-ma pped device.14.2 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, is86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130Start ing from the curre nt head positi on, what is the total dista nee (in cyli nders) thatthe disk arm moves to satisfy all the pending requests, for each of the follow ingdiskscheduli ngalgorithms?a. FCFSb. SSTFc. SCANd. LOOKe. C-SCANAnswer:乩The FCFS schedule is 143f 86f 1470, 913, 1774, 948, 1509, 1022, 1754), 130. The total seek distance is 7081.b. The SSTF schedule is 143, 130, 86. 913, 948, 1022, 1470, 1509. 1750r 1774. The total seekdistance is 1745.€. The SCAN schedule is 143, 913, 94«f1022f 1470, 1509,1750f 1774, 4999,130, 86. The to怙1 seek distance is 9769.d.The LOOK schedule is 143, 913, 948,1022, 1470,1509,1750,177< 130,86. The total seekdistance is 3319*e.The C-SCAN schedule is 143f 913,948,1022J 470,1509.1750,1774,4999,8& 130. The totalseek distance is 9813.f.(Bonus.) The C-LOOK schedule is 143,913,94& 1022,1470,1509.1750,1774, 86,130. Thetotal seek distance is 3363.1.1 1.62.3 2.53.7 6.3 6。
操作系统英文版课后习题答案整理

1.1What are the three main purposes of an operating system?(1) Interface between the hardware and user;(2) manage the resource of hardware and software;(3) abstraction of resource;1.2 List the four steps that are necessary to run a program on a completely dedicated machine. Preprocessing > Processing > Linking > Executing.1.6 Define the essential properties of the following types of operating systems:a. Batchb. Interactivec. Time sharingd. Real timee. Networkf. Distributed1.7 We have stressed the need for an operating system to make efficient use of the computing hardware. When is it appropriate for the operating system to forsake this principle and to“waste” resources? Why is such a system not really wasteful?2.2 How does the distinction between monitor mode and user mode function as a rudimentary form of protection (security) system?2.3 What are the differences between a trap and an interrupt? What is the use of each function?2.5 Which of the following instructions should be privileged?a. Set value of timer.b. Read the clock.c. Clear memory.d. Turn off interrupts.e. Switch from user to monitor mode.3OS Exercise BookClass No. Name2.8 Protecting the operating system is crucial to ensuring that the computer system operates correctly. Provision of this protection is the reason behind dual-mode operation, memory protection, and the timer. To allow maximum flexibility, however, we would also like to place minimal constraints on the user.The following is a list of operations that are normally protected. What is the minimal set of instructions that must be protected?a. Change to user mode.b. Change to monitor mode.c. Read from monitor memory.d. Write into monitor memory.e. Fetch an instruction from monitor memory.f. Turn on timer interrupt.g. Turn off timer interrupt.3.6 List five services provided by an operating system. Explain how each provides convenience to the users. Explain also in which cases it would be impossible for user-level programs to provide these services.3.7 What is the purpose of system calls?3.10 What is the purpose of system programs?that concurrent processing adds to an operating system.5OS Exercise BookClass No. Name4.6 The correct producer–consumer algorithm in Section 4.4 allows only n-1 buffers to be full at any one time. Modify the algorithm to allow all buffers to be utilized fully.5.1 Provide two programming examples of multithreading giving improve performance overa single-threaded solution.5.3 What are two differences between user-level threads and kernel-level threads? Under what circumstances is one type better than the other?6.3 Consider the following set of processes, with the length of the CPU-burst time given inmilliseconds: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.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)?Answer:6.4 Suppose that the following processes arrive for execution at the times indicated. Each process will run the listed amount of time. In answering the questions, use nonpreemptive scheduling and base all decisions on the information you have at the time the decision7OS Exercise BookClass No. Namemust be made.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 leftidle 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.6.10 Explain the differences in the degree to which the following scheduling algorithms discriminate in favor of short processes:a. FCFSb. RRc. Multilevel feedback queues7.7 Show that, if the wait and signal operations are not executed atomically,then mutual exclusion may be violated.7.8 The Sleeping-Barber Problem. A barbershop consists of a waiting room with n chairs and the barber room containing the barber chair. If there are no customers to be served,the barber goes to sleep. If a customer enters the barbershop and all chairs are occupied, then the customer leaves the shop.If the barber is busy but chairs are available, then the customer sits in one of the free chairs. If the barber is asleep, the customer wakes up the barber. Write a program to coordinate the barber and the customers.8.2 Is it possible to have a deadlock involving only one single process? Explain your answer.8.4 Consider the traffic deadlock depicted in Figure 8.11.a. Show that the four necessary conditions for deadlock indeed hold in this example.b. State a simple rule that will avoid deadlocks in this system.8.13 Consider the following snapshot of a system:Allocation Max AvailableA B C D A B C D A B C DP0 0 0 1 2 0 0 1 2 1 5 2 0P1 1 0 0 0 1 7 5 0P2 1 3 5 4 2 3 5 6P3 0 6 3 2 0 6 5 2P4 0 0 1 4 0 6 5 6Answer the following questions using th e 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?9.5 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?9OS Exercise BookClass No. Name9.8 Consider a logical address space of eight pages of 1024 words each, mapped onto a physicalmemory of 32 frames.a. How many bits are there in the logical address?b. How many bits are there in the physical address?9.16 Consider the following segment table:Segment Base Length0219 60012300 14290 10031327 58041952 96What are the physical addresses for the following logical addresses?a. 0,430b. 1,10c. 2,500d. 3,400e. 4,11210.2 Assume that you have 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 occur 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.11 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 replacementFIFO replacementOptimal replacement11OS Exercise BookClass No. Name11.7 Explain the purpose of the open and close operations.11.9 Give an example of an application in which data in a file should be accessed in the following order:a. Sequentiallyb. Randomly11.12 Consider a system that supports 5000 users. Suppose that you want to allow 4990 of these users to be able to access one file.a. How would you specify this protection scheme in UNIX?b. Could you suggest another protection scheme that can be used more effectively for this purpose than the scheme provided by UNIX?12.1 Consider a file currently consisting of 100 blocks. Assume that the file control block (andthe index block, in the case of indexed allocation) is already in memory. Calculate how many disk I/O operations are required for contiguous, linked, and indexed (single-level) allocation strategies, if, for one block, the following conditions hold. In the contiguousallocation case, assume that there is no room to grow in the beginning, but there is room to grow in the end. Assume that the block information to be added is stored in memory.a. The block is added at the beginning.b. The block is added in the middle.c. The block is added at the end.d. The block is removed from the beginning.e. The block is removed from the middle.f. The block is removed from the end.13.2 Consider the following I/O scenarios on a single-user PC.a. A mouse used with a graphical user interfaceb. A tape drive on a multitasking operating system (assume no device preallocation is available)c. A disk drive containing user filesd. A graphics card with direct bus connection, accessible through memory-mappedI/OFor 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.13OS Exercise BookClass No. Name14.2 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, is86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests, for each of the following diskschedulingalgorithms?a. FCFSb. SSTFc. SCANd. LOOKe. C-SCAN1.1 1.62.3 2.53.7 6.3 6。
操作系统习题(英文版)

操作系统习题(英文版)Chapter 1 – Computer Systems OverviewTrue / False Questions:1. T / F – The operating system acts as an interface between the computerhardware and the human user.2. T / F –One of the processor’s main functions is to exchange data withmemory.3. T / F –User-visible registers are typically accessible to systemprograms but are not typically available to application programs.4. T / F – Data registers are general purpose in nature, but may berestricted to specific tasks such as performing floating-point operations.5. T / F –The Program Status Word contains status information in the formof condition codes, which are bits typically set by the programmer as aresult of program operation.6. T / F – The processing required for a single instruction ona typicalcomputer system is called the Execute Cycle.7. T / F – A fetched instruction is normally loaded into the InstructionRegister (IR).8. T / F –An interrupt is a mechanism used by systemmodules to signalthe processor that normal processing should be temporarily suspended.9. T / F – To accommodate interrupts, an extra fetch cycle is added to theinstruction cycle.10. T / F –The minimum information that must be saved before theprocessor transfers control to the interrupt handler routine is theprogram status word (PSW) and the location of the current instruction.11. T / F – One approach to dealing with multiple interrupts is to disable allinterrupts while an interrupt is being processed.12. T / F – Multiprogramming allows the processor to make use of idle timecaused by long-wait interrupt handling.13. T / F – In a two-level memory hierarchy, the Hit Ratio is defined as thefraction of all memory accesses found in the slower memory.14. T / F – Cache memory exploits the principle of locality by providing asmall, fast memory between the processor and main memory.15. T / F – In cache memory design, block size refers to the unit of dataexchanged between cache and main memory16. T / F – The primary problem with programmed I/O is that the processormust wait for the I/O module to become ready and mustrepeatedlyinterrogate the status of the I/O module while waiting.Multiple Choice Questions:1. The general role of an operating system is to:a. Act as an interface between various computersb. Provide a set of services to system usersc. Manage files for application programsd. None of the above2. The four main structural elements of a computer system are:a. Processor, Registers, I/O Modules & Main Memoryb. Processor, Registers, Main Memory & System Busc. Processor, Main Memory, I/O Modules & System Busd. None of the above3. The two basic types of processor registers are:a. User-visible and Control/Status registersb. Control and Status registersc. User-visible and user-invisible registersd. None of the above4. Address registers may contain:a. Memory addresses of datab. Memory addresses of instructionsc. Partial memory addressesd. All of the above5. A Control/Status register that contains the address of the nextinstruction to be fetched is called the:a. Instruction Register (IR)b. Program Counter (PC)c. Program Status Word (PSW)d. All of the above6. The two basic steps used by the processor in instruction processingare:a. Fetch and Instruction cyclesb. Instruction and Execute cyclesc. Fetch and Execute cyclesd. None of the above7. A fetched instruction is normally loaded into the:a. Instruction Register (IR)b. Program Counter (PC)c. Accumulator (AC)d. None of the above8. A common class of interrupts is:a. Programb. Timerc. I/Od. All of the above9. When an external device becomes ready to be serviced by theprocessor, the device sends this type of signal to the processor:a. Interrupt signalb. Halt signalc. Handler signald. None of the above10. Information that must be saved prior to the processor transferringcontrol to the interrupt handler routine includes:a. Processor Status Word (PSW)b. Processor Status Word (PSW) & Location of next instructionc. Processor Status Word (PSW) & Contents of processor registersd. None of the above11. One accepted method of dealing with multiple interrupts is to:a. Define priorities for the interruptsb. Disable all interrupts except those of highest priorityc. Service them in round-robin fashiond. None of the above12. In a uniprocessor system, multiprogramming increases processorefficiency by:a. Increasing processor speedb. Taking advantage of time wasted by long wait interrupt handlingc. Eliminating all idle processor cyclesd. All of the above13. As one proceeds down the memory hierarchy (i.e., from inboardmemory to offline storage), the following condition(s) apply:a. Increasing cost per bitb. Decreasing capacityc. Increasing access timed. All of the above14. Small, fast memory located between the processor and main memoryis called:a. WORM memoryb. Cache memoryc. CD-RW memoryd. None of the above15. When a new block of data is written into cache memory, the followingdetermines which cache location the block will occupy:a. Block sizeb. Cache sizec. Write policyd. None of the above16. Direct Memory Access (DMA) operations require the followinginformation from the processor:a. Address of I/O deviceb. Starting memory location to read from or write toc. Number of words to be read or writtend. All of the aboveQuestions1.1,1.4,1.7,1.8Problems1.1,1.3,1.4,1.5,1.7Chapter 2 – Operating System OverviewTrue / False Questions:1. T / F –An operating system controls the execution of applications andacts as an interface between applications and the computer hardware.2. T / F – The operating system maintains information that can be used forbilling purposes on multi-user systems.3. T / F – The operating system typically runs in parallel with applicationpro grams, on it’s own special O/S processor.4. T / F –One of the driving forces in operating system evolution isadvancement in the underlying hardware technology.5. T / F – In the first computers, users interacted directly with thehardware and operating systems did not exist.6. T / F – In a batch-processing system, the phrase “control is passed to ajob” means that the processor is now fetching and executinginstructions in a user program.7. T / F –Uniprogramming typically provides better utilization of systemresources than multiprogramming.8. T / F –In a time sharing system, a user’s program is preempted atregular intervals, but due to relatively slow human reaction time thisoccurrence is usually transparent to the user.9. T / F –A process can be defined as a unit of activity characterized by asingle sequential thread of execution, a current state, and an associated set of system resources.10. T / F – A virtual memory address typically consists of a page numberand an offset within the page.11. T / F – Implementing priority levels is a common strategyforshort-term scheduling, which involves assigning each process in thequeue to the processor according to its level of importance.12. T / F – Complex operating systems today typically consist of a fewthousand lines of instructions.13. T / F – A monolithic kernel architecture assigns only a few essentialfunctions to the kernel, including address spaces, interprocesscommunication and basic scheduling.14. T / F –The hardware abstraction layer (HAL) maps between generichardware commands/responses and those unique to a specificplatform.Multiple Choice Questions:17. A primary objective of an operating system is:a. Convenienceb. Efficiencyc. Ability to evolved. All of the above18. The operating system provides many types of services to end-users,programmers and system designers, including:a. Built-in user applicationsb. Error detection and responsec. Relational database capabilities with the internal file systemd. All of the above19. The operating system is unusual i n it’s role as a control mechanism, inthat:a. It runs on a special processor, completely separated from therest of the systemb. It frequently relinquishes control of the system processor andmust depend on the processor to regain control of the systemc. It never relinquishes control of the system processord. None of the above20. Operating systems must evolve over time because:a. Hardware must be replaced when it failsb. Users will only purchase software that has a current copyrightdatec. New hardware is designed and implemented in the computersystemd. All of the above21. A major problem with early serial processing systems was:a. Setup timeb. Lack of input devicesc. Inability to get hardcopy outputd. All of the above22. An example of a hardware feature that is desirable in abatch-processing system is:a. Privileged instructionsb. A completely accessible memory areac. Large clock cyclesd. None of the above23. A computer hardware feature that is vital to the effective operation of amultiprogramming operating system is:a. Very large memoryb. Multiple processorsc. I/O interrupts and DMAd. All of the above24. The principle objective of a time sharing, multiprogramming system isto:a. Maximize response timeb. Maximize processor usec. Provide exclusive access to hardwared. None of the above25. Which of the following major line of computer system developmentcreated problems in timing and synchronization that contributed to the development of the concept of the process?a. Multiprogramming batch operation systemsb. Time sharing systemsc. Real time transaction systemsd. All of the above26. The paging system in a memory management system provides fordynamic mapping between a virtual address used in a program and:a. A virtual address in main memoryb. A real address in main memoryc. A real address in a programd. None of the above27. Relative to information protection and security in computer systems,access control typically refers to:a. Proving that security mechanisms perform according tospecificationb. The flow of data within the systemc. Regulating user and process access to various aspects of thesystemd. None of the above28. A common problem with full-featured operating systems, due to theirsize and difficulty of the tasks they address, is:a. Chronically late in deliveryb. Latent bugs that show up in the fieldc. Sub-par performanced. All of the above29. A technique in which a process, executing an application, is dividedinto threads that can run concurrently is called:a. Multithreadingb. Multiprocessingc. Symmetric multiprocessing (SMP)d. None of the aboveQUESTIONS2.1,2.3,2.4,2.7,2.10PROBLEMS2.1,2.2,2.3,2.4。
操作系统英文版课后习题答案整理

1.1What are the three main purposes of an operating system?(1) Interface between the hardware and user;(2) manage the resource of hardware and software;(3) abstraction of resource;1.2 List the four steps that are necessary to run a program on a completely dedicated machine. Preprocessing > Processing > Linking > Executing.1.6 Define the essential properties of the following types of operating systems:a. Batchb. Interactivec. Time sharingd. Real timee. Networkf. Distributed1.7 We have stressed the need for an operating system to make efficient use of the computing hardware. When is it appropriate for the operating system to forsake this principle and to“waste” resources? Why is such a system not really wasteful?2.2 How does the distinction between monitor mode and user mode function as a rudimentary form of protection (security) system?2.3 What are the differences between a trap and an interrupt? What is the use of each function?2.5 Which of the following instructions should be privileged?a. Set value of timer.b. Read the clock.c. Clear memory.d. Turn off interrupts.e. Switch from user to monitor mode.2.8 Protecting the operating system is crucial to ensuring that the computer system operates correctly. Provision of this protection is the reason behind dual-mode operation, memory protection, and the timer. To allow maximum flexibility, however, we would also like to place minimal constraints on the user.The following is a list of operations that are normally protected. What is the minimal set of instructions that must be protected?a. Change to user mode.b. Change to monitor mode.c. Read from monitor memory.d. Write into monitor memory.e. Fetch an instruction from monitor memory.f. Turn on timer interrupt.g. Turn off timer interrupt.3.6 List five services provided by an operating system. Explain how each provides convenience to the users. Explain also in which cases it would be impossible for user-level programs to provide these services.3.7 What is the purpose of system calls?3.10 What is the purpose of system programs?4.1 MS-DOS provided no means of concurrent processing. Discuss three major complications that concurrent processing adds to an operating system.4.6 The correct producer–consumer algorithm in Section 4.4 allows only n-1 buffers to be full at any one time. Modify the algorithm to allow all buffers to be utilized fully.5.1 Provide two programming examples of multithreading giving improve performance overa single-threaded solution.5.3 What are two differences between user-level threads and kernel-level threads? Under what circumstances is one type better than the other?6.3 Consider the following set of processes, with the length of the CPU-burst time given inmilliseconds: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.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)?Answer:6.4 Suppose that the following processes arrive for execution at the times indicated. Eachprocess 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.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 leftidle 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.6.10 Explain the differences in the degree to which the following scheduling algorithms discriminate in favor of short processes:a. FCFSb. RRc. Multilevel feedback queues7.7 Show that, if the wait and signal operations are not executed atomically,then mutual exclusion may be violated.7.8 The Sleeping-Barber Problem. A barbershop consists of a waiting room with n chairs and the barber room containing the barber chair. If there are no customers to be served,the barber goes to sleep. If a customer enters the barbershop and all chairs are occupied, then the customer leaves the shop.If the barber is busy but chairs are available, then the customer sits in one of the free chairs. If the barber is asleep, the customer wakes up the barber. Write a program to coordinate the barber and the customers.8.2 Is it possible to have a deadlock involving only one single process? Explain your answer.8.4 Consider the traffic deadlock depicted in Figure 8.11.a. Show that the four necessary conditions for deadlock indeed hold in this example.b. State a simple rule that will avoid deadlocks in this system.8.13 Consider the following snapshot of a system:Allocation Max AvailableA B C D A B C D A B C DP0 0 0 1 2 0 0 1 2 1 5 2 0P1 1 0 0 0 1 7 5 0P2 1 3 5 4 2 3 5 6P3 0 6 3 2 0 6 5 2P4 0 0 1 4 0 6 5 6Answer the following questions using th e 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?9.5 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?9.8 Consider a logical address space of eight pages of 1024 words each, mapped onto a physicalmemory of 32 frames.a. How many bits are there in the logical address?b. How many bits are there in the physical address?9.16 Consider the following segment table:Segment Base Length0219 60012300 14290 10031327 58041952 96What are the physical addresses for the following logical addresses?a. 0,430b. 1,10c. 2,500d. 3,400e. 4,11210.2 Assume that you have 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 occur 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.11 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 replacementFIFO replacementOptimal replacement11.7 Explain the purpose of the open and close operations.11.9 Give an example of an application in which data in a file should be accessed in the following order:a. Sequentiallyb. Randomly11.12 Consider a system that supports 5000 users. Suppose that you want to allow 4990 of these users to be able to access one file.a. How would you specify this protection scheme in UNIX?b. Could you suggest another protection scheme that can be used more effectively for this purpose than the scheme provided by UNIX?12.1 Consider a file currently consisting of 100 blocks. Assume that the file control block (andthe index block, in the case of indexed allocation) is already in memory. Calculate how many disk I/O operations are required for contiguous, linked, and indexed (single-level) allocation strategies, if, for one block, the following conditions hold. In the contiguousallocation case, assume that there is no room to grow in the beginning, but there is room to grow in the end. Assume that the block information to be added is stored in memory.a. The block is added at the beginning.b. The block is added in the middle.c. The block is added at the end.d. The block is removed from the beginning.e. The block is removed from the middle.f. The block is removed from the end.13.2 Consider the following I/O scenarios on a single-user PC.a. A mouse used with a graphical user interfaceb. A tape drive on a multitasking operating system (assume no device preallocation is available)c. A disk drive containing user filesd. A graphics card with direct bus connection, accessible through memory-mappedI/OFor 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.14.2 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, is86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests, for each of the following diskschedulingalgorithms?a. FCFSb. SSTFc. SCANd. LOOKe. C-SCAN1.1 1.62.3 2.53.7 6.3 6。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
XX大学2011 ——2012 学年第一学期《操作系统》期末考试试题(A)一.二.选择题(20分,每题1分)1. Generally speaking, which one is not the major concern for a operating system in the following four options?( D )A.Manage the computerB.Manage the system resourcesC.Design and apply the interface between user's program and computer hardware systemD.High-level programming language complier2.The main disadvantage of batch system is ( C )A.CPU utilization is lowB.Can not concurrentck of interactionD.Low degree of automation3.A process transforms from waiting state to ready state is caused by the ( B )A.Interrupt eventB.Process schedulingC.Create a process for a programD.Waiting for some events4.The concurrent process is refers to ( C )A.The process can be run in parallelB.The process can be run in orderC.The process can be run in the same timeD.The process can not be interrupted5.In multi-process system, in order to ensure the integrity of public variables, the processes should be mutually exclusive access to critical areas. The so-called critical area is ( D )A.A bufferB.A date areaC.Synchronization mechanismD.A program6.The orderly use of resources allocation strategy can destroy the condition ( D ) to avoid deadlock.A.Mutual exclusiveB.Hold and waitC.No preemptionD.Circular waiter's applications use the system resources to complete its operation by the support and services of ( C )A.clicking the mouseB.Keyboard commandC.System callD.Graphical user interface8.There are four jobs arrived at the same time and the execution time of each job is 2h. Now they run on one processor at single channel,then the average turnaround time is ( B )A.1hB.5hC.2.5hD.8h9.Among the job scheduling algorithms, ( B ) is related to the job's estimated running time.A.FCFS scheduling algorithmB.Short-job-first scheduling algorithmC.High response ratio algorithmD.Balanced scheduling10.In memory management, the purpose of using the overlay and swapping is ( C )A.Sharing main memoryB.Expanding main memory physicallyC.Saving main memory spaceD.Improving CPU utilization11.In the page-replacement algorithm,which one can cause the Belady phenomenon? ( A )A.FIFOB.LRUC.CLOCKINGD.OPT12.The following description of the system in safe state,which one is correct?( B )A.It must cause deadlock if the system is in insecure stateB.It may cause deadlock if the system is in insecure stateC.It may cause deadlock if the system is in secure stateD.All are wrong13.Generally, when we talk about"Memory Protection", the basic meaning is ( C )A.Prevent hardware memory from damagingB.Prevent program from losing in memoryC.Prevent the cross-border call between programsD.Prevent the program from being peeped14.The actual capacity of virtual memory is equal to ( B )A.The capacity of external memory(disk)B.The sum of the capacity of external memory and main memoryC.The space that the CPU logical address givesD.The smaller one between the option B and C15.Physical file's organization is determined by ( D )A.ApplicationsB.Main memory capacityC.External memory capacityD.Operating system16.A computer system is configured with two plotters and three printers,in order to properly drive these devices,system should provide ( C ) device driver program.A.5B.3C.2D.117.When there are fewer number of channels in system ,it may cause "bottlenecks".To solve this problem,which of the follow options is not the effective way?( A )A.improving the speed of CPUing the virtual device technologyC.Adding some hardware buffer on the devicesD.Increasing the path between devices and channels18.When I/O devices and main memory are exchanging data, it can be achieved without CPU's frequently intervention,this way of exchanging data is called ( C )A.PollingB.InterruptsC.Direct memory accessD.None of them19.The following description of device management, which one is not correct?( B )A.All external devices are managed by the system in uniformB.Channel is a software of controlling input and outputC.The I/O interrupt events from the I/O channel are managed by device managementD.One of the responsibility of the operating system is to use the hardware effectively20.The operating system used ( A ), it realized a mechanism that we can use more space to save more time.A.SPOOLINGB.Virtual storageC.ChannelD.Overlay三.填空题(20分,每空1分)1.Software may trigger an interrupt by executing a special operation called a system call .(P7)2.If there is only one general-purpose CPU,then the system is a single-processor system.(p12)3. A process can be thought of as a program in execution. (p79)4.As a process executes,it changes state.Each process may be in one of the following states:new,running,waiting,ready or terminated .(p83)5.Long-term(job) scheduling is the selection of processes that will beallowed to contend for the CPU.And Short-term(CPU) scheduling is the selection of one process from the ready queue. (p116)6.The process executing in the operating system may be either independent processes or cooperating processes. Cooperating processes require an interprocess communication mechanism to communicate with each other.Principally,communication is achieved through two schemes: share memory and message passing. (p116)7.In modern operating systems, resource allocation unit is process, processor scheduling unit is thread .(p127)8.Most modern operating systems provide kernel support for threads;among these are Windows,as well as Solaris and Linux .(p146)9.CPU scheduling is the basis of multiprogrammed operating systems.(p153)10.The FCFS algorithm is nonpreemptive;the RR algorithm is preemptive.11.Sometimes,a waiting process is never again able to change state,because the resources it has requested are held by other waiting processes.This situation is called deadlock . (p245)12.The main purpose of a computer system is to execute programs.These programs,together with the data they access,must be in main memory(at least partially) during execution.(P274)13. The various memory-management algorithms differ in may aspects.In comparing different memory-management strategies,we use the follow considerations:Hardware support,Performance,Fragmentation,Relocation, Swapping,Sharing and protection . (p310)14.A process is thrashing if it is spending more time paging than executing.15.Virtual memory is a technique that enables us to map a large logical address space onto a smaller physical memory.(p365)16.When we solve the major problems of page replacement and frame allocation,the proper design of a paging system requires that we consider page size,I/O,locking,process creation,program structure,and other issues.(p366) 17.The operating system abstracts from the physical properties of its storage devices to define a logical storage unit,the file . (p373)18.Since files are the main information-storage mechanism in most computer system,file protection is needed.(p408)19.The seek time is the time for the disk arm to move the heads to the cylinder containing the desired sector.(P457)20.The hardware mechanism that enables a device to notify the CPU is called an interrupt .(p499)四.简答题(30分,每题6分)1.What is the operating system?What role does the operating system play in acomputer?开放题,解释操作系统概念,操作系统可以实现哪些基本功能?关键词:a.管理系统资源,控制程序运行,改善人机界面,为其他应用软件提供支持。