Saturday 14 January 2012

operating system(3)


3. Storage Management

1          What are the disadvantages of linked allocation technique of files?                      [4]
Ans:--
i. Slow direct accessing of any disk block - To find out the Nth block of a file, we must start at the beginning of that file and follow the Dointer until we get to the Nth block.

ii. Space requirement for pointers - If a pointer requires two words out of a 512 words block, then around 39 percent of the disk is being pond only for pointers, not for information. Each file therefore requires more space.

iii. Reliability - Since disk blocks are linked by pointers, a single damaged pointer can make thousands of disk blocks inaccessible. Some operating systems address this problem by storing pointers in a dedicated file and making redundant copies of it. The idea is to copy the list of pointers into the main memory and thus facilitate faster access of disk blocks. Redundancy of pointers files is employed for safer recovery.

2          A 2500 byte long segment begins at physical address 9010. Assuming that a location can hold one byte. what will be the physical address of byte 187. byte 3004?                              [4]
3          Describe briefly what happens after a user types the command "delete myfile" In a system.                                                                            [4]
4          When a process terminates It releases its memory space where a "hole" is created. If there are several such “holes" In memory and another process Is scheduled to run, then what are the advantages and disadvantages of using the "best-fit" and the "first-fit" strategies for. .allocating memory space to the, new process?        [5]
5          Consider the following page reference during a given time interval for a memory consisting of 5 frames: 12.16,13.16.17.14.12.14.18.14.12.19.17.18. Using the I) FIFO replacement strategy and the' II) the LRU replacement strategy compare the results. Which page replacement strategy is considered to be the best one and what disadvantage does it have?                                [11]
6          Assuming the size of logical address to be 232 and the page size to be 212. find the bits required for page number and page offset In the logical address.                                          [2]

7          How does the combined paging-segmentation scheme work? 4
Ans :  
  • Combine Paging and Segmentation
    • Structure
      • Segments correspond to logical units: code, data, stack. Segments vary in size and are often large.
      • Each segment contains one or more (fixed-size) pages.
    • Two levels of mapping to make tables manageable (2 look-ups!)
      • Page table for each segment.
  • Segments Pages Advantages
    • Advantages of Segments
      • Supports sparse address spaces. If segment is not used, no need for page table. Decreases memory required for page tables.
    • Advantages of Paging
      • Eliminate external fragmentation.
    • Advantages of Both. Increases flexibility of sharing. Share at two levels: Page or segment (entire page table).
  • Segments + Pages Disadvantages
    • Internal fragmentation increases. Last page of every segment in every process .
    • Increases overhead of accessing memory
      • 1 or 2 overhead references for every real reference.
    • Large page tables
      • Two potential solutions: Page the user page tables (multilevel page table), Inverted page table.
           
8         Consider a system where free space is kept in a free-space list. Suppose the pointer to the free-space list is lost. Can the system reconstruct the free-space list? Explain, Why must the bit map for file allocation be kept on mass storage rather than in main memory?                                                                    [4]
9          What is TLB? Mention the disadvantage of using it. Find out the effective memory access time with an 85% hit ratio and the following access times: TLB access time: 25ns; MM access time: 100ns.                                 [7]
10        What is the concept behind the working set strategy? What are the probiems associated with the strategy?                                        [6]
11        Consider the following page reference during a given time interval for a memory consisting of 3 frames: b,c,a,a,c,d,b,e,f,a,b,d,a,f,a. Using the i) First In First Out (FIFO) replacement strategy and the ii) the Least Recently Used (LRU) replacement strategy compare the results. Does always the page hit increase if the number of frames is increased? Give reasons for your answer. [12]

12        When files are deleted, the blocks freed are put on the free list without being erased. Should these blocks be erased of all the data on them? If yes, when should it be done?                                                                        [4]
13        The overhead required to read an entry in a page table (including the time to access associative memory) is 50 nanoseconds. To reduce this overhead the computer has an associative memory that can hold 16 entries and can be accessed in 10 nanoseconds.
i)          Find a formula that expresses the effective access time as a function of the hit ratio.
ii)        What hit ratio is needed to reduce the effective access time to 70 nanoseconds?                                                           [10]
14        What problems could occur if a system allowed a file system to be mounted simultaneously at more than one location?              [6]

15        What are the various modes that can be used to perform Static Address binding? What are the pros & cons of such Static Address binding?   [4]
16        Illustrate the notions of temporal locality of reference as well as spatial locality of reference in a high level program by some example. [4]
17        Suppose the Operating System would like to mark a frame (main memory copy of a page) as Execute only i.e. Reading & Writing on that page/frame is not allowed. What feature of the System Architecture is needed to implement this?  Discuss with justification.                                                                  [4]
18        Specify, in proper sequence, the steps involved in translating a CPU generated Logical Address to its equivalent physical address in a Demand Paged Memory Management System. Assume that each of the Process involved does possess a huge Virtual Address Space such that the entire Page Map Table (P.M.T.) of any process cannot be accommodated in the existing Physical Memory System. Assume that the Physical Memory system consists on 2 level Cache L1 & L2 as well as the main memory while the secondary memory media (Disk) acts as the Virtual Memory. Consider ALL possible Hit as well as Miss situations.              [14]

19        What is TLB? Find out the effective memory-access time with an 80% hit ratio and the following access time:
            TLB access time: 20ns;                     MM access time: 100ns                                                    [8]
20        Describe the public-key encryption scheme and mention how is it advantageous to the data-encryption standard.                                                                                         [10]
21        Consider the following page reference during a given time interval for a memory consisting of 5 frames: y,c,z,c,d,a,y,a,e,a,y,f,d,e. Using the i) FIFO replacement strategy and ii) the LRU replacement strategy compare the results. Repeat both FIFO and LRU replacement strategies for memory with 3 frames and same page reference pattern. Comment on the findings and draw a conclusion justifying the adoption of a particular replacement strategy.                        [18]
22        What is dynamic loading? Mention its advantage. How is dynamic linking performed? Mention any disadvantage that you can think of for both the schemes.                                 [8]
23        Where and how “bit vector/table” is used? What are the advantages and disadvantages of the technique?                                                 [5]

24        What is the difference between a physical address and a virtual address?           [4]
25        A minicomputer uses the buddy system for memory management. Initially it has one block of 256K at address 0. After successive requests of 7K, 26K, 34K and 19K come in, how many blocks are left and what are their sizes ad addresses?                                  [6]
26        Explain working of virtual memory.                                       [6]
27        A computer whose processes have 512 pages in their address space keeps its page tables in memory. The overhead required for reading a work from the page table in 50 nsec. To reduce this overhead, the computer had a TLB that holds 32 entries and can do lookups in 5nsec. What hit rate is needed to reduce the mean overhead to 20nsec?     [6]
28        Contiguous allocation of files leads to disk fragmentation. Is this internal or external fragmentation?                                                                [3]
29        Can we implement symbolic links in DOS (FAT files system)? If so, show how, and if not, explain why.                                                                      [3]

30        Describe the problems with contiguous allocation method for allocating disk space. How does linked allocation method overcome the disadvantages of contiguous allocation method?                                                                  [4]
31        Explain External Fragmentation. How the compaction can be used to solve the problem of external fragmentation?                                         [4]
32        What is a thrashing? How can be problem of thrashing be prevented?                 [4]
33        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 LRU page replacement algorithm, assuming three frames?                                                                  [8]
34        When do page faults occur? Describe the actions taken by the operating system when a page fault occurs?                                                                                                       [6]
35        Differentiate between logical address and physical address.                                  [4]

36        Distinguish between logical and physical address space.                                                   [4]
37        What is TLB?    Find out the effective memory-access time with an 87% hit ratio and the following access times:
            TLB access time: 12ns;         MM access time: 90ns                 [8]
38        Consider the following page reference during a given time interval for a memory consisting of 3 frames : v.w.u.u.w.x.v.y.z.u.v.x.u.z.u. Using the i) First In First Out (FIFO) replacement strategy and the ii) the Least Recently Used (LRU) replacement strategy compare the results. Does page hit increase if the number of frames is increased? Give reasons for your answer.                           [10]
39        What is dynamic loading? Mention its advantage. How dynamic linking is performed? Mention any disadvantage that you can think of for both the schemes.                                 [8]
40        Distinguish between paging and segmentation schemes of memory management.        [4]
41        Where and how "bit vector/table" is used in free space management of disks? What are the advantages and disadvantages of the technique?        [5]

42        State the advantages of segmentation over paging.               [4]
43        What do you understand by reentrant code? How does it support sharing?                    [6]
44        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?                                                 [6]
45        Distinguish between internal fragmentation and external fragmentation. Which of the two is prevalent in paging system?                  [4]
Ans:-- Fragmentation occurs in a dynamic memory allocation system when many of the free blocks are too small to satisfy any request.

External Fragmentation:
External Fragmentation happens when a dynamic memory allocation algorithm allocates some memory and a small piece is left over that cannot be effectively used. If too much external fragmentation occurs, the amount of usable memory is drastically reduced. Total memory space exists to satisfy a request, but it is not contiguous.

Internal Fragmentation:
Internal fragmentation is the space wasted inside of allocated memory blocks because of restriction on the allowed sizes of allocated blocks. Allocated memory may be slightly larger than requested memory; this size difference is memory internal to a partition, but not being used
46        What is the cause of thrashing? How can the OS reduce the effects of thrashing and improve overall performance?                              [4]
47        Consider the following page reference string.
            1, 2, 3, 4, 5, 3, 4, 1, 6, 7, 8, 9, 7, 8, 9, 5, 4, 5, 4, 2
            How many page faults would occur for the following replacement algorithms for five frames?
            1)         LRU Replacement
            2)         FIFO Replacement                                                                                 [12]


No comments:

Post a Comment