Operating systems miscellaneous


Operating systems miscellaneous

  1. A unix-style I-node has 10 direct pointers and one single, one double and one triple indirect pointers. Disk block size is 1 kbyte, disk block address is 32 bit, and 48-bit integers are used. What is the maximum possible file size?









  1. View Hint View Answer Discuss in Forum

    Size of 1 block = 1 kB
    Block addresses size 1 pointer size = 32 bit = 4 bytes.

    So , no. of pointers in =
    210
    B
    22

    1 block = 256
    So direct pointer will have = 10 × 1kB = 10kB
    Double will have = 256 × 256 × 1 kB
    Triple will have = 256 × 256 × 256 × 1 kB = 28 × 28 × 28 × 210 B = 234 B
    Hence (c) is correct option.

    Correct Option: C

    Size of 1 block = 1 kB
    Block addresses size 1 pointer size = 32 bit = 4 bytes.

    So , no. of pointers in =
    210
    B
    22

    1 block = 256
    So direct pointer will have = 10 × 1kB = 10kB
    Double will have = 256 × 256 × 1 kB
    Triple will have = 256 × 256 × 256 × 1 kB = 28 × 28 × 28 × 210 B = 234 B
    Hence (c) is correct option.


  1. Consider a disk system with 100 cylinders. The requests to access the cylinders occur in following sequence 4, 34, 10, 7, 19, 73, 2, 15, 6, 20 Assuming that the head is currently at cylinder 50, what is the time taken to satisfy requests, if it takes 1 ms to move from one cylinder to adjacent one and shortest seek time first policy is used?









  1. View Hint View Answer Discuss in Forum

    Requests 4 34 10 7
    19 73 2 15 6 20
    Current 50 34 20 19
    15 10 7 6 4 2
    Next access 34 20 19 15
    10 7 6 4 2 73
    Difference 16 14 1 4
    5 3 1 22 71

    Therefore, total moves = 16 + 14 + 1 + 4 + 5 + 3 + 1 + 2 + 2 + 71 = 119 ms

    Correct Option: B

    Requests 4 34 10 7
    19 73 2 15 6 20
    Current 50 34 20 19
    15 10 7 6 4 2
    Next access 34 20 19 15
    10 7 6 4 2 73
    Difference 16 14 1 4
    5 3 1 22 71

    Therefore, total moves = 16 + 14 + 1 + 4 + 5 + 3 + 1 + 2 + 2 + 71 = 119 ms



  1. The enter _CS() and leave_CS() functions to implement critical section of a process are realized using test-and-set instruction as follows
    void enter_CS(X)
    {
    while (test-and-sex (X));
    }
    void leave_CS(X)
    {
    X = 0;
    }
    In the above solution, X is a memory location associated with the CS and is initialized to 0. Now, consider the following statements :
    1. The above solution to CS problem is deadlock-free.
    2. The solution is starvation-free.
    3. The processes enter CS in FIFO order.
    4. More than one processes can enter CS at the same time.
    Which of the above statements is true?









  1. View Hint View Answer Discuss in Forum

    The given program initializes the memory location X to 0 in the test and set instruction and in the function leave_CS().
    ∴ Above solution is deadlock free.

    Correct Option: A

    The given program initializes the memory location X to 0 in the test and set instruction and in the function leave_CS().
    ∴ Above solution is deadlock free.


  1. Consider the methods used by processes P1 and P2 for accessing their critical sections whenever needed, as given below. The initial values of shared Boolean variables S1 and S2 are randomly assigned.

    Which one of the following statements describes the properties achieved?









  1. View Hint View Answer Discuss in Forum

    As per the methods provided in process 1 and process 2, the process 1 and process 2 cannot exist simultaneously in the critical section. So, when the process 1 is in the critical section, process 2 is not and thus, the condition of mutual exclusion is satisfied but not progress.

    Correct Option: A

    As per the methods provided in process 1 and process 2, the process 1 and process 2 cannot exist simultaneously in the critical section. So, when the process 1 is in the critical section, process 2 is not and thus, the condition of mutual exclusion is satisfied but not progress.



  1. An application loads 100 libraries at startup. Loading each library requires exactly one disk access. The seek time of the disk to a random location is given as 10 ms. Rotational speed of disk is 6000 rpm. If all 100 libraries are loaded from random location on the disk, how long does it take to load all libraries? The time to transfer data from the disk block once the head has been positioned at the start of the block may be neglected?









  1. View Hint View Answer Discuss in Forum

    6000 rotations ............. 60 sec
    1 rotation ............. 10 ms
    ∴ Rotational latency = 5 ms
    Time for one disk access = 15 ms
    Time to load all libraries = 15 × 100 = 1500 ms = 1.5 s

    Correct Option: B

    6000 rotations ............. 60 sec
    1 rotation ............. 10 ms
    ∴ Rotational latency = 5 ms
    Time for one disk access = 15 ms
    Time to load all libraries = 15 × 100 = 1500 ms = 1.5 s