Operating Systems - B.Tech 4th Semester Exam., 2022

2022Semester 2Civil-CAEnd Semester
Bihar Engineering University, Patna
B.Tech 4th Semester Exam., 2022

Operating Systems

Time: 3 hoursCode: 105403Full Marks: 70

Instructions:

  1. The marks are indicated in the right-hand margin.
  2. There are NINE questions in this paper.
  3. Attempt FIVE questions in all.
  4. Question No. 1 is compulsory.
Q.1 Answer/Choose the correct answer of the following (any seven):[2x7=14]
  1. What is the difference between a multiprocessor and a multicore system?

  2. What is multiprogramming?

  3. Define jacketing.

  4. What operations can be performed on a semaphore?

  5. What is the difference between a page and a frame?

  6. In contiguous memory allocation

    1. each process is contained in a single contiguous section of memory
    2. all processes are contained in a single contiguous section of memory
    3. the memory space is contiguous
    4. None of the above
  7. If the size of logical address space is 2 to the power of \( m \), and a page size is 2 to the power of \( n \) addressing units, then the high order ___ bits of a logical address designate the page number, and the ___ low order bits designate the page offset.

    1. \( m, n \)
    2. \( n, m \)
    3. \( m-n, m \)
    4. \( m-n, n \)
  8. If the wait for graph contains a cycle, then

    1. a deadlock does not exist
    2. a deadlock exists
    3. the system is in a safe state
    4. either deadlock exists or system is in a safe state
  9. When the event for which a thread is blocked occurs?

    1. Thread moves to the ready queue
    2. Thread remains blocked
    3. Thread completes
    4. A new thread is provided
  10. An I/O port typically consists of four registers status, control, ___ and ___ registers.

    1. system in, system out
    2. data in, data out
    3. flow in, flow out
    4. input, output
Q.2 Solve both questions :[14]
  1. What is the purpose of interrupts? What are the differences between a trap and an interrupt? Can traps be generated intentionally by a user program? If so, for what purpose?

  2. Answer the following with full justifications:
    Does swapping improve or degrade the efficiency of system utilization?
    Can swapping be used in a multiprogramming system?

Q.3 Solve both questions :[14]
  1. Including the initial parent process, how many processes are created by the program shown below?
    #include<stdio.h>
    #include<unistd.h>
    int main()
    {
    /* fork a child process */
    fork();
    /* fork another child process */
    fork();
    /* and fork another */
    fork();
    return 0;
    }

  2. Describe the differences among short-term, medium-term, and long-term scheduling.

Q.4 Solve both questions :[14]
  1. An airline reservation system, using a centralized database service, user requests concurrently. Is it preferable to use threads rather than processes in this system? Give reasons for your answer.

  2. Consider a system running ten I/O-bound tasks and one CPU-bound task. Assume that the I/O-bound tasks issue an I/O operation once for every millisecond of CPU computing and that each I/O operation takes 10 milliseconds to complete. Also assume that the context-switching overhead is 0.1 millisecond and that all processes are long-running tasks. Describe the CPU utilization for a round-robin scheduler when-
    (i) the time quantum is 1 millisecond;
    (ii) the time quantum is 10 milliseconds.

Q.5 Solve both questions :[14]
  1. Clearly justify why deadlocks cannot arise in a bounded buffer producers-consumers system.

  2. Consider a system consisting of four resources of the same type that are shared by three processes, each of which needs at most two resources. Show that the system is deadlock-free.

Q.6 Solve this question :[14]
  1. Five batch jobs, A through E, arrive at a computer center at essentially the same time. They have an estimated running time of 15, 9, 3, 6 and 12 minutes, respectively. Their (externally defined) priorities are 6, 3, 1, 4 and 2, respectively, with a lower value corresponding to a higher priority. For each of the following scheduling algorithms, determine the waiting time for each process and the average waiting for all jobs. Ignore process switching overhead. Explain how you arrived at your answers. In the last three cases, assume that only one job at a time runs until it finishes and that all jobs are completely processor bound:
    (a) Priority scheduling
    (b) FCFS (run in order 15, 9, 3, 6 and 12)
    (c) Shortest job first

Q.7 Solve this question :[14]
  1. A bridge on a busy highway is damaged by a flood. One-way traffic is to be instituted on the bridge by permitting vehicles traveling in opposite directions to use the bridge alternately. The following rules are formulated for use of the bridge:
    (a) At any time, the bridge is used by vehicle(s) traveling in one direction only.
    (b) If vehicles are waiting to cross the bridge at both ends, only one vehicle from one end is allowed to cross the bridge before a vehicle from the other end starts crossing the bridge.
    (c) If no vehicles are waiting at one end, then any numbers of vehicles from the other end are permitted to cross the bridge.
    Develop a concurrent system to implement these rules.

Q.8 Solve both questions :[14]
  1. Consider a simple paging system with the following parameters:
    • \( 232 \) bytes of physical memory
    • Page size of \( 210 \) bytes
    • \( 216 \) pages of logical address space
    (i) How many bits are in a logical address?
    (ii) How many bytes are in a frame?
    (iii) How many bits in the physical address specify the frame?
    (iv) How many entries are in the page table?

  2. Given five memory partitions of 100 KB, 500 KB, 200 KB, 300 KB and 600 KB (in order). How would the first-fit, best-fit, and worst-fit algorithms place processes of 212 KB, 417 KB, 112 KB and 426 KB (in order)? Which algorithm makes the most efficient use of memory?

Q.9 Solve both questions :[14]
  1. Consider a demand paging system with a paging disk that has an average access and transfer time of 20 milliseconds. Addresses are translated through a page table in main memory, with an access time of 1 microsecond. Thus, each memory reference through the page table takes two accesses. To improve this time, we have added an associative memory that reduces access time to one memory reference if the page-table entry is in the associative memory. Assume that 80 percent of the accesses are in the associative memory and that of those remaining 10 percent (or 2 percent of the total) cause page faults. What is the effective memory access time?

  2. The open file table is used to maintain information about files that are currently open. Should the operating system maintain a separate table for each user or just maintain one table that contains references to files that are currently being accessed by all users? If the same file is being accessed by two different programs or users, should there be separate entries in the open-file table?