Docstoc

3583-Operating System Concepts_VUsolutions.com

Document Sample
3583-Operating System Concepts_VUsolutions.com Powered By Docstoc
					      ALLAMA IQBAL OPEN UNIVERSITY, ISLAMABAD
                        (Department of Computer Science)

Course: Operating System Concepts (3583)                  Semester: Autumn, 2011
Level: PGD (CS)                                                 Total Marks: 100
                                                                  Pass Marks: 50

                                   WARNING
1.   PLAGIARISM OR HIRING OF GHOST WRITER(S) FOR SOLVING
     THE ASSIGNMENT(S) WILL DEBAR THE STUDENT FROM AWARD
     OF DEGREE/CERTIFICATE, IF FOUND AT ANY STAGE.
2.   SUBMITTING ASSIGNMENTS BORROWED OR STOLEN FROM
     OTHER(S) AS ONE’S OWN WILL BE PENALIZED AS DEFINED IN
     “AIOU PLAGIARISM POLICY”.

                            ASSIGNMENT No. 1
                                    (Units: 1–4)

Note: All questions are compulsory. Each question carries equal marks.

Q. 1 (a)   Why is the shell not part of the operating system itself?
     (b)   Which of the following instructions should be allowed only in kernel mode?
           i)    Disable all interrupts
           ii)   Read the time-of-day clock
           iii) Set the time-of-day clock
           iv) Change the memory map
     (c)   What is a race condition? Explain the difference between busy waiting and
           blocking.

Q. 2 (a)   Consider a memory system with a cache access time of 100ns and a memory
           access time of 1200ns. If the effective access time is 10% greater than the
           cache access time, what is the hit ratio H?
     (b)   Capabilities, access control lists, and the UNIX rwx bits are the three
           different protection mechanisms. For each of the following protection
           problems, tell which of these mechanisms can be used.
           i)     Omer wants his files readable by everyone except Usman.
           ii)    Asim and Ali want to share some secret files.
           iii) Ahsan wants some of his files to be public.
           For UNIX, assume that groups are categories such as faculty, students,
           secretaries, and so on.



                                          1
Q. 3 Consider the following set of processes with the arrival time and the length of the
     CPU burst time given in milliseconds:
            Process             P1         P2        P3       P4        P5
            Arrival Time        9          6         8        7         5
            Burst Time          3          4         9        9         7
      Which CPU scheduling algorithm listed below yields the shortest average
      turnaround time?
      (a) FCFS (First-Come-First-Served)
      (b) SJF (Shortest Job First; without preemption)
      (c) SJF (Shortest Job First; with preemption)
      (d) RR-1 (Round-Robin with a time quantum of 1 milliseconds)
      Please show all your work for full marks.

Q. 4 A process contains 5 virtual pages on disk and is assigned a fixed allocation of four
     page frames in main memory. The following Page Trace occurs.
                  1 0 2 2 1 4 4 1 0 1 2 0 3 0 4
      (a)   Show the successive pages residing in the four frames using the LRU
            replacement policy. Assume that the frames are initially empty. Compute the
            hit ratio for LRU in the main memory.
      (b)   Repeat Part (a) for the FIFO replacement policy. Compute the hit ratio for
            FIFO in the main memory.

Q. 5 Assume that you have free memory partitions of size 100KB, 500KB, 200KB,
     300KB, and 600KB (in this order) and that memory requests for 212KB, 417KB,
     112KB, and 426KB arrive. Show how the following algorithms would assign the
     requests to free memory. Clearly show the size of each piece of memory after each
     request arrives.
     (a) First-Fit allocation algorithm (Do not assume rotating First-Fit).
     (b) Best-Fit allocation algorithm.
     (c) Worst-Fit allocation algorithm.

                              ASSIGNMENT No. 2
                                      (Units: 5–8)
Total Marks: 100                                                        Pass Marks: 50

Note: All questions are compulsory. Each question carries equal marks.
Q. 1 (a)    The clock interrupt handler on a certain computer requires 2 msec (including
            process switching overhead) per clock tick. The clock runs at 60 Hz. What
            fraction of the CPU is devoted to the clock?

                                            2
      (b)   Why are output files for the printer normally spooled on a disk before being
            printed, instead of being directly from the application program?

Q. 2 Disk requests come in to the disk driver for cylinders 10, 22, 2, 40, 6 and 38, in that
     order. A seek takes 6 msec per cylinder moved. How much seek time is needed for
     (a) First-come, first served
     (b) Closest cylinder next
     (c) Elevator algorithm (initially moving upwards)
     In all cases, the arm is initially at cylinder 20.

Q. 3 (a)    Draw a resource allocation graph (also called a reusable resource graph) that
            represents a deadlock state. Your graph must contain at least two resources
            and at least two tasks. Each resource must contain 3 units.
      (b)    Of course when execution started there were no arcs in the resource
            allocation graph. Give a scenario starting from this initial condition of no
            arcs and ending in the graph you gave for part (a). That is, tell what requests
            and releases occur and in what order. For this part you should assume a naïve
            (i.e., optimistic) resource manager that grants every request as soon as it can.
      (c)   Recall that the Banker’s algorithm for resource allocation never enters a
            deadlocked state like the one in part (a). Consider the scenario you gave for
            part (b) and tell at what point the Banker’s algorithm will depart from the
            scenario. That is, indicate the first request that the Banker’s algorithm will
            refuse to grant that the optimistic manager did grant. Assume each process
            has a claim (not a request) for 3 units of each resource.
      (d)   Why the Banker’s algorithm refused to grant the request you noted in part (c).

Q. 4 (a)    To what hardware concept is a signal closely related? Give two examples of
            how signals are used.
      (b)   Give two examples of the advantages of relative pathnames over absolute ones.
      (c)   Why does UNIX distinguish between standard output and standard error,
            when both default to the terminal?

Q. 5 (a)     A process with transaction timestamp 50 needs a resource held by a process
            with transaction timestamp 100. What happens in the following?
            i)    Wait-die
            ii)   Wound-wait
      (b)   Is optimistic concurrency control more or less restrictive than using
            timestamps? Why?




                                             3
      ALLAMA IQBAL OPEN UNIVERSITY, ISLAMABAD
                        (Department of Computer Science)

Course Code:                 3583 (Old 3428)
Course Title:                Operating Systems Concepts
Credit Hours:                4 (3+1) 3 hours lectures and 2 hours Lab per week
Recommended Book:            Modern Operating System 3rd Edition by Andrew
                             S. Tanenbaum, 2008
Reference Book:              Operating System Concepts by Abraham Silberschatz, Peter
                             B. Galvin, and Greg Gagne, 2008

Course Outlines:
Unit No. 1 Introduction
     What is an Operating System? History and Goals, Evolution of multi-user systems,
     Operating System Concepts, Operating System Structure.
Unit No. 2 Process
     Processes and CPU management, Inter-Process Communication, Multithreading,
     Kernel and User Modes, Protection, Problems of cooperative processes,
     Synchronization, Process Scheduling.
Unit No. 3 Deadlock
     Resources, Deadlocks, Deadlock Detection, Deadlock Recovery, Deadlock
     Avoidance, Deadlock Prevention, Other Issues.
Unit No. 4 Memory Management
     Memory Management without Swapping or Paging, Demand paging, Swapping,
     Relocation, Virtual Memory, Page Replacement Algorithms, External
     Fragmentation.
Unit No. 5 File Systems
     Files, Directories, Files System Implementation, Security, Protection Mechanisms,
     Secondary Storage.
Unit No. 6 Input/Output
     Principles of I/O Hardware, Principles of I/O Software, Disks, Clocks, Terminals.
Unit No. 7 Introduction to Distributed Operating Systems
     Network Operating System, Distributed Operating System.
Unit No. 8 Concurrency
     Introduction to concurrency, Concurrent processes, concurrent transactions.
Unit No. 9 Case Studies
     Introduction to Linux and Windows Operating Systems.


                                           4

				
DOCUMENT INFO
Description: AIOU Autumn 2011 Semester Download Assignments of Postgraduate to PhD Level,