资源预览内容
第1页 / 共15页
第2页 / 共15页
第3页 / 共15页
第4页 / 共15页
第5页 / 共15页
第6页 / 共15页
第7页 / 共15页
第8页 / 共15页
第9页 / 共15页
第10页 / 共15页
亲,该文档总共15页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
操作系统试题(002) B卷num12345678910111213141516scores25325103105531010121051.What are the two main functions of an operating system?2.Which of the following instructions should be privileged?(a) Change memory management registers(b) Write the program counter(c) Read the time-of-day clock(d) Set the time-of-day clock(e) Change processor priority3.Name hardware features designed to explicitly assist the operating system.4.What is the principal advantage of multiprogramming?5. For each of the following transitions between process states, indicate whether the transition is possible. If it is possible, give an example of one thing that would cause it.(a) Run -ready;(b) Run - blocked; (c) Run - terminated(d) Run - swapped-blocked;(e) Blocked - run6.For the processes listed in Table 1, (1)draw a chart illustrating their execution .(2)what is the average turnaround time? (3) what is the wait time?using:(1) First-Come First-Served;(b) Shortest Job First; (c) Round Robin (quantum = 2)Table 1Processarrive time Processing TimeA04B2.55C3.53D5.517.Is a non-preemptive scheduling algorithm a good choice for an interactive system? Briefly why?8.Sleeping Barber Problem: There is a barber shop with n chairs for waiting customers, one barberschair and one barber. If a customer enters the store and there are no free chairs, the customer leaves. If a customer enters the store and the barber is seeping, the customer wakes up the barber and gets a haircut. Otherwise, a customer enters the store, takes a seat, and waits. If the barber finishes a haircut and there are waiting customers, the barber cuts the hair of the next customer. Otherwise, the barber goes to sleep in his chair. Using semaphores, write the functions to control the actions of customers and the barber.9.Is the state described in Table 2 safe or unsafe?Table 2ProcessCurrentAllocationMaximumAllocationResourcesAvailableR1R2R1R2R1R2P1729521P21326P31122P4305010.Show that by assigning a unique priority number to each resource, and prohibiting a process from requesting a resource with a priority less than or equal to the priority of any held resource, deadlock can be avoided.11.On a simple paged system, associative registers hold the most active page entries and the full page table is stored in the main memory. If references satisfied by the associative registers take 60 ns, and references through the main memory page table take l80 ns, what must the hit ratio be to achieve an effective access time of 80 ns?12.On a system using simple segmentation, compute the physical address for each of the logical addresses,given the following segment table. If the address generates a segment fault, indicate so. (a) 0, 109(b) 2, 100(c) 1, 210(d) 3, 222(e) 0, 130SegmentBaseLength0300110185521122002003458302 13.In this problem, use binary values, a page size of 26 bytes, and the following page table. Which of the following virtual addresses would generate a page fault? For those that do not generate a page fault,to what physical address would they translate?(a) 0000101101001(b) 0000010010010(c) 0000100010101(b) 0000001110101Present Bit(1 in/ 0 out)Frame00010110000101101111101001000111010101100010010114.Given references to the following pages by a program:0,9,0, 1, 8, l,8,7, 8,7, l,2,7,2,7, 8,2,3,8,3,(1)how many page faults will occur if the program has three page frames available to it and uses:(a) FIFO replacement?(b) LRU replacement?(2)what is the working set W(t,l), with t equals to the time between the 9th and l0th references, and lequals to 6 references?15.A file system uses 256-byte physical blocks. Each file has a directory entry giving the file name,location of the first block, length of file, and last block position. Assume last physical block read andthe directory entry are already in main memory. For the following, indicate how many physical blocks mustbe read to access the specified block (including the reading of the specified block) on a system (1)using contiguous allocation;(2) using linked allocation.(a) Last block read: l0; block to be read: 800(b) Last block read: 500; block to be read: 10016.In computer system, why buffers are needed?Answer to操作系统试题(002) B卷1.What are the two main functions of an operating system?The two main functions of an operating system are managing system resources and providing application programs with a set of primitives that provide higher-level services.2.Which of the following instructions should be privileged?(a) Change memory management registers(b) Write the program counter(c) Read the time-of-day clock(d) Set the time-of-day clock(e)
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号