《试卷(002)B》由会员分享,可在线阅读,更多相关《试卷(002)B(15页珍藏版)》请在金锄头文库上搜索。
1、操作系统试题(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
2、-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, gi
3、ve 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
4、:(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
5、 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 se
6、at, 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
7、 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 an
8、y 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
9、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
10、, 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 addr
11、ess 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
12、 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
13、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
14、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 o
15、f 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)