Solved question paper for OS May-2017 (BCA 6th)

Operating Systems

Previous year question paper with solutions for Operating Systems May-2017

Our website provides solved previous year question paper for Operating Systems May-2017. Doing preparation from the previous year question paper helps you to get good marks in exams. From our OS question paper bank, students can download solved previous year question paper. The solutions to these previous year question paper are very easy to understand.

These Questions are downloaded from www.brpaper.com You can also download previous years question papers of 10th and 12th (PSEB & CBSE), B-Tech, Diploma, BBA, BCA, MBA, MCA, M-Tech, PGDCA, B-Com, BSc-IT, MSC-IT.

Print this page

Question paper 1

  1. Section-A

    1.(a) distinguish between personal computer operating system and large computer operating.

    Answer:

    Personal computer operating system:- It is typically more graphically oriented is a designed to support and interact directly with a user.

    Typically located at a display and keyboard and some kind of painting device.

    Program running on that system generally interact with that user in real time.

    There's systematically presented with a lot more unfamiliar task.

    Mode different third party program and have to be more prepared to catch a interrupt and family and hacking attempts.

    More graphically oriented spend more time on fitting stuff like High resolution Games etc.

    Large computer operating system:- Generally running a lot of jobs which land to be interacting with other process running on other computer rather than human user.

    Workload to be proceed is usually much bigger than human could absorb handling very large data.

    Cost of system being managed is way more expensive.

    It's usually less human interface and graphics then it is about data manipulation and total thought put.

    Most large computer operating system and job land to be more regimented and pre-screened, pre proceed and typically deducted to a few very well defined job they are running.

  2. (b)  Distinguish long term scheduler and short term scheduler as applied to an Operating System.

    Answer:


     

     

    Short Term

     

    Long Term

    1.

    Short term scheduling plan does scheduling of process that in a ready state.

    1.

    Long term scheduling plan the CPU scheduling for batch jobs.

    2.

    It is also known as a CPU scheduler.

    2.

    It is known as job scheduler.

    3.

    Its frequency is a high as it has to work very often.

    3.

    Its frequency is usually low as there may be minutes between the creation of new process.

    4.

    It is involved whenever an event occur.

    4.

    It needs to be invoked only when the process leaves the system.

    5.

    It change the process state from ready to running.

    5.

    It change the processor state from new to ready.

    6.

    It selects a new process for a CPU quite frequently.

    6.

    It is lacks a good processor mix of input or output bound and CPU round.

    7.

    It is minimal in time sharing system

    7.

    It is absent in a time sharing system.

  3. 2. Distinguish between

    (a) multiprogramming and time sharing

    (b) multitasking and parallel system

    (c) batch and personal computer system.

    Answer:

    (a) Multiprogram and time sharing:-

    Multiprogramming system:-

    Multiprogramming operating system Allow multiple user to executed multiple program using a single CPU concurrently I. At the same time.

    It does not means that CPU exectes the instruction from server program at the same time.

    CPU is as it busy writing output data on the disk. The CPU is I located to a program b. Which is also present in the main memory. Another program c president Lee in the main memory. Is a waiting for the CPU to become free.

    1. Running:- CPU is being used in program.

    2. Blocked:- Performing I/O operations.

    3. Ready:- Waiting for CPU to assigned to it.

    Time sharing system:-

    Time sharing refers to to the allocation of computer resources in time-dependent fashion to server program simultaneously.

    Any time sharing system the CPU time is a divided among all the user on US scheduling basis.

    Each programs is allocated a very short period of CPU time one by one.

    The short period of time during which user get to intention of CPU is known as time.


     

    (b) Multitasking:-

    Multitasking OS single user can execute multiple programs at the same time.

    Multitasking is the system capability to work on more than one job or process at the same time.

    # the two types of multitasking

    1. Cooperative Multitasking:-

    2. Pre-emptive Multitasking:-

    1. Cooperative Multitasking:- A program can acquire the CPU for the required amount of time. A program can share CPU with any other program that is executing simultaneously if it does not currently require the CPU.

    2. Pre-emptive Multitasking:- In Pre-emptive Multitasking the operating system allocates particular time to a program full stop the CPU is it preempted if a higher priority job arrive in a system.

    Parallel System :-

    A system is said to be parallel system in which multiple processor have director process to share memory which forms are common address space.

    Usually Hai combined system are referred to as parallel system.

    There is a single system why the primary memory that is shared by all the processes.


     

    (c) Batch:-

    Batch of job are executed

    In a batch processing the user did not a impacted directly with the computer system.

    When a batch of program have been collected the operator loads the batch of program into the computer at one time where they are executed on after the other.

    Personal Computer system :-

    A personal computer is multi purpose computer.

    A software for personal computer is typically divide a distributed independent from the hardware or operating system.

    Is computer has processor check for the 100 off on and off switches.

    An operating system program tell the switches how to configure themselves for web browsing.

  4. 3.(a)With an example discuss the preemptive SJF scheduling algorithm.

    Answer:

    SIF:-

    SHORTEST JOB FIRST

    It is faster then FCFS

    In SJF the processor with the last element time is selected from the ready queue for execution.

    SJF algorithm associated with each process the length of its next CPU burst. When the CPU is available it is assigned to the process that has the smallest next CPU burst.

    SJF algorithm can be preemptive and non- preemptive.

    Pre emptive SJF:-

    The preemptive version of sjf scheduling is known as shortest remaining time scheduling.

    SPT scheduling is useful in time sharing system.

    In SRT the process with the smallest extreme run time to completion is sun next. The rule is applied even fast new arrival process.

    Anytime a new process enters the pole of processes to be scared dual schedule compare value free its remaining processing time with that of the process currently running. If the new process time is less than a currently running process then a preempted and CPU is allocated to new process.

  5. (b) Explain process scheduling with help of diagram.

    Answer:

    Process scheduling means a process is is executing in a manner or some ways.

    The execution of process in step by step.

    It is the important in multiprogramming when survival are more than one processor run at a single time.

    In multiprogramming more than one program means number of program run and in main memory so when one process is busy in in input or output operation or make for other resources which is not available then the The Other process are using CPU according their serial order in ready queue. In this way CPU utilisation is maximized.

    In single programming where only one program is run at a time there is no need of processes schedules

    By using schedule for many process constantly o r concurrently the process are done their working very efficiently and effectively.

    Sub function of process scheduling:-

    1. Scheduling:-

    Scheduling is the first step

    In this tab all the processes are selected

    In this type of processor taken from selected processes queues and then send to ready queue for execution.

    Ready queue send it to CPU.

    This is done by component of operating system called scheduler.

    1. Dispatching:-

    In this function the module give control of CPU to selected process.

    This is done by operating system component dispatches.

    Thndispatcher is responsible for assigning the CPU to the process.

    1. Context Save:-

    Context save means status saving of process.

    Sometime the execution of process is suspended due to some reason then the PCB save the status of process which is suspended.

    And next time execution of suspended process is stores from baith status which is saved by PCB.

  6. 4.Write the criteria used for comparing various scheduling algorithms? Computer the average waiting and turnaround times of following if shortest remaining time first scheduling algorithm is used.

    Process Arrival time Burst Time
    P1 0 8
    P2 1 4
    P3 2 9
    P4 3 5

    Answer:

    4 scheduling Criteria:-

    The goal of scheduling algorithm is to identify the process whose selection will result the best possible system performance.

    Best performance is a subjective evaluation and depend upon the number of criteria of different relative importance. The commonly used criteria can be grouped into two categories.

    1. User Oriented

    2. System Oriented

    1. User Oriented:- Relate to the behaviour of the system as Preet received by individual user or process for example response time, turn around time.

    2. System Oriented:- Relate to effective and efficient use the processor. For example throughput CPU utilisation, fairness, priorities.

    The various scheduling criteria for evaluating an algorithm are

    1. CPU Utilization:- CPU Utilization is the average function of time during which the processor is busy.

    The level of CPU utilisation depends on the load on the system.

    1. Throughput:-Throughput refers to the the number of processor in the system can in a period of time.

    Thus evaluation of throughput depends on the average of the process.

    1. Turnaround Time:- This is the interval of time between the submission of process and its complete.

    Thus turn around time is an average period of time it takes a process to execute.

    1. Waiting Time:- It is it X and investing for a resource allocation.

    Waiting Time can be expressed at turnaround time minutes the actual execution time.

    W(x)=T(x)-x

    Where X is the service time w x is waiting time of job requiring X units of service and TX is jobs turn around time.

    1. Response Time: Response time is defined as the time interval between the job submission and the first response produced by the job.

    In order to obtain better performance response time should be low.

    1. Fairness:- Fairness refers to the degree to which all process are given equal opportunity to execute.

    2. Priorities:- When the process are assigned priority scheduling policy should given proformas to to the higher priority processes.

    Higher priority processes should be given performance and the lower priority process should be preempted.

    The main purpose of scheduling is to maximize CPU utilisation and throughput and maximize turnaround time wasting time and response time.

    For Example:-

    SRT Scheduling:-

    Process

    Arrive Time

    Burst Time

    Turnaround Time

    P1

    0

    8

    8.0=8

    P2

    1

    4

    4-1=3

    P3

    2

    9

    9.2=7

    P4

    3

    5

    5-3=2

    Gantt Chart:-

    P1

    P2

    P4

    P1

    P3

     

    0

    1

    5

    10

    17

    26


     

    P1 is a started add time of as it is the only process in cube.

    Process P2 arrives at a time one and its breast time is 4 minutes.

    The first time is less than the remaining time for process P1 show processes P1 is preempted and P2 is scheduled.

    The process P3 arrives at time to it breast time is is 9 minutes which is a largest then remaining time for process P2 so P2 is not preempted.

    The Process P4 arrives at time 3:00 it rest time is 5 minute again it is large then the remaining time for process apitu apitu is not free

    After the Tramination off to the process with shortest next CPU burst for example process fifo is scheduled.

    After Process P4 processes P1 and then process P3 are scared you'll.

    Calculating The Average Waiting Time:-

    Waiting time For P1=10-1=9ms

    Waiting time For P2=1-1=0ms

    Waiting time For P3=17-2=15ms

    Waiting time For P4=5-3=2ms

    Average Waiting Time=

    9+0+15+2/4 = 26/4

    = 6.5 ms.

    Turn around time Average:-

    Turnaround time for P1=8

    Turnaround time for P2=3

    Turnaround time for P3=7

    Turnaround time for P4=2

    Average Turn around time:-

    2+3+7+2/4 = 20/4

    =5ms.

  7. Section-B


    5. Consider the following references string
    7, 0, 1, 2, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1
    How many page fault will occur for the FIFO page replacement algorithms and zooming 3 Fame? Does the page for rate always discoveries with increasing number of a frames?

    Answer:


     

    7

    0

    1

    2

    0

    3

    0

    4

    2

    3

    0

    3

    2

    1

    2

    0

    1

    7

    0

    1

    7

     

     

     

    7

    0

     

     

    7

    2

    1

     

    2

    0

    1

     

     

    2

    3

    1

     

    2

    3

    0

     

    4

    3

    0

     

    4

    2

    0

     

    4

    2

    3

     

    2

    2

    3

     

     

     

    0

    1

    3

     

    0

    1

    2

     

     

     

    7

    1

    2

     

    7

    0

    2

     

    7

    0

    1

     


     

    Page Forms

    15 page faults

    In FIFO, the page. Main Aur Main not increase as the page frame increases.

  8. 6.(a) A computer system has 36 bit virtual address space with a page size of 8k and each page table entry of 4 bytes. What will be number of pages in virtual address space what is the maximum size of addressable physical memory?

    Answer:

    A 36 bit address can address 2^36 BITS in a byte addressable machine. Since the size of a page 8k bytes(2^13) the number of addressable pages is2^36/2^13=2^23

    With 4 byte entries in the page table we can add reference 2^36 pages for stop since each page is 2^13 B long in maximum addressable physical memory size is 2^32*2^13=45 (assuming no protection bytes are used)

    1 level paying

    Since we have 2^ 23 pages in is virtual address space and we use 4 bytes per page page table entry the size of page table will be 2^23*2^2 = 2^ 25. This is / 256 of the process on memory space so it is a quiet costly.(32mb)

  9. (b) What are the necessary condition for deadlock to occur in a computer system? A cycle in wait for graph is necessary and sufficient condition for deadlock to occur comment.

    Answer:

    The four necessary conditions for deadlocks are are

    1. Mutual exclusion:- Mutual exclusion means that a resource can be added by only one process at a time poster for example if a process P1 locks there is resources R is exclusive Mod no other process can acquire the resource R. if another process request this resource the requesting process must be delayed until the resource has been released.

    2. Hold and wait:-The process involved the deadlock acquires at least one resource and wait for at least another resource that has been acquired by another process.

    3. No Pre-emption:-Resource held by a process cannot preempted full stop a resource can be released only voluntarily be the process of holding it, after that process has completed its task.

    4. Circular wait:- A circular chain or circular relationship existed among the process involved in deadlock. In such a chain each processor wait for a resources that is held by the next process in the chain.

    Wait for Graph:- it consist of the mode of vertices that represent various process full stop the weight graph has features

    1. It represent from Pi process to means that the process Pi is waiting for the resource that is held by Pj.

    2. An edge from two processes PJ means that a process is waiting for the resource that is held by process PJ.

    3. Wait for graph can be generated from resource allocation graph by removing the mode that represent the risk and the appropriate edges.

    4. An edge Pi Pj exist in wait for graph if the corresponding resource allocation graph contains towards pic and p q and r q and P J for some resource RQ.

    5. After generating a wait for graph does algorithm examine if for the existence of cycles.

    6. Does a deadlock exist in the system if and only if wait for graph contains a cycle.

    7. Complexity of algorithm which detects cycle in graph will be and to where is the number of nodes in the graph.

  10. 7.Describe the following

    (i) Logical and physical address
    (ii) Be lady's Anomaly
    (iii) Hit ratio
    (iv) Virtual memory concept
    (v) Page replacement algorithm

    Answer:

    (i) the address generated by CPU is known as logical address or virtual. Logical address is the address of an instruction or data as used by program. While writing a program a program referred to help with only logical address.

    The physical address is an address that is a scene by memory unit. Any location in main memory is uniquely identified by an address search address is called physical address and physical address is the effectively memory address of an instruction or data.

    (ii) In FIFO page replacement certain page reference pattern actually cause more page faults when the number of page frame allocated to a process is increased cost of this phenomena is called the Belady's Anomaluly.

    (iii) when page number is not present in tlb it is known as tlb MS. In such a case the page table is in order to obtain the frame number of that page number. If the page number is present in tlb to generate physical address. The percentage of time that a particular page number is found in the tlb called the hit ratio.

    (iv) virtual memory is a technique of evaluating program instruction that may not Jet eventually in the system memory. Virtual memory store instruction and data of a program in the secondary memory and to lead them in the main memory when they are required.

    (v) aap page replacement algorithm is the logic for the policy regarding how to select a page to be swapped out from the main memory to create space for the page that has cause a page fault.


  11. 8. (a)Distinguish between deadlock prevention and deadlock avoidance. How can computer system recover from deadlock if it is known to exist?

    Answer:

    The various strategies to handle deadlock are

    1. Deadlock prevention

    2. Deadlock avoidance

    3. Deadlock recovery

    4. Deadlock ignorance

    • Deadlock prevention:- Measure are taken so that the system does not go into deadlock condition in the first place. The deadlock invention technique prevent the evidence of at least one of the four conditions that cause deadlock.

    • Deadlock avoidance:- Deadlock avoidance before a process is allocated requested resources it is made sure that the request will not lead to deadlock.

    In order to decide whether the current request can be satisfied or must be delayed that system should consider the resource currently available the resource currently allocated to each process and the future request and releases of each process.

    • Deadlock recovery:-once the deadlock has been deleted in the system the system should now be recovered for this state

    There are two different methods

    1. Process termination

    2. Resource termination

    Process termination :- one way to recover from deadlock process and reclaim all the resources allocated to them.

    There are two approaches

    1. About all deadlock process.

    2. About one process at a time until the developed cycle is is eliminated.

    While selecting one of the deadlock process the fa aberration service factor must be kept in mind.

    1. Priority of the process.

    2. Amount of work already done by the process and amount of the work that is still to be done.

    3. That type and the number of resources the process has used.

    4. The number of resources that a process still need in order to complete.

    5. Whether the process is batch or interactive.


     

    Resource termination:- In this technique the summer resources are prompted from process and are given to other process till the deadlock cycle is broken.

    There are issue related to resource promotion:-

    1. Which resources and which processor should become the target of preemption .

    2. What should be done with preempted process

    3. How to ensure that starvation will not occur in the system.

  12. (b) What delay element are involved in desk read and write consider a desk view with request for input or output to blocks on following cylinders
    98, 183, 37, 122, 14, 124, 65, 67

    In that order if the head is entirely at cylinder 53 what will be the total head Movement in a serving all the requested if shortest seek time first scheduling algorithm is used?

    Answer:

    The figure Represent the SSTE for case

    Total head movements =(65-53)+(67-65)+(67-37)+(37-14)+(98+14)+(122-98)+(124+122)+(183-124)

    Total head movements=236 cylinders

    Average seek time = 236/8=29.5

    The

     

    Time Components

    Action

    1

    Seek time

    Time to move the read and right arm to correct cylinder.

    2

    Rotational delay

    Time it takes for the disk to rotate so that the Desire sector is under read and write head.

    3

    Transfer time

    Once read or write head is positioned then it take place.


     

  13. Section C

    9. (a) What information is stored in process control block?

    Answer:

    the various information that are stored by process control block

    1. Process ID or number

    2. Process state

    3. Process priority

    4. Pointer to Parent process

    5. Pointer to child process

    6. CPU registers

    7. Program counter

    8. Memory management information

    9. Input output state information

    10. File management information.

  14. (b) What is Kernel?

    Answer:

    Threads of process define by operating system itself called kernel thread. It is slow to create and manage as operating system manage them. This is used for internal working of operating system such as scheduling the user threads.

  15. (c) What is multitasking?

    Answer:

    A multitasking system is a single user can activate multiple program at the same time. Multitasking is a systems capability to on more than one process at the same time to stop it means that whatever a job need to program input output operation. The CPU can be used for executing some other job or process that is also residing in the system and is ready to use in the CPU.

  16. (d) What are the conditions of a deadlock?

    Answer:

    the necessary condition for a deadlock is

    1. Mutual exclution

    2. Hold and wait

    3. No promption

    4. Circular wait

  17. (e) What is the relationship between page and frames?

    Answer:

    Physical memory is divided into fixed size of block card frames and the logical memory is divided into 5 exercise blogger card page full stop a page Turner frame are recognised by unique number as page number and frame number respectively. Up a number form a part of logical address and a frame number from a part of physical address.

  18. (f) What are logical and physical pages?

    Answer:

    The address generated by the CPU is known as logical address for stock logical address is the address of an instruction or data as used by the program.

    The physical address is an address that is a seen by the memory unit any location in main memory is uniquely identified by an address. Such as address is called physical address.

  19. (g) What is virtual memory?

    Answer:

    Virtual memory is a technique of executing program instructions that may not fit entirely in system memory. Natural memory store instruction bi data of a program in the secondary memory and to land them in the main memory when they are required.

  20. (h) What is deadlock avoidance?

    Answer:

    In deadlock avoidance before a process is a located requested resources for stop it is made sure that the request will not lead to deadlock. In order to decide whether the current request can be satisfied or must be delayed. The system should consider the resource currently available, resource currently allocated to each process the future request and release of each process.

  21. (i) What is virtual exclusion condition of deadlock?

    Answer:

    The means of that a resource can be used by only one process at a time. If any process request this resource the requesting process must be delayed until the resource has been released.

  22. (j) What is based segmentation?

    Answer:

    Segmentation can be combined with paging to provide another memory management themes. The efficiency of paging is combined with the protection be share capability of segmentation.