0% found this document useful (0 votes)
85 views99 pages

OSY-EPA With Solution

Uploaded by

jadhavayush590
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views99 pages

OSY-EPA With Solution

Uploaded by

jadhavayush590
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 99

Examination Paper Analysis (Operating System-22516)

Sr. Summer-2024 Winter-2023 Summer-2023 Winter-2022 Summer-2022 Winter-2019


Name of Topic
No. Question Marks Question Marks Question Marks Question Mark Question Mark Questions Marks
1 (a) 2 1 (a) 2 1 (a) 2
1 (a) 2 1 (a) 2 1 (a) 2
4 (a) 4 2 (a) 4 1 (b) 2
Overview of Operating 2 (a) 4 2 (a) 4 2 (a) 4
1 4 (a) 4 3 (a) 4
System 4 (a) 4 4 (a) 4
4 (a) 4
Total 06 Total 10 Total 12 Total 10 Total 10 Total 6
1 (b) 2 1 (b) 2 1 (c) 2
1 (b) 2 1 (b) 2 1 (b) 2
2 (a) 4 2 (b) 4 2 (a) 4
Services and 2 (b) 4 2 (b) 4 2 (b) 4
2 (b) 4 3 (a) 4 3 (b) 4
2 Components of OS 4 (b) 4 4 (b) 4 4 (b) 4
4 (b) 4 4 (b) 4 5 (c) 6
5 (a) 6 5 (b) 6 5 (a) 6
5 (a) 6 5 (a) 6
Total 20 Total 20 Total 16 Total 16 Total 16 Total 16
1 (c) 2 1 (c) 2 2 (b) 4 1 (c) 2 1 (c) 2 1 (c) 2
2 (c) 4 1 (f) 2 3 (c) 4 1 (f) 2 1 (f) 2 1 (f) 2
3 (a) 4 2 (c) 4 4 (b) 4 2 (c) 4 2 (c) 4 2 (c) 4
4 (c) 4 4 (c) 4 5 (a) 6 3 (a) 4 3 (a) 4 3 (a) 4
3 Process Management 5 (b) 6 5 (b) 6 4 (c) 4 4 (c) 4 4 (a) 4
5 (b) 6 6 (a) 6 4 (c) 4
4 (e) 4
5 (b) 6
Total 20 Total 18 Total 18 Total 22 Total 22 Total 30
1 (d) 2 1 (d) 2 1 (d) 2 1 (d) 2 1 (d) 2 1 (d) 2
2 (d) 4 2 (d) 4 2 (c) 4 2 (d) 4 2 (d) 4 2 (d) 4
CPU Scheduling and 3 (b) 4 3 (b) 4 4 (c) 4 3 (b) 4 3 (c) 4 3 (b) 4
4
Algorithms 4 (d) 4 4 (d) 4 5 (b) 6 4 (d) 4 4 (d) 4 4 (d) 4
6 (a) 6 6 (a) 6 6 (c) 6 6 (a) 6 5 (a) 6 6 (a) 6
Total 20 Total 20 Total 22 Total 20 Total 20 Total 20
1 (e) 2 1 (e) 2 1 (e) 2 1 (e) 2
1 (e) 2 1 (e) 2
3 (c) 4 3 (c) 4 1 (g) 2 3 (c) 4
3 (c) 4 3 (b) 4
4 (e) 4 4 (e) 4 2 (d) 4 5 (c) 6
4 (e) 4 4 (e) 4
5 Memory Management 5 (c) 6 5 (c) 6 4 (d) 4 6 (b) 6
5 (c) 6 5 (c) 6
6 (b) 6 6 (b) 6 4 (e) 4
6 (b) 6 6 (b) 6
6 (b) 6
Total 22 Total 22 Total 22 Total 22 Total 22 Total 18
1 (g) 2 1 (g) 2 1 (f) 2
1 (g) 2 1 (g) 2 1 (g) 2
1 (f) 2 3 (d) 4 3 (d) 4
File Management 3 (d) 4 3 (d) 4 3 (d) 4
6 3 (d) 4 6 (c) 6 6 (a) 6
6 (c) 6 5 (a) 6 6 (c) 6
6 (c) 6
Total 14 Total 12 Total 12 Total 12 Total 12 Total 12
Examination Paper Analysis (Operating System-22516)

Exam Unit No and Question Number as per MSBTE paper Marks


Year Name
Summer- Unit 1- Q1 a List different types of operating system 2
2024 Overview of Q2 a Explain Resource management of an operating system. 4
Operating Q4 a Compare between Time sharing operating system and multiprogramming operative system. 4
System
Winter- Unit 1- Q1 a Define Real Time Operating System, along with any two application of it. 2
2023 Overview of Q2 a Describe multiprocessor OS with its advantages (any two) 4
Operating Q4 a Compare between CLI and GUI based OS (any four points) 4
System
Summer- Unit 1- Q1 a State any two features of Linux 2
2023 Overview of Q1 b Difference between Time Sharing system and Real Time System (any two points) 2
Operating Q3 a Describe multiprocessor OS with its advantages (any two) 4
System Q4 a Explain Real Time OS. Explain its types 4
Winter- Unit 1- Q1 a Differentiate between Multi programmed and Multi-tasking operating system (Any two points). 2
2022 Overview of Q2 a Explain Time sharing O.S. 4
Operating Q4 a Compare between command line and Graphical user interface.(Any four points) 4
System
Summer- Unit 1- Q1 a State and describe any two advantages of multiprocessor system. 2
2022 Overview of Q2 a Describe working of time sharing system with neat diagram. 4
Operating Q4 a Differentiate between command line based operating system and GUI based operating system (Any 4
System four points)
Winter- Unit 1- Q1 a Define real time operating system. List any four applications of it. 2
2019 Overview of Q2 a Enlist types of operating system. Explain multiprogramming OS in detail. 4
Operating
System
Summer- Unit 2- Q1 b State any four services provided by an operating system 2
2024 Services and Q2 b Explain different components of operating system. 4
Components Q4 b Explain any four types of system call. 4
of OS Q5 a Explain the use of following OS tools: i) Device Manager ii) Task Scheduler 6

Winter- Unit 2- Q1 b List any four services provided by operating system 2


2023 Services and Q2 b Write down the responsibility of the following components of OS: a) Memory Management b) File 4
Components management 4
of OS Q4 b What are the different types of system calls? Give examples of each
Q5 a Write two uses of the following operating system tools: 1) Security Policy 2) User Management 6
3) Performance Monitor
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question Number as per MSBTE paper Marks
Year Name
Summer- Unit 2- Q1 c State any four services of Operating System 2
2023 Services and Q2 a Explain different types of system calls 4
Components Q3 b Explain different components of Operating System 4
of OS
Winter- Unit 2- Q1 b List any four services provided by O.S. 2
2022 Services and Q2 b Describe any two components of O.S. 4
Components Q4 b Write any four system call related to file management. 4
of OS Q5 a Write two uses of following O.S. tools – (i) Device Management (ii) Performance monitor (iii) Task 6
Scheduler
Summer- Unit 2 - Q1 b State any four types of system calls. 2
2022 Services and Q2 b List and describe any four services of operating system. 4
Components Q4 b Describe various activities performed by following operating system components. i) Main memory 4
of OS management ii) File management
Q5 b Describe with example, use of following tools: i) Device Management ii) Performance monitor iii) Task 6
scheduler
Winter- Unit 2 - Q1 b Explain any 4 services provided by OS. 2
2019 Services and Q2 b List components of OS. Explain process management in detail. 4
Components Q4 b What is purpose of system call? State any two system calls with their functions. 4
of OS Q5 a Enlist the operating system tools. Explain any two in detail. 6
Q5 c Write two uses of following operating system tools: a) Security policy b) User management c)Task 6
Scheduler
Summer- Unit 3- Q1 c Draw process state diagram 2
2024 Process Q2 c Describe message passing system of interprocess communication (IPC) 4
Management Q3 a Define Process. Draw a Process Control Block and explain the information in PCB 4
Q4 c Describe how context switch is executed by operating system 4
Q5 b Explain user level thread and Kernel level thread with its advantages and disadvantages 6
Winter- Unit 3- Q1 c Draw neat labelled process state diagram along with the correct directions of arrows 2
2023 Process Q1 f What is the use of ps command? Write long form of UID, PID in the output of this command 2
Management Q2 c Explain shared Memory Method of IPC using neat labelled diagram 4
Q3 a Explain following commands with their syntax: 1) kill 2) sleep 3) wait 4) exit 4
Q4 c Explain working of CPU switch from process to process with neat labelled diagram 4
Q5 b Differentiate between process and thread (any two points) also discuss the benefits of multithreading 6
programming

Summer- Unit 3- Q2 b Draw and explain process control block in detail 4


2023 Process Q3 c Explain different types of Schedulers 4
Management Q4 b Draw Process State Diagram and describe each state. 4
Q5 a Explain working of Inter-process communication considering a) Shared Memory b) Message Passing 6
Winter- Unit 3- Q1 c Define: Process, PCB. 2
2022 Process Q1 f Write syntax of following commands - (i) Kill (ii) Sleep 2
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question Number as per MSBTE paper Marks
Year Name
Management Q2 c Explain shared memory model of Inter-process communication (IPC). 4
Q3 a Draw and explain process state diagram. 4
Q4 c Compare between Long term and short term scheduler. (Any four points) 4
Q5 b Writer the outputs of following commands (i) Wait 2385018 (ii) Sleep 09 (iii) PS –u Asha 6
Summer- Unit 3- Q1 c Draw a neat labelled diagram for process state. 2
2022 Process Q1 f Give commands to perform following tasks: i) To add delay in script ii) To terminate a process 2
Management Q2 c Differentiate between shared memory system and message passing system of inter-process 4
communication. 4
Q3 a Describe use of ps and wait commands with suitable example. 4
Q4 c With suitable diagram, describe use of scheduling queues in process scheduling. 6
Q6 a Describe one-to-one multithreading model with suitable diagram. Also write any two advantages of
one-to-one model over many-to-one model.
Winter- Unit 3- Q1 c Draw process state diagram. 2
2019 Process Q1 f Write syntax of following commands: (i) Sleep (ii) Kill 2
Management Q2 c With neat diagram explain inter process communication model. 4
Q3 a Explain ‘PS’ command with any four options. 4
Q4 a Write unix command for following: (i) Create a folder OSY (ii) Create a file FIRST in OSY folder 4
(iii) List / display all files and directories. (iv) Write command to clear the screen
Q4 c State and describe types of scheduler. 4
Q4 e Explain PCB with diagram. 4
Q5b Explain multithreading model in detail. 6
Summer- Unit 4- Q1 d State two features of non-preemptive scheduling 2
2024 CPU Q2 d What is CPU Scheduler? Explain the preemptive and non-preemptive type of scheduling 4
Scheduling Q3 b Define deadlock. State the conditions necessary for deadlock 4
and Q4 d Compare Short Job First (SJF) and Shortest Remaining Time (SRTN) scheduling algorithm (any four 4
Algorithms points)
Q6 a What is the average turnaround time for the following process using : i) FCFS scheduling algorithm ii) 6
SJF non preemptive scheduling algorithm iii) Round Robin Scheduling algorithm

Winter- Unit 4- Q1 d Define CPU bound program and I/O bound program 2
2023 CPU Q2 d Explain following terms w.r.t. Scheduling: a) CPU Utilization b) Throughput c) Turn around time 4
Scheduling d) Waiting time
and Q3 b What is deadlock? Discuss any one method of deadlock prevention 4
Algorithms Q4 d Solve given problem bys using FCFS scheduling algorithm. Draw correct Gantt Chart and calculate
average waiting time and average turn around time
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question Number as per MSBTE paper Marks
Year Name
Process Arrival Time Burst Time (in ms)
P0 0 10
P1 1 29
P2 2 3
P3 3 7
P4 4 12
Q6 a How pre-emptive scheduling is better than non-preemptive scheduling by solving following problem 6
using SJF (solve it by using pre-emptive SJF and non-pre-emptive SJF also)
Process Arrival Time Burst Time (in ms)
P1 0 8
P2 1 4
P3 2 9
P4 3 5
Summer- Unit 4- Q1 d Write the difference between preemptive and non-preemptive scheduling 2
2023 CPU Q1 g Define Deadlock 2
Scheduling Q2 c State and explain four scheduling criteria 4
and Q4 c Describe any four condition for deadlock 4
Algorithms Q4 d Explain fixed and variable memory management 4
Q5 b With neat diagram explain multilevel queue scheduling 6
Q6 c Consider the four processes P1, P2, P3 and P4 with length of CPU burst time. Find out Average
waiting time and Average Turn-around time for the following algorithms
1) FCFS 2) RR (Slice: 4ms) 3) SJF
Process Arrival Time Burst Time (in ms)
P1 0 8
P2 1 4
P3 2 9
P4 3 5
Winter- Unit 4- Q1 d Define CPU and I/O burst cycle. 2
2022 CPU Q2 d Describe different scheduling criteria. 4
Scheduling Q3 b Describe conditions for deadlock prevention. 4
and Q4 d Solve given problem by using SJF and FCFS scheduling algorithm using Gantt chart. Calculate the 4
Algorithms average waiting time for each algorithm.
Process Burst Time (in ms)
P1 9
P2 7
P3 3
P4 7
Q6 a Solve given problem by using (i) Pre-emptive SJF (ii) Round Robin (Time Slice = 3 ms) Calculate 6
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question Number as per MSBTE paper Marks
Year Name
average waiting time using Gantt Chart.
Process A.T B. T. (in ms)
P11 0 8
P12 1 4
P13 2 9
P14 3 5
Summer- Unit 4- Q1 d State difference between preemptive scheduling and non-preemptive scheduling. 2
2022 CPU Q2 d State and describe any two scheduling criteria. 4
Scheduling Q3 b Describe prevention of deadlock occurrence with respect to hold and wait necessary condition. 4
and Q4 d Write steps required for Banker’s algorithm to avoid deadlock. 4
Algorithms Q5 a Calculate average waiting time for following data using First Come First Served (FCFS) and Shortest 6
Job First (SJF) algorithms.
Process A.T B. T. (in ms)
P0 0 8
P1 1 4
P2 2 5
P3 3 3

Winter- Unit 4- Q1 d Explain any four scheduling criteria. 2


2019 CPU Q2 d Describe I/o burst and CPU burst cycle with neat diagram. 4
Scheduling Q3 b Explain deadlock? What are necessary conditions for deadlock? 4
and Q4 d Explain Round Robin algorithm with suitable example. 4
Algorithms Q6 a The jobs are scheduled for execution as follows 6
Process A.T B. T. (in ms)
P1 0 7
P2 1 4
P3 2 10
P4 3 6
P5 4 8
Solve the problem using: (i) SJF (ii) FCFS Also find average waiting time using Gantt chart.
Summer- Unit 5- Q1 e Define following terms:i. Memory compaction ii. Fragmentation 2
2024 Memory Q3 c Explain the following terms with respect to memory management: i) Dynamic relocation ii) Swapping 4
Management Q4 e Describe variable partitioning with the help of suitable example 4
Q5 c Consider the string: 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7 with frame size 3 and 4, calculate page 6
fault in both the cases using FIFO algorithm
Q5 b Explain bit map vector and linked list free space management techniques with its advantages and 6
disadvantages
Winter- Unit 5- Q1 d Define Paging and Segmentation 2
2023 Memory Q3 c Describe concept of free space management techniques using bit map method 4
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question Number as per MSBTE paper Marks
Year Name
Management Q4 e Which hole is taken for next segment request for 8KB in a swapping system for First fit, Best fit and 4
Worst fit.
OS
4 KB
9 KB
20 KB
16 KB
8 KB
2 KB
6 KB
Q5 c Find out the total number of Page faults using: 1) Least recently used page replacement 2) Optimal 6
page replacement. Page replacement algorithms of memory management, if the page are coming in the
order 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1
Q6 b List free space management technique with the help of neat diagram, explain any one technique in 6
detail
Summer- Unit 5- Q1 e Define following terms: 1) Virtual Memory 2) Paging 2
2023 Memory Q2 d Define Fragmentation? Explain internal and external fragmentation 4
Management Q4 d Differentiate between Paging and Segmentation (any four points) 4
Q6 b for the page reference string: 7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1 Calculate the page faults applying 6
a) Optimal b) LRU c)FIFO page replacement algorithms for a memory with three frames.
Winter- Unit 5- Q1 e Differentiate between paging and segmentation. 2
2022 Memory Q3 c Explain fixed size memory partitioning. 4
Management Q4 e Describe free space management technique. (Any two). 4
Q5 c Given a page reference string with three (03) page frames. Calculate the page faults with ‘Optimal’ and 6
‘LRU’ Page replacement algorithm respectively. 7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1
Q6 b Consider the following memory map and assume a new process P4 comes with memory requirements 6
of 6 KB. Locate (Draw) this process in memory using. (i) First fit (ii) Best Fit (iii) Worst fit
OS
P1
<FREE> 12 KB
P2
<FREE> 19 KB
P3
<FREE> 7 KB
Memory
Summer- Unit 5- Q1 e Define the term fragmentation in terms of memory. 2
2022 Memory Q3 c With suitable diagram, describe the concept of variable partitioning of memory. 4
Management Q4 e With suitable example, describe any one free space management technique. 4
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question Number as per MSBTE paper Marks
Year Name
Q5 c Describe the concept of virtual memory with respect to paging. Also draw paging hardware diagram 6
and describe its working with example.
Q6 b Consider the following page reference string arrival with three page frames:-5, 6, 7, 8, 9, 7, 8, 5, 9, 7, 6
8, 7, 9, 6, 5,6 Calculate number of page faults with optimal and FIFO (First In First Out) page replacement
algorithms.
Winter- Unit 5- Q1 e Define virtual memory. 2
2019 Memory Q3 c Explain partitioning and its types. 4
Management Q5 c Explain LRU page replacement algorithm for following reference string. 6
70120304230321201701 Calculate the page fault.
Q6 b List free space management techniques? Describe any one in detail. 6
Summer- Unit 6- Q1 f Write syntax of PWD command and explain its use with the help of suitable example. 2
2024 File Q1 g List any four file operations. 2
Management Q3 d With suitable diagram, explain how contiguous file allocation is performed? 4
Q6 c Explain with diagram single level directory structure and two level directory structure with its 6
advantages and disadvantages.
Winter- Unit 6- Q1 g List any four file operations 2
2023 File Q3 d Draw the diagram of linked file allocation method and explain it 4
Management Q6 c Draw and explain directory structure of a file systemin terms of single level, two level and tree 6
structure.
Summer- Unit 6- Q1 f List any four file attributes and its meaning 2
2023 File Q3 d Explain two level directory structure with suitable diagram 4
Management Q6 a List file allocation method and explain any one in details 6
Winter- Unit 6- Q1 g List any four file operations. 2
2022 File Q3 d Explain linked file allocation method. 4
Management Q6 c Construct and explain directory structure of a file system in terms of two level and tree structure. 6
Summer- Unit 6- Q1 f List any four operations performed on a file. 2
2022 File Q3 d Describe linked file allocation method with suitable example. Also list its one advantage. 4
Management Q5 a Describe following directory structures in short with neat sketches: i) Single level ii) Two level iii) Tree 6
structured
Winter- Unit 6- Q1 g Describe any four file attributes. 2
2019 File Q3 d Describe sequential and direct access method. 4
Management Q6 c Enlist different file allocation methods? Explain contiguous allocation method in detail. 6
Examination Paper Analysis (Operating System-22516)

Exam Unit No and Question no as per MSBTE paper Marking


Year Name Scheme
Unit 1- Q1 a List different types of operating system 2
Summer- Overview of Answer:
2024 Operating • Batch Operating System
System • Multi-Programming Operating System
• Time Shared Operating System
• Multiprocessor System
• Distributed System
• Real Time Operating System
• Mobile Operating System
Q2 a Explain Resource management of an operating system. 4
Answer
• Resource Management in Operating System is the process to manage all the resources efficiently
like CPU, memory, input/output devices, and other hardware resources among the various
programs and processes running in the computer.
• Computer's resources are limited and several users or programs may need to utilize the same
resources—such as memory and CPU—at the same time.
• Operating system has to manage and ensure that all processes get the resources they need to
execute, without any problems like deadlocks.
• Operating systems use various scheduling algorithms to ensure that each process gets its fair
share of CPU time.
• Operating systems use virtual memory techniques to manage memory efficiently.
• Operating systems use file system management techniques to manage disk space efficiently.
• File system management allows the operating system to create, delete, and modify files and
directories in Secondary Storage Device.
• Operating systems use various network management techniques to manage network bandwidth
efficiently.
Q4 a Compare between Time sharing operating system and multiprogramming operative system. 4
Time-Sharing OS Multi-programming OS
In this time sharing Operating system many Multiprogramming operating system allows to
users/processes are allocated with computer execute multiple processes by monitoring their
resources in respective time slots. process states and switching in between
processes.
Processors time is shared with multiple users Processor and memory underutilization problem is
that’s why it is called as time sharing operating resolved and multiple programs runs on CPU that’s
system. why it is called multiprogramming.
In this process, two or more users can use a In this, the process can be executed by a single
processor in their terminal. processor.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Time sharing OS has fixed time slice. Multi-programming OS has no fixed time slice.
Time sharing system minimizes response time. Multiprogramming system maximizes processor
use.
Example: Windows NT. Example: Mac OS.
Winter- Unit 1- Q1 a Define Real Time Operating System, along with any two application of it. 2
2023 Overview of Answer:
Operating Real-time operating systems (RTOS) are used in environments where a large number of events, mostly
System external to the computer system, must be accepted and processed in a short time or within certain
deadlines. A real-time operating system (RTOS) is a special kind of operating system designed to handle
tasks that need to be completed quickly and on time.
Applications:
• Industrial control
• Telephone switching equipment
• Flight control
• Missile Guidance
• Medical Imaging System
• Traffic Manipulation Gadget
• Autopilot Travel Simulator
Q2 a Describe multiprocessor OS with its advantages (any two) 4
Answer: Refer Q3 a of Summer 2023
Q4 a Compare between CLI and GUI based OS (any four points) 4
Answer: Refer Q4 a of Winter 2022
Summer- Unit 1- Q1 a State any two features of Linux 2
2023 Overview of Answer:
Operating • Multiuser capability: Multiple users can access the same system resources like memory, hard disk,
System etc. But they have to use different terminals to operate.
• Multitasking: More than one function can be performed simultaneously by dividing the CPU time
intelligently.
• Portability: Portability doesn't mean it is smaller in file size or can be carried in pen drives or
memory cards. It means that it support different types of hardware.
• Security: It provides security in three ways namely authenticating (by assigning password and login
ID), authorization (by assigning permission to read, write and execute) and encryption (converts file
into an unreadable format).
• Live CD/USB: Almost all Linux distros provide live CD/USB so that users can run/try it without
installing it.
• Graphical User Interface (X Window system): Linux is command line based OS but it can be
converted to GUI based by installing packages.
• Support's customized keyboard: As it is used worldwide, hence supports different languages
keyboards.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
• Application support: It has its own software repository from where users can download and install
many applications.
• File System: Provides hierarchical file system in which files and directories are arranged.
• Open Source: Linux code is freely available to all and is a community based development project.
Q1 b Difference between Time Sharing system and Real Time System (any two points) 2
Real Time System Time Sharing System
In real time system, a job has to be completed In time sharing system, fixed time is given to each
within fixed deadline (time allowed). process and all the processes are arranged in a
queue.
A real-time system has well-defined, fixed time It requires more complicated CPU scheduling
constraints. algorithms.
If job is not completed within the given time then If job is not completed within the given time, then it
system may extend time for doing the operations. jumps to the next job leaving the previous job
unfinished. After processing to each job, it again give
the same time for unfinished job.
Response time is important Response time is not important.
Process deals with single application at a time. Process deals with more than one application
simultaneously.
It focuses on accomplishing a computational Emphasis on providing a quick response to a
task before its specified deadline. request.

Q3 a Describe multiprocessor OS with its advantages (any two) 4


Answer:
A multiprocessing operating system is defined as a type of operating system that makes use of more than
one CPU to improve performance. Multiple processors work parallelly in multi-processing operating
systems to perform the given task. All the available processors are connected to peripheral devices,
computer buses, physical memory, and clocks. The main aim of the multi-processing operating system is to
increase the speed of execution of the system. The use of a multiprocessing operating system improves
the overall performance of the system.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Advantages of Multiprocessor Systems:
• It increased throughput: by increasing the number of processors, more work done in a shorter period of
time.
• Multiprocessors can also save money compared to multiple single systems. Because the processors can
share peripherals cabinets and power supplies.
• It increases reliability: if functions can be distributed properly among several processors, then the failure
of one processor will not halt the system, but rather will only slow it down.
• Minimum hardware required.
• Higher performance due to parallel processing.
Q4 a Explain Real Time OS. Explain its types 4
Answer:
A real-time operating system (RTOS) is a special-purpose operating system used in computers that has
strict time constraints for any job to be performed. It is employed mostly in those systems in which the
results of the computations are used to influence a process while it is executing. Whenever an event
external to the computer occurs, it is communicated to the computer with the help of some sensor used to
monitor the event. The sensor produces the signal that is interpreted by the operating system as an
interrupt. On receiving an interrupt, the operating system invokes a specific process or a set of processes
to serve the interrupt.
Types of Real time OS

Hard Real-Time operating system: In Hard RTOS, all critical tasks must be completed within the
specified time duration, i.e., within the given deadline. Not meeting the deadline would result in critical
failures such as damage to equipment or even loss of human life. Consider an on-stock trading software. If
someone wants to sell a particular share, the system must ensure that command is performed within a
given critical time. Otherwise, if the market falls abruptly, it may cause a huge loss to the trader.

Soft Real-Time operating system: Soft RTOS accepts a few delays via the means of the Operating
system. In this kind of RTOS, there may be a closing date assigned for a particular job, but a delay for a
small amount of time is acceptable. So, cut off dates are treated softly via means of this kind of RTOS. For
Example, This type of system is used in Online Transaction systems and Livestock price quotation
Systems.

Firm Real-Time operating system: In Firm RTOS additionally want to observe the deadlines. However,
lacking a closing date might not have a massive effect, however may want to purposely undesired effects,
like a massive discount within the fine of a product. For Example, this system is used in various forms of
Multimedia applications.
Winter- Unit 1 Q1 a: Differentiate between Multi programmed and multi-tasking operating system (Any two points). 2M
2022 Overview of Answer:
Operating
System
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Multiprogramming Multi-tasking
It includes the single CPU to execute the program. It uses multiple tasks for the task allocation. Any two
Concept of Context Switching is used. Concept of Context Switching and Time Sharing relevant
is used. points,
Switching occurs when the process currently Switching occurs after the time slice of the 1M each
running stops. current process is finished.
Multi-programming increases CPU utilization by In multi-tasking also increases CPU utilization
organizing jobs . and it also increases responsiveness.
The idea is to reduce the CPU idle time for as The idea is to further extend the CPU Utilization
long as possible. concept by increasing responsiveness Time
Sharing.
It uses job scheduling algorithms so that more Time sharing mechanism is used so that
than one program can run at the same time. multiple tasks can run at the same time.
Execution of process takes more time. Execution of process takes less time.
Q2 a :Explain Time sharing O.S. 4M
Answer:

Relevant
Explanation
4M

Figure of time-sharing system


1) In time sharing system, the CPU executes multiple jobs by switching among them.
2) The switches occur so frequently that the users can interact with each program while it is running.
3) It includes an interactive computer system which provides direct communication between the user
and the system.
4) A time-sharing system allows many users to share the computer resources simultaneously.
5) The time-sharing system provides the direct access to many users where CPU time is divided
among all the users on scheduled basis.
6) The operating system allocates a time slice to each user.
7) When this time is expired, it passes control to the next user on the system.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
8) The time allowed is extremely small and the users are given the impression that each of them has
their own CPU and they are the sole owner of the CPU.
9) In this time slice each user gets attention of the CPU.
Q4 a: Compare between command line and Graphical user interface.(Any four points) 4M
Answer:
Parameter Command Line Interface(CLI) Graphic User Interface(GUI)
Any four
Definition Interaction is by typing commands Interaction with devices is by graphics and points 1M
visual components and icons each
Understanding Commands need to be memorized Visual indicators and icons are easy to
understand
Memory Less memory is required for storage More memory is required as visual
components are involved.
Working Use of keyboard for commands makes Use of mouse for interaction makes it slow
Speed CLI quicker.
Resources Only keyboard Mouse and keyboard both can be used
used
Accuracy High Comparatively low
Flexibility Command line interface does not Structure and design can change with
change, remains same over time updates
Summer- Unit 1 Q1 a :State and describe any two advantages of multiprocessor system. 2M
2022 Answer:
Overview of Advantages of multiprocessing operating system are: Any two
Operating • Increased reliability: Due to the multiprocessing system, processing tasks can be distributed Correct
System among several processors. This increases reliability as if one processor fails; the task can be given Advantages
to another processor for completion. 1M each
• Increased throughout: As several processors increase, more work can be done in less
• The economy of Scale: As multiprocessors systems share peripherals, secondary storage
devices, and power supplies, they are relatively cheaper than single-processor systems.
Q2 a: Describe working of time-sharing system with neat diagram 4M
Answer: Refer Q2 a of Winter 2022
Q4 a: Differentiate between command line based operating system and GUI based operating system 2M
(Any four points)
Answer: Refer Q4 a of Winter 2022
Winter- Unit 1 Q1 a : Define real time operating system. List any four applications of it. 2M
2019 Overview of Answer:
Operating
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
System Real time Operating System: A real time system has well defined fixed time constraints. Processing 1M
should be done within the defined constraints -Hard and Soft real time system. Definition
OR 1 M for any
The real-time operating system used for a real-time application means for those applications where data 4
processing should be done in the fixed and small quantum of time. correct
Types of real time operating system applications
1. Hard real-time
2. Soft real-time
Applications:
1. Flight Control System
2. Simulations
3. Industrial control
4. Military applications
Q3 b : Enlist types of operating system. Explain multiprogramming OS in detail. 2M
Answer:
Types of operating system
1. Batch Systems 1M
2. Multiprogramming Listing
3. Multitasking 1M
4. Time-Sharing Systems Diagram
5. Desktop Systems 2M
6. Distributed system Explanation
7. Clustered system
8. Real Time system

Multiprogramming:

OR
Figure of multiprogramming system
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
1. In multiprogramming, more than one program lies in the memory.
2. The scheduler selects the jobs to be placed in ready queue from a number of programs.
3. The ready queue is placed in memory and the existence of more than one program in main
memory is known as multiprogramming.
4. Since there is only one processor, there multiple programs cannot be executed at a time.
5. Instead, the operating system executes part of one program, then the part of another and
so on.
6. Example of multiprogramming: user can open word, excel, access and other applications in
a system.

Summer- Unit 2- Q1 b State any four services provided by an operating system 2


2024 Services and Answer:
Components • User Interface
of OS • Program Execution
• I/O Operation
• File System Manipulation
• Communication
• Error Detection
• Resource Allocation
• Accounting
• Protection and Security
Q2 b Explain different components of operating system. 4
Answer:
List of System Components:
1. Process Management
2. Main Memory Management
3. File Management
4. I/O System Management
5. Secondary Storage Management

1.Process Management: A program is a set of instructions. When CPU is allocated to a program, it can
start its execution. A program in execution is a process. A word processing program run by a user on a PC
is a process. A process needs various system resources including CPU time, memory, files and I/O devices
to complete the job execution. These resources can be given to the process when it is created or allocated
to it while it is running. The operating system responsible for the following activities in connection with
process management:
• Creation and deletion of user and system processes.
• Suspension and resumption of processes.
• A mechanism for process synchronization.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
• A mechanism for process communication.
• A mechanism for deadlock handling.

2. Main-Memory Management Main memory is a large array of words or bytes, ranging in size from
hundreds of thousands to billions. Each word or byte has its own address. Main memory is a repository of
quickly accessible data shared by the CPU and I/O devices. The central processor reads instructions from
main memory during the instruction fetch cycle and both reads and writes data from main memory during
the data fetch cycle. The main memory is generally the only large storage device that the CPU is able to
address and access directly. The operating system responsible for the following activities in connection
with main memory s management:
• Keeping track of which parts of memory are currently being used and by whom.
• Deciding which processes (or parts thereof) and data to move into and out of memory.
• Allocating and deallocating memory space as needed.

3. File Management
A file is a collected of related information defined by its creator. Computers can store files on the disk
(secondary storage), which provide long term storage. Some examples of storage media are magnetic
tape, magnetic disk and optical disk. Each of these media has its own properties like speed, capacity, and
data transfer rate and access methods. A file system normally organized into directories to ease their use.
These directories may contain files and other directions.
The operating system responsible for the following activities in connection with file management:
• The creation and deletion of files.
• The creation and deletion of directions.
• The support of primitives for manipulating files and directions.
• The mapping of files onto secondary storage.
• The backup of files on stable storage media.

4. I/O device Management Input / Output device management provides an environment for the better
interaction between system and the I/O devices (such as printers, scanners, tape drives etc.). To interact
with I/O devices in an effective manner, the operating system uses some special programs known as
device driver. The device drivers take the data that operating system has defined as a file and then
translate them into streams of bits or a series of laser pulses (in regard with laser printer). The I/O
subsystem consists of several components:
• A memory management component that includes buffering, caching, spooling
• A general device driver interface
• Drivers for specific hardware devices

5. Secondary-Storage Management The computer system provides secondary storage to back up main
memory. Secondary storage is required because main memory is too small to accommodate all data and
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
programs, and the data that it holds is lost when power is lost. Most of the programs including compilers,
assemblers, word processors, editors, and formatters are stored on a disk until loaded into memory.
Secondary storage consists of tapes drives, disk drives, and other media. The operating system is
responsible for the following activities in connection with disk management:
• Free space management
• Storage allocation
• Disk scheduling.
Q4 b Explain any four types of system call. 4
Answer:
1. Process and Job Control
• A running program needs to be able to halt its execution either normally (end) or abnormally
(abort). If the program discovers an error in its input and wants to terminate abnormally, it may also
want to define an error level.
• A process or job executing one program may want to load and execute another program. This
allows the control card interpreter to execute program as directly by the control cards of the user
job. If we create a new job or process, we should able to control its execution.
• We may also want to terminate a job or process that we created (terminate process). If we find that
it is incorrect or no longer needed we need waiting time to finish execution (wait time). Another set
of system calls are helpful in debugging a program.
Example of Process related system call:
a. End, Abort.
b. Load, Execute.
c. Create process, Terminate process.
d. Ready process, Dispatch process.
e. Suspend process, Resume process.
f. Get process attributes, Set process attributes.
g. Wait for Time.
h. Wait event, Signal event.
i. Change priority of process.

2. File Management
• We can identify several common system calls dealing with files. We first need to be able to create
and delete files such a system call requires the name of the file and perhaps some of its attributes.
• Once, the file is created, we need to open it and use it. We may also read, write and reposition.
Finally we need to close the file, indicating that we are no longer using it.
Example of file related system call:
a. Create file, Delete file
b. Open a file, Close a file.
c. Create directory.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
d. Read, Write, Reposition.
e. Get file attributes, Set file attributes.
f. Create a link.
g. Change working directory.

3. Device Management
• Files can be thought of as abstract or virtual devices. Thus manyof the system calls for files are
also needed for devices.
• If there are multiple users of the system however we must first request the device to ensure that we
have exclusive use of it. After we are finished with the device, we must release it. These functions
are similar to the open/close system calls for files.
• Once, the device has been requested we can read, write and reposition the device just as with
files.
System call related to device management:
a. Request device, Release device.
b. Read, Write, Reposition.
c. Get device attributes, set device attributes.

4. Information Maintenance
• Many system calls exist simply for the purpose of transferring information between the user
program and the operating system. For example most systems have a system call to return the
current time and date.
• Other system calls may return information about the system such as the number of current users,
the version number of the operating system, the amount of free memory or disk space and so on.
• In addition the operating system keeps information about all of its jobs and processes and there are
system calls to access this information. Generally, there are also calls to reset it. (get process
attributes and set process attributes).
Information Maintenance related system call:
a. Get Time or Date, Set Time or Date.
b. Get system Data, Set system Data.
c. Get process, File or Device attributes.
d. Set process, File or Device attributes.

5. Communication
• There are two models of inter-process communication, the message-passing model and the shared
memory model.
• Message-passing uses a common mailbox to pass messages between processes
• Shared memory use certain system calls to create and gain access to regions of memory owned by
other processes
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Communication related system calls:
a. Establish a connection.
b. Send, receive messages.
c. Terminate a connection

Q5 a Explain the use of following OS tools: i) Device Manager ii) Task Scheduler 6
Answer:
i) Device Manager use:
1. Managing all the hardware or virtual devices of computer system.
2. Allow interaction with hardware devices through device driver.
3. Used to install device and component-level drivers as well as associated software.
4. Allocate devices to the process as per process requirement and priority.
5. Deallocate devices either temporarily or permanently depending on condition.
6. Keeping track of all device’s data and location.
7. Monitoring device status like printers, storage drivers and other devices.
8. Used to enforce the predetermined policies and decides which process receives the device when and for
how long.

ii) Task scheduler use:


1. Used to automate the execution of programs, scripts, and various tasks at specific intervals or specific
events.
2. Used to select the next jobs to be admitted into the system and the next process to run.
3. Schedules tasks on CPU. Which task to run first, which has high priority, which has low latency is
decided by schedulers.
4. Schedulers aim to provide fair access to system resources among competing processes or users.
5. Task schedulers strive to maximize the overall throughput of the system by executing tasks in a manner
that minimizes idle time and maximizes the number of tasks completed within a given timeframe.
Winter- Unit 2- Q1 b List any four services provided by operating system 2
2023 Services and Answer: Refer Q1 b of Winter 2022
Components Q2 b Write down the responsibility of the following components of OS: a) Memory Management b) 4
of OS File management
Answer: Refer Q4 b of Summer 2022
Q4 b What are the different types of system calls? Give examples of each 4
Answer: Refer Q4 b of Summer 2024
Q5 a Write two uses of the following operating system tools: 1) Security Policy 2) User 6
Management 3) Performance Monitor
Answer:
Security Policy: Following are the best practices for securing linux os Keep System Updated: Always keep
system updated with latest releases patches, security fixes and kernel when it’s available.
$ yum updates
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
$yum check-update
Use Secure SSH: Telnet and rlogin protocols uses plain text, not encrypted format which is the security
breaches. SSH is a secure protocol that use encryption technology during communication with server.
Never login directly as root unless necessary. Use “sudo” to execute commands.
$ vi /etc/ssh/sshd_config
$ PermitRootLogin no #disable root login
$AllowUsers username # Allow only specific users
$ Protocol 2 #use SSH protocol 2 version
Lock and Unlock Features: They are very useful, instead of removing an account from the system, you
can lock it for an week or a month. To lock a specific user, you can use the follow command.
$ passwd -1 accountname
Turn Off IPv6: If you are not using a IPv6 protocol, then you should disable it because most of the
applications or policies not required IPv6 protocol and currently it doesn’t required on the server. Go to
network configuration file and add followings lines to disable it.
# vi /etc/sysconfig/network
NETWORKING_IPV6=no
IPV6INIT=no
Enables Iptables (Firewall): It is highly recommended to enable Linux firewall to secure unauthorised
access of your servers. Apply rules in iptables to filters incoming, outgoing and forwarding packets. We can
specify the source and destination address to allow and deny in specific udp/tcp port number.
Use Strong Password Policy: Passwords are always a security problem because humans are. People
often cannot be bothered to come up with a lot of different passwords, so they use the same ones in
different places or combinations that are easy to remember, like “password” or “abcde”. Basically, a gift to
hackers. Make it a requirement that any password must contain both upper and lower case, be a mix of
numbers, letters and symbols and you’ll be way safer.
Install Antimalware/Antivirus Software: It is true that there are free anti-malware programs out there, but
as you might expect you get what you pay for. Paid software means better programmers and greater
safety. If your budget won’t stretch that far then consider using ClamAV and Maldet. These are open-
source applications that do a good job of scouring your server for potential threats.

User Management: As the administrator, it is your job to create and manage the accounts for all required
users. Linux comes with several tools for user management. User management includes everything from
creating a user to deleting a user on your system.
Following are the Linux command line tools for managing users and groups:
1. useradd.
2. usermod.
3. userdel.
Useradd: Creating New User: To add new users in Linux system we can use useradd command.
Syntax: useradd login_name
Example: useradd xyz
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
passwd Command: The passwd command is used to set up passwords for users.
Syntax: password user_name
Example: $ passwd vijay
Changing password for vijay:
(current) UNIX password: 123 45
Enter new UNIX password: abc@123
Retype new UNIX password: abc@123
passwd: password updated successfully

Usermod: Modifying Properties of User: The command usermod is used to modify the properties of an
existing user.
Syntax: usermod -c <'newName'> <oldName>
Userdel: Delete a user account: To delete a user account userdel command is used.
Syntax: userdel -r <userName>

Performance Monitor: It is really very tough job for every System or Network administrator to monitor and
debug Linux System Performance problems every day.
top Command: Linux top command is a performance monitoring program which is used frequently by many
system administrators to monitor Linux performance and it is available under many Linux/Unix like
operating systems. The top command used to display all the running and active real-time processes in
ordered list and updates it regularly. It display CPU usage, Memory usage, Swap Memory, Cache Size,
Buffer Size, Process PID, User, Commands and much more. It also shows high memory and CPU
utilization of a running processes.
The top command is much useful for system administrator to monitor and take correct action when
required.
$ top
Summer- Unit 2- Q1 c State any four services of Operating System 2
2023 Services and Answer: Refer Q2 b of Summer 2022
Components Q2 a Explain different types of system calls 4
of OS Answer: Refer Q4 b of Summer 2024
Q3 b Explain different components of Operating System 4
Answer: Refer Q2 b of Summer 2024
Winter- Unit 2 Q1 b: List any four services provided by O.S. 2M
2022 Answer:
Services and • User Interface ½ M each
Components • Program Execution for any 4
of OS • I/O Operation services
• File system Manipulation
• Communication
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
• Error Detection
• Resource Allocation
• Accounting
• Protection and security

Q2 b : Describe any two components of O.S. 4M


Answer: Description
1.Process Management: A program is a set of instructions. When CPU is allocated to a program, of any two
it can start its execution. A program in execution is a process. A word processing program run by a components
user on a PC is a process. A process needs various system resources including CPU time, of OS 2M
memory, files and I/O devices to complete the job execution. These resources can be given to the each
process when it is created or allocated to it while it is running.
The operating system responsible for the following activities in connection with process
management:
• Creation and deletion of user and system processes.
• Suspension and resumption of processes.
• A mechanism for process synchronization.
• A mechanism for process communication.
• A mechanism for deadlock handling.

2. Main-Memory Management Main memory is a large array of words or bytes, ranging in size
from hundreds of thousands to billions. Each word or byte has its own address. Main memory is a
repository of quickly accessible data shared by the CPU and I/O devices. The central processor
reads instructions from main memory during the instruction fetch cycle and both reads and writes
data from main memory during the data fetch cycle. The main memory is generally the only large
storage device that the CPU is able to address and access directly. The operating system
responsible for the following activities in connection with main memory s management:
• Keeping track of which parts of memory are currently being used and by whom.
• Deciding which processes (or parts thereof) and data to move into and out of memory.
• Allocating and deallocating memory space as needed.

3. File Management A file is a collected of related information defined by its creator. Computer can
store files on the disk (secondary storage), which provide long term storage. Some examples of
storage media are magnetic tape, magnetic disk and optical disk. Each of these media has its own
properties like speed, capacity, and data transfer rate and access methods. A file system normally
organized into directories to ease their use. These directories may contain files and other
directions. The operating system responsible for the following activities in connection with file
management:
• The creation and deletion of files.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
• The creation and deletion of directions.
• The support of primitives for manipulating files and directions.
• The mapping of files onto secondary storage.
• The backup of files on stable storage media.

Q4 b : Write any four system call related to file management. 4M


Answer:
System calls related to file management are:
1. create new file
2. delete existing file Any 4
3. open file system calls
4. close file 1M each
5. create directories
6. delete directories
7. read, write, reposition in file
8. get file attributes
9. set file attributes
Q5 a : Write two uses of following O.S. tools – (i) Device Management (ii) Performance monitor (iii) 6M
Task Scheduler
Answer:
i) Device management:
• Managing all the hardware or virtual devices of computer system. 2 uses of
• Allow interaction with hardware devices through device driver. each tool
• Used to install device and component-level drivers as well as associated software. 2M
• Allocate devices to the process as per process requirement and priority.
• Deallocate devices either temporarily or permanently depending on condition.
• Keeping track of all device’s data and location.
• Monitoring device status like printers, storage drivers and other devices.
• Used to enforce the predetermined policies and decides which process receives the device
when and for how long.
ii) Performance monitor
• Monitor various activities on a computer such as CPU or memory usage.
• Used to examine how programs running on their computer affect computer’s performance
• It is used to identify performance problems or bottleneck that affect operating system or
installed applications.
• Used to observe the effect of system configuration changes.
iii) Task scheduler
• Assign processor to task ready for execution
• Executing predefined actions automatically whenever a certain set of condition is met.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
(Any two relevant uses shall be considered)

Summer- Unit 2 Q1 b :State any four types of system calls. 2M


2022 Answer:
Services and Types of System calls
Components 1) Process or Job control ½ M each
of OS 2) File Management for any 4
3) Device Management types
4) Information Maintenance
5) Communication
Q2 b : List and describe any four services of operating system. 4M
Answer:

Figure of Services provided by Operating System


Services provided by Operating System
1) User Interface 1M for
2) Program Execution Listing
3) I/O Operation services
4) File system Manipulation and
5) Communication Any 4
services 3M
6) Error Detection
7) Resource Allocation
8) Accounting
9) Protection and security
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
OS services provided to the user: -
User Interface: All operating systems have a user interface that allows users to communicate with the
system. There are three types of user interfaces are available: -
1. Command line interface (CLI): -
It uses text commands and a method for entering them. For example, working on DOS prompt.
2. Batch interface: -
Commands and directives to control those commands, are entered into a file and the file is
executed. For example, combining set of C programming statements into a file to perform a
specific task and executing that file in TURBO C.
3. Graphical user interface (GUI): -
This interface is a window system with a pointing device to direct I/O, select from menus and
make selections and keyboard to enter the text. For example, Windows system provides icons
for selecting an application. Double clicking on that icon will open that application. Some
system provides to or all three of these variations.
Program execution: The operating system provides an environment where the user can conveniently run
programs. To run a program, the program is loaded into the main memory and then CPU is assigned to
that process for its execution. Operating system performs this function for the convenience of the user. It
also performs other important tasks like allocation and de-allocation of memory, CPU scheduling etc. It also
provides service to end process execution either normally or abnormally by indicating error.
I/O operations: When a program is running, it may require input/output resources such as a file or devices
such as printer. For specific devices, special functions may be required such as recording to a CD drive.
For efficiency and protection users usually cannot control I/O devices directly. So the operating system
provides a service to do I/O.
File system manipulation: Programs may need to read and write data from and to the files and
directories. Operating system manages the secondary storage. User gives a command for reading or
writing to a file. Operating system makes it easier for user programs to accomplish their task such as
opening a file, saving a file and deleting a file from the storage disk. It also provides services for file
permission management to allow or deny access to files or directories based on file ownership.
Communication: In the system, one process may need to exchange information with another process.
Such communication may occur between processes that are executing on different computer systems tied
together by a computer network. Communication can be implemented via shared memory or through
message passing, in which packets of information are moved between processes by the operating system.
Error detection: The operating system needs to be constantly aware of possible errors.
Errors can occur in:
1. CPU and memory hardware such as a memory error or power failure
2. I/O devices such as parity error on tape, a connection failure on a network or lack of paper in the printer
3. The user program such as an arithmetic overflow, an attempt to access an illegal memory location or a
too-great use of CPU time.
For each type of error, the operating system should take the appropriate action to ensure correct and
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
consistent computing. Debugging facilities can greatly enhance the users and programmers abilities to use
the system efficiently.
OS services provided to the system:
Resource allocation: When there are multiple users or multiple processes running at the same time,
resources must be allocated to each of them. Operating system manages resource allocation to the
processes. These resources are CPU, main memory, file storage and I/O devices. For maximizing use of
CPU, operating system does CPU scheduling. Operating system contains routines to allocate printers,
modems, USB storage drives and other peripheral devices.
Accounting: Operating system keeps track of usages of various computer resources allocated to users.
This accounting is used for reconfiguration of system to improve computing services.
Protection & security: Owners of information stored in a multiuser or networked computer system want to
control use of that information. When several separate processes execute concurrently, one process
should not interfere with the other processes or operating system itself. Protection provides controlled
access to system resources. Security is provided by user authentication such as password for accessing
information.
Q4 b: Describe various activities performed by following operating system components. i) Main 4M
memory management ii) File management Any 2
Answer: Activities of
1. Activities of main memory-management: main
1. Keep track of which part of memory are currently being used and by whom. memory-
management
2. Decide which process are loaded into memory when memory space becomes available for 2M
3. Allocate and deallocate memory space as needed. And
2. Activities of file management: Any 4
1. The creation and deletion of files. Activities of
2. The creation and deletion of directions. file
management
3. The support of primitives for manipulating files and directions. For 2M
4. The mapping of files onto secondary storage.
5. The backup of files on stable storage media.
Q5 b : Describe various activities performed by following operating system components. i) Main 6M
memory management ii) File management
Answer: 1½ M for
Device management: Explanation
1. Managing all the hardware or virtual devices of computer system. of each tool
2. Allow interaction with hardware devices through device driver. and ½M for
3. Used to install device and component-level drivers as well as associated software. Example
4. Allocate devices to the process as per process requirement and priority.
5. Deallocate devices either temporarily or permanently depending on condition.
6. Keeping track of all device’s data and location.
7. Monitoring device status like printers, storage drivers and other devices.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
8. Used to enforce the predetermined policies and decides which process receives the device
when and for how long.
9. All Linux device files are located in the /dev directory, which is an integral part of the root (/)
filesystem because these device files must be available to the operating system during the
boot process.
Example: ls –l /dev
Above example gives the list of device file from kernel.Udev supplies a dynamic device
directory containing only the nodes for devices which are connected to the system. It creates or
removes the device node files in the /dev directory.
Performance monitor:
1. Monitor various activities on a computer such as CPU or memory usage.
2. Used to examine how programs running on their computer affect computer’s performance.
3. It is used to identify performance problems or bottleneck that affect operating system or
installed applications.
4. Used to observe the effect of system configuration changes.
5. It is very tough job for every system or network administrator to monitor and debug Linux
System Performance problems every day.
6. The commands discussed below are some of the most fundamental commands when it
comes to system analysis and debugging Linux server issues such as:
1) top: Process activity monitoring command top command display Linux processes. It provides a dynamic
real-time view of a running system i.e. actual process activity. By default, it displays the most CPU-
intensive tasks running on the server andupdates the list every five seconds.
$ top
2) vmstat: Virtual memory statistics The vmstat command reports information about processes, memory,
paging, block IO, traps, and cpu activity.
$ vmstat 3
3) free: Show Linux server memory usage free command shows the total amount of free and used physical
and swap memory in the system, as well as the buffers used by the kernel.
# free
4) iostat: Montor Linux average CPU load and disk activity iostat command report Central Processing Unit
(CPU) statistics and input/output statistics for devices, partitions and network filesystems (NFS).
# iostat
5) netstat Linux network and statistics monitoring tool netstat command displays network connections,
routing tables, interface statistics, masquerade connections, and multicastmemberships.
# netstat –tulpn
Task Scheduler:
1. Crontab files can be used to automate backups, system maintenance and other repetitive
tasks.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
2. The syntax is powerful and flexible, so you can have a task run every fifteen minutes or at a
specific minute on a specific day every year.
3. First, open a terminal window from your Linux desktop’s applications menu. You can click the
Dash icon, type Terminal and press Enter to open one if you’re using Ubuntu.
Use the crontab -e command to open your user account’s crontab file.
$ crontab -e
Winter- Unit 2 Q1 b : Explain any 4 services provided by OS. 2M
2019 Services and Answer:
Components 1.User Interface: All operating systems have a user interface that allows users to communicate with the ½ M for
of OS system. Three types of user interfaces are available: explaining
a. Command line interface (CLI) any 4
b. Batch interface services
c. Graphical user interface (GUI)
2. Program execution: The operating system provides an environment where the user can
conveniently run programs. It also performs other important tasks like allocation and deallocation of
memory, CPU scheduling etc. It also provides service to end process execution either normally or
abnormally by indicating error.
3. I/O operations: When a program is running, it may require input/output resources such as a file or
devices such as printer. So the operating system provides a service to do I/O.
4.File system manipulation: Programs may need to read and write data from and to the files and
directories. Operating system manages the secondary storage. Operating system makes it easier
for user programs to accomplish their task such as opening a file, saving a file and deleting a file
from the storage disk.
5.Communication: In the system, one process may need to exchange information with another
process. Communication can be implemented via shared memory or through message passing, in
which packets of information are moved between processes by the operating system.
6.Error detection: Operating systems detects CPU and memory hardware such as a memory error or
power failure, a connection failure on a network or lack of paper in the printer etc.
7.Resource allocation: Operating system manages resource allocation to the processes. These
resources are CPU, main memory, file storage and I/O devices.
8.Accounting: Operating system keeps track of usages of various computer resources allocated to
users.
9.Protection & security: When several separate processes execute concurrently, one process should
not interfere with the other processes or operating system itself. Protection provides controlled
access to system resources. Security is provided by user authentication such as password for
accessing information.
Q2 b : List components of OS. Explain process management in detail. 4M
Answer:
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
List of System Components:
1) Process management
2) Main memory management 1M Listing,
3) File management 3M
4) I/O system management Explanation
5) Secondary storage management
Process Management
1. The operating system manages many kinds of activities ranging from user programs to system
programs like printer spooler, name servers, file server etc.
2. Each of these activities is encapsulated in a process. A process includes the complete execution
context (code, data, PC, registers, OS resources in use etc.)
3. The basic unit of software that the operating system deals with in scheduling the work done by the
processor is either a process or a thread, depending on the operating system.
4. It is tempting to think of a process as an application, but that gives an incomplete picture of how
processes relate to the operating system and hardware.
5. The application you see (word processor or spreadsheet or game) is, indeed, a process, but that
application may cause several other processes to begin, for tasks like communications with other
devices or other computers.
6. There are also numerous processes that run without giving you direct evidence that they ever exist.
7. A process, then, is software that performs some action and can be controlled by a user, by other
applications or by the operating system.
8. It is processes, rather than applications, that the operating system controls and schedules for
execution by the CPU. In a single tasking system, the schedule is straightforward.
9. The operating system allows the application to begin running, suspending the execution only long
enough to deal with interrupts and user input.
The five major activities of an operating system regarding process management are:
1. Creation and deletion of user and system processes.
2. Suspension and resumption of processes.
3. A mechanism for process synchronization.
4. A mechanism for process communication.
5. A mechanism for deadlock handling.
Q4 b : What is purpose of system call? State any two system calls with their functions. 4M
Answer: purpose of
System call provides an interface between a running program and operating system. It allows user to system call-
access services provided by operating system. This system calls are procedures written using C,C++ and 2M, Two
assembly language instructions. Each operating system has its own name for each system call. Each system
system call is associated with a number that identifies itself. calls-
System calls: 1M each
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Process Control: Program in execution is a process. A process to be executed must be loaded in main
memory. while executing it may need to wait, terminate or create & terminate child processes.
• end, abort
• load, execute
• create process, terminate process
• get process attributes, set process attributes
• wait for time
• wait event, signal event
• allocate and free memory

File Management: System allows us to create and delete files. For create and delete operation system call
requires the name of the file and other attributes of the file. File attributes include file type, file size,
protection codes, accounting information and so on. Systems access these attributes for performing
operations on file and directories. Oncethe file is created, we can open it and use it. System also allows
performing reading, writing or repositioning operations on file.
• create file, delete file
• open, close
• read, write, reposition
• get file attributes, set device attributes
• logically attach or detach devices
3. Device Management: When a process is in running state, it requires several resources to execute.
These resources include main memory, disk drives, files and so on. If the resource is available, it is
assigned to the process. Once the resource is allocated to the process, process can read, write and
reposition the device.
• request device, release device
• read, write, reposition
• get device attributes, set device attributes
• logically attach or detach devices

4. Information Maintenance: Transferring information between the user program and the operating
system requires system call. System information includes displaying current date and time, the number of
current users, the version number of the operating system, the amount of free memory or disk space and
so on. Operating system keeps information about all its processes that can be accessed with system calls
such as get process attributes and set process attributes.
• get time or date, set time or date
• get system data, set system data
• get process, file, or devices attributes
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
• set process, file, or devices attributes

5. Communication: Processes in the system, communicate with each other. Communication is done by
using two models: message passing and shared memory. For transferring messages, sender process
connects itself to receiving process by specifying receiving process name or identity. Once the
communication is over system close the connection between communicating processes.
• create, delete communication connection
• send, receive messages
• transfer status information
• attach or detach remote devices.

Q5 a: Enlist the operating system tools. Explain any two in detail. 6M


Answer:
Following are the operating tools:
• User Management For List 2M
• Security policy and
• Device Management Explanation
• Performance Monitor any two
• Task Scheduler for 4M

A) User management: User management includes everything from creating a user to deleting a user on
your system. User management can be done in three ways on a Linux system.Command line tools include
commands like useradd, userdel, usermod, passwd, etc. These are mostly used by the server
administrators.
Useradd: With useradd commands you can add a user.
Syntax: useradd -m -d /home/<userName> -c "<userName>" <userName>
Example: useradd -m -d /home/xyz -c "xyz" xyz
File /etc/default/useradd contains some user default options.
The command useradd -D can be used to display this file.
Syntax: useradd -D
Userdel: To delete a user account userdel command is used.
Syntax: userdel -r <userName>
Usermod: The command usermod is used to modify the properties of an existing user.
Syntax: usermod -c <'newName'> <oldName>
Example: usermod -c 'vppoly' john
Using passwd command
Passwd: A user can set the password with the command passwd. Old password has to be typed
twice before entering the new one.
Syntax: passwd <userName>
Example: passwd vppoly
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
B) Device Management: Device management is the process of managing the implementation, operation
and maintenance of a physical and/or virtual device. All Linux device files are located in the /dev directory,
which is an integral part of the root (/) filesystem because these device files must be available to the
operating system during the boot process.
Example: ls –l /dev
Above example gives the list of device file from kernel.
Udev supplies a dynamic device directory containing only the nodes for devices which are
connected to the system. It creates or removes the device node files in the /dev directory.
C) Performance Monitor: It is very tough job for every system or network administrator to monitor and
debug Linux System Performance problems every day. The commands discussed below are some of the
most fundamental commands when it comes to system analysis and debugging Linux server issues such
as:
1) vmstat: Virtual memory statistics
The vmstat command reports information about processes, memory,
paging, block IO, traps, and cpu activity.
$ vmstat 3
2)top: Process activity monitoring command top command display Linux processes. It provides a
dynamic real-time view of a running system i.e. actual process activity. By default, it displays the
most CPU-intensive tasks running on the server and updates the list every five seconds.
$ top
3) free: Show Linux server memory usage free command shows the total amount of free and used
physical and swap memory in the system, as well as the buffers used by the kernel.
# free
4) iostat: Montor Linux average CPU load and disk activity iostat command report Central
Processing Unit (CPU) statistics and input/output statistics for devices, partitions and network
filesystems(NFS).
# iostat
5) netstat Linux network and statistics monitoring tool netstat command displays network
connections, routing tables, interface statistics, masquerade connections, and multicast
memberships.
# netstat –tulpn
Summer- Unit 3- Q1 c Draw process state diagram 2
2024 Process Answer:
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Management

Q2 c Describe message passing system of inter-process communication (IPC) 4


Answer:

Message Passing: In this model, communication takes place by


exchanging messages between cooperating processes. It allows
processes to communicate and synchronize their action without
sharing the same address space. It is particularly useful in a
distributed environment when communication process may
reside on a different computer connected by a network.
Communication requires sending and receiving messages
through the kernel. The processes that want to communicate
with each other must have a communication link between them.
Between each pair of processes exactly one communication link
exists.

Q3 a Define Process. Draw a Process Control Block and explain the information in PCB 4
Answer:
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme

Process: A process is defined as, a program under execution,


which competes for the CPU time and other resources. A process
is a program in execution. Process is also called as job, task and
unit of work. Following are the blocks in PCB:
1. Process Number: Each process is identified by its process
number, called Process Identification Number (PID). Every
process has a unique process-id through which it is identified. The
process-id is provided by the OS. The process id of two processes
could not be same because process-id is always unique.
2. Priority: Each process is assigned a certain level of priority that
corresponds to the relative importance of the event that it services
process priority is the preference of the one process over other
process for execution. Priority may be given by the user/system
manager or it may be given internally by OS. This field stores the
priority of a particular process.
3. Process State: This information is about the current state of the
process. The state may be new, ready, running, and waiting,
halted, and so on.
4. Program Counter: The counter indicates the address of the next instruction to be executed for this
process.
5. CPU Registers: The registers vary in number and type, depending on the computer architecture. They
include accumulators, index registers, stack pointers, and general-purpose registers, plus any condition-
code information. Along with the program counter, this state information must be saved when an interrupt
occurs, to allow the process to be continued correctly afterward.
6. CPU Scheduling Information: This information includes a process priority, pointers to scheduling
queues, and any other scheduling parameters.
7. Memory Management Information: This information may include such information as the value of the
base and limit registers, the page tables, or the segment tables, depending on the memory system used by
the operating system.
8. Accounting Information: This information includes the amount of CPU and real time used, time limits,
account numbers, job or process numbers, and so on.
9. I/O Status Information: This information includes the list of I/O devices allocated to the process, a list of
open files, and so on.
10. File Management: It includes information about all open files, access rights etc.
11. Pointer: Pointer points to another process control block. Pointer is used for maintaining the scheduling
list.
Q4 c Describe how context switch is executed by operating system 4
Answer: When CPU switches to another process, the system must save the state of the old process and
load the saved state for the new process. This task is known as a context switch. CPU switching from one
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
process to another process is called a context switch. Context switch times are highly dependent on
hardware support. Its speed varies from machine to machine, depending on the memory speed, the
number of registers that must be copied and the existence of special instructions. This enables multiple
processes to share a single CPU. The context switch is an essential feature of a multitasking operating
system.
When the process is switched, the following information is stored:
• Program Counter
• Scheduling Information
• Base and limit register value
• Currently used register
• Changed State
• I/O State
• Accounting

Q5 b Explain user level thread and Kernel level thread with its advantages and disadvantages 6
Answer
User Level Thread: In a user thread, all of the work of thread management is done by the application and
the kernel is not aware of the existence of threads. The thread library contains code for creating and
destroying threads, for passing message and data between threads, for scheduling thread execution and
for saving and restoring thread contexts. The application begins with a single thread and begins running in
that thread. User level threads are generally fast to create and manage.
Advantages of user level thread over Kernel level thread:
1. Thread switching does not require Kernel mode privileges.
2. User level thread can run on any operating system.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
3. Scheduling can be application specific.
4. User level threads are fast to create and manage.

Disadvantages of user level thread:


1. Limited Parallelism: Since user-level threads are managed within the context of a single process, they
are not well-suited for applications that need to take full advantage of multi-core processors or for
applications that require parallel execution across different processes.
2. Blocking: If a user-level thread blocks due to I/O or other reasons, all threads in the same process can
be blocked, leading to poor utilization of resources.
3. No True Parallelism: User-level threads cannot execute in true parallel on multi-core systems since they
are managed by a single kernel-level thread
4. It is not appropriate for a multiprocessor system.

Kernel Level Threads: In Kernel level thread, thread


management done by the Kernel. There is no thread
management code in the application area. Kernel threads are
supported directly by the operating system. Any application can
be programmed to be multithreaded. All of the threads within an
application are supported within a single process. The Kernel
maintains context information for the process as a whole and for
individual threads within the process. Scheduling by the Kernel
is done on a thread basis. The Kernel performs thread creation,
scheduling and management in Kernel space. Kernel threads
are generally slower to create and manage than the user
threads.

Advantages of Kernel level thread:


1. Kernel can simultaneously schedule multiple threads from the same process on multiple process.
2. If one thread in a process is blocked, the Kernel can schedule another thread of the same process.
3. Kernel routines themselves can multithreaded.
Disadvantages:
1. Kernel threads are generally slower to create and manage than the user threads.
2. Transfer of control from one thread to another within same process requires a mode switch to the Kernel.

Winter- Unit 3- Q1 c Draw neat labelled process state diagram along with the correct directions of arrows 2
2023 Process Answer: Refer Q1 C of Summer 2024
Management Q1 f What is the use of ps command? Write long form of UID, PID in the output of this command 2
Answer: You can use the ps command to display a list of your processes that are currently running and
obtain additional information about those processes.
UID: User Identification Number
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
PID: Process Identification Number
Q2 c Explain shared Memory Method of IPC using neat labelled diagram 4
Answer: Refer Q2 c of Winter 2022
Q3 a Explain following commands with their syntax: 1) kill 2) sleep 3) wait 4) exit 4
Answer: Refer Q1 f of Winter 2022
Wait: The wait command in Linux is a built-in shell command that pauses script execution until a specific
process or job finishes
Syntax: wait [PID] where PID represents the Process ID of the specific process that the script is waiting for.

Exit: The 'exit' command is a fundamental command in Linux used to exit the current shell session. This
command is widely used in scripting and command-line operations, allowing users and scripts to terminate
a session or a process in a controlled manner.
Syntax: exit
Q4 c Explain working of CPU switch from process to process with neat labelled diagram 4
Answer: Refer Q4 c of Summer 2024
Q5 b Differentiate between process and thread (any two points) also discuss the benefits of 6
multithreading programming
Process Thread
A process is a program under execution i.e A thread is a lightweight process that can be
an active program. managed independently by a scheduler.
Process are heavy weight operations Threads are heavy weight operations
Every process has its own memory space Threads use the memory of the process they belong
to.
Context switching between the process is Context switching between threads of the same
more expensive process is less expensive
Processes are independent. Threads are dependent
Process is controlled by the operating Threads are controlled by programmer in a program.
system.
Benefits of Multithreading
▪ Enhanced performance by decreased development time
▪ Simplified and streamlined program coding
▪ Improvised GUI responsiveness
▪ Simultaneous and parallelized occurrence of tasks
▪ Better use of cache storage by utilization of resources
▪ Decreased cost of maintenance
▪ Better use of CPU resource
Summer- Unit 3- Q2 b Draw and explain process control block in detail 4
2023 Process Answer: Refer Q3 a of Summer 2024
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Management Q3 c Explain different types of Schedulers 4
Answer:
Long term scheduler: Long term scheduler is also known as job scheduler. It chooses the processes from
the pool (secondary memory) and keeps them in the ready queue maintained in the primary memory. Long
Term scheduler mainly controls the degree of Multiprogramming. The purpose of long term scheduler is to
choose a perfect mix of IO bound and CPU bound processes among the jobs present in the pool.

Short term scheduler: Short term scheduler is also known as CPU scheduler. It selects one of the Jobs
from the ready queue and dispatch to the CPU for the execution. A scheduling algorithm is used to select
which job is going to be dispatched for the execution. The Job of the short term scheduler can be very
critical in the sense that if it selects job whose CPU burst time is very high then all the jobs after that, will
have to wait in the ready queue for a very long time.

Medium term scheduler: Medium term scheduler takes care of the swapped out processes. If the running
state processes needs some IO time for the completion then there is a need to change its state from
running to waiting. Medium term scheduler is used for this purpose. It removes the process from the
running state to make room for the other processes. Such processes are the swapped out processes and
this procedure is called swapping. The medium term scheduler is responsible for suspending and resuming
the processes.
Q4 b Draw Process State Diagram and describe each state. 4
Answer: Refer Q3 a of Winter 2022
Q5 a Explain working of Inter-process communication considering a) Shared Memory b) Message 6
Passing
Answer: Refer Q2 c of Winter 2019
Winter- Unit 3 Q1 c : Define : Process, PCB. 2M
2022 Answer:
Process Process:-A process is a program in execution. Process is also called as job, task or unit of work. Correct
management Definition
PCB:-Process Control Block is a data structure that contains information of the process related to it. The 1M each
process control block is also known as a task control block, entry of the process table, etc.
Q1 f : Write syntax of following commands- (i) Kill (ii) Sleep 2M
Answer: 1M for each
i) kill Syntax: kill Pid correct
ii) sleep Syntax: sleep NUMBER[SUFFIX]… sleep OPTION syntax

Q2 C : Explain shared memory model of Inter-process communication (IPC). 4M


Answer:
Inter-process communication: Cooperating processes require an Inter- process communication (IPC) Explanation
mechanism that will allow them to exchange data and information. 3M Diagram
Shared memory 1M
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
In this, all processes who want to communicate with other processes
can access a region of the memory residing in an address space of a
process creating a shared memory segment.
All the processes using the shared memory segment should attach to
the address space of the shared memory. All the processes can
exchange information by reading and/or writing data in shared memory
segment.
The form of data and location are determined by these processes who
want to communicate with each other.
These processes are not under the control of the operating system.
The processes are also responsible for ensuring that they are not
writing to the same location simultaneously.
After establishing shared memory segment, all accesses to the shared
memory segment are treated as routine memory access and without
assistance of kernel.
Q3 a : Draw and explain process state diagram. 4M
Solution : 1M
for correct
New: When a process enters into the well
system, it is in new state. In this state a labelled
process is created. In new state the process Process
is in job pool. state
Ready: When the process is loaded into the diagram (1
main memory, it is ready for execution. In M
this state the process is waiting for specifying
processor allocation. correct
Running: When CPU is available, system states in
selects one process from main memory and the
executes all the instructions from that diagram)
process. So, when a process is in execution, Explanation
it is in running state. In single user system, 2M
only one process can be in the running state. In multiuser system, there can be multiple processes
which are in the running state.
Waiting State: When a process is in execution, it may request for I/O resources. If the resource is
not available, process goes into the waiting state. When the resource is available, the process goes
back to ready state.
Terminated State: When the process completes its execution, it goes into the terminated state. In
this state the memory occupied by the process is released.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Q4 c : Compare between Long term and short term scheduler. (Any four points) 4M
Answer:
Sr. No Long Term Scheduler Short Term Scheduler
1 It is job scheduler It is CPU scheduler Any four
2 It selects processes from job pool and It selects processes from ready queue which are points 1M
loads them into memory for execution. ready to execute and allocates CPU to one of each
them
3 Access job pool and ready queue Access ready queue and CPU
4 It executes much less frequently. It It executes frequently. It executes when CPU is
executes when memory has space to available for allocation
accommodate new process
5 Speed is less than short term Speed is fast
scheduler
6 It controls the degree of It provides lesser control over degree of
multiprogramming multiprogramming

7 It chooses a good process that is a mix- It chooses a new process for a processor quite
up of input/output bound and CPU bound. frequently.

Summer- Unit 3 Q1 c : Draw a neat labelled diagram for process state. 2M


2022 Answer: 1M
Process for correct
management well
labelled
Process
state
diagram (1
M
specifying
correct
states in
the
diagram)

Q1 f : Give commands to perform following tasks: i) To add delay in script ii) To terminate a 2M
process 1M for each
Answer: correct
i. sleep command
ii. kill name
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme

Q2c : Differentiate between shared memory system and message passing system of inter-process 4M
communication.
Answer:
Basis Shared Memory System Message Passing System
Any four
Communication Communication is established using a Communication is established using the points 1M
shared memory region. message passing facility. each
Data Size Useful for exchanging larger amount of Useful for exchanging small amount of data.
data.
Process Location Useful for the communicating processes Useful for the communicating processes that
that are on same system. are on different remote system.
Speed Communication between the process is Communication speed is comparatively
faster. slower.

Kernel Kernel intervention is not there. Kernel intervention is there.


Intervention

Q3 a : Describe use of ps and wait commands with suitable example. 4M


Answer:
ps command: It is used to display the characteristics of a process. This command when execute without 1M for each
options, it lists the processes associated with a user at a particular terminal. correct
Syntax: $ ps [options] command
Example: $ ps description
output: And 1M for
each correct
example

Each line in the output shows PID, the terminal with which the process is associated, the cumulative
processor time that has been consumed since the process has been started and the process name.

wait command: wait until all background processes are completed and then exits and if process ID is
given wait waits for the process identified by process ID pid , and reports its termination status.
Syntax: $ wait
and
$wait pid
Example:
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
1) $ wait
output:
Wait for all background processes to terminate, and return its exit status
2)$wait 4123
output:
Wait for process 4123 to terminate, and return its exit status.
Q4 c : With suitable diagram, describe use of scheduling queues in process scheduling. 4M
Answer:

Scheduling
queue
diagram 1M
And 1M for
each correct
queue
Explanation

Ready queue: The processes that are residing in main memory and are ready and waiting to execute are
kept on a list called the ready queue.
Job queue: As processes enter the system they are put into a job queue.
Device queue: The list of processes waiting for a particular I/O device is called device queue.
Q6 a : Describe one-to-one multithreading model with suitable diagram. Also write any two 4M
advantages of one-to-one model over many-to-one model.
Answer:
One-to-One Model

Explanation
3M Diagram
1M and 1M
each for any
Two
advantages
Figure of One-to-One Model
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
1. The one-to-one model maps each user thread to a kernel thread.
2. It provides more concurrency than the many-to-one model by allowing another thread to run
when a thread makes a blocking system call; it also allows multiple threads to run in parallel on
multiprocessors.
3. The only drawback to this model is that creating a user thread requires creating the
corresponding kernel thread.
4. Because the overhead of creating kernel threads can burden the performance of an
application, most implementations of this model restrict the number of threads supported by the
system.
5. Linux, along with the family of Windows operating systems, implement the one-to-one model.
Advantages of one-to-one model over many-to-one model.
1. one-to-one model gives greater concurrency than the many-to-one model.
2. It permits any other thread to run while a thread makes a blocking off gadget call.
3. It helps more than one thread to execute in parallel in system.
Winter- Unit 3 Q1 c : Draw process state diagram. 2M
2019 Answer:
Process 1M
management for correct
well
labelled
Process
state
diagram (1
M
specifying
correct
states in
the
diagram)
Figure of process states
Q1 f : Write syntax of following commands: (i) Sleep (ii) Kill 2M
Answer:
i)sleep 1 mark
Syntax: each for
sleep NUMBER[SUFFIX]… correct
sleep OPTION syntax
ii) kill
Syntax: kill pid
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Q2 c: With neat diagram explain inter process communication model. 4M
Answer:
Inter-process communication: Cooperating processes require an Inter process communication (IPC) 1 mark
mechanism that will allow them to exchange data and information. Define
There are two models of IPC inter
1.Shared memory process
In this, all processes who want to communicate with other processes can communicati
access a region of the memory residing in an address space of a process on -1
creating a shared memory segment. All the processes using the shared mark;
memory segment should attach to the address space of the shared diagram of
memory. All the processes can exchange information by reading and/or model - 1
writing data in shared memory segment. The form of data and location mark;
are determined by these processes who want to communicate with each explanation
other. These processes are not under the control of the operating
system. The processes are also responsible for ensuring that they are
not writing to the same location simultaneously. After establishing shared
memory segment, all accesses to the shared memory segment are
treated as routine memory access and without assistance of kernel.

2.Message Passing
In this model, communication takes place by exchanging messages between cooperating processes. It
allows processes to communicate and synchronize their action without sharing the same address space. It
is particularly useful in a distributed environment when communication process may reside on a different
computer connected by a network. Communication requires sending and receiving messages through the
kernel. The processes that want to communicate with each other must have a communication link between
them. Between each pair of processes exactly one communication link.
Q3 a : Explain ‘PS’ command with any four options. 4M
Answer:
ps command: It is used to display the characteristics of a process. This command when execute without four
options, it lists the processes associated with a user at a particular terminal. options-1M
Syntax: $ ps [options] each
Example: $ ps
output:

Each line in the output shows PID, the terminal with which the process is associated, the cumulative
processor time that has been consumed since the process has been started and the process name.
Options:
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
-f : It is used to display full listing of attributes of a process. It includes UID (user ID), PPID (Parent ID), C
(amount of CPU time consumed by the process) and STIME (chronological time that has elapsed since the
process started).
Example: $ ps -f

-u: Shows the activities of any specified user at any time.


Example: $ ps -u abc

-a: It shows the processes of all users.


Example: $ ps -a

-e: It displays processes including user and system processes.


example: $ ps -e

Q4 a : Write unix command for following: (i) Create a folder OSY (ii) Create a file FIRST in OSY 4M
folder (iii) List / display all files and directories. (iv) Write command to clear the screen
Answer:
i) create a folder OSY: Each correct
$mkdir OSY command-
ii)create a file FIRST in OSY folder: 1M
$cd OSY
$cat>FIRST or $ touch FIRST
iii) List/display all files and directories:
$ls
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
iv) to clear screen:
$clear
Q4 c : State and describe types of scheduler. 4M
Answer:
There are three types of scheduler:
• Long term scheduler
• Short term scheduler list-1M,
• Medium term scheduler description
Long term scheduler: of each-1
• It selects programs from job pool and loads them into the main memory. It controls the degree of
multiprogramming.
• The degree of multiprogramming is the number of processes loaded (existing) into the main memory.
System contains I/O bound processes and CPU bound processes.
• An I/O bound process spends more time for doing I/O operations whereas CPU bound process spends
more time in doing computations with the CPU. So It is the responsibility of long term scheduler to
balance the system by loading some I/O bound and some CPU bound processed into the main
memory.
• Long term scheduler executes only when a process leaves the system, so it executes less frequently.
When long term scheduler selects a process from job pool, the state of process changes from new to
ready state.

Short term scheduler:


• It is also known as CPU scheduler. This scheduler selects processes that are ready for execution from
the ready queue and allocates the CPU to the selected process.
• Frequency of execution of short-term scheduler is more than other schedulers.
• When short term scheduler selects a process, the state of process changes from ready to running
state.

Medium term scheduler:


• When a process is in running state, due to some interrupt it is blocked. System swaps out blocked
process and store it into a blocked and swapped out process queue.
• When space is available in the main memory, the operating system looks at the list of swapped out but
ready processes. The medium-term scheduler selects one process from that list and loads it into the
ready queue.
• The job of medium-term scheduler is to select a process from swapped out process queue and to load
it into the main memory. This scheduler works in close communication with long term scheduler for
loading process into the main memory.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Q4 e : Explain PCB with diagram. 4M
Answer: Refer Q3 a of Summer 2024
Q5 b : Explain multithreading model in detail. 6M
Answer: Each
Many systems provide support for both user and kernel threads, resulting in different multithreading Model 2M
models. Following are three multithreading model:

Many-to-One Model

Figure of Many-to-One Model


• The many-to-one model maps many user-level threads to one kernel thread.
• Thread management is done by the thread library in user space, so it is efficient; but the entire process
will block if a thread makes a blocking system call.
• Also, because only one thread can access the kernel at a time, multiple threads are unable to nm in
parallel on multiprocessors.
• Example: Green threads-a thread library available for Solaris

Advantages:
• More concurrency because of multiple threads can run in
• Parallel on multiple CPUs.
• Less complication in the processing.

Disadvantages:
• Thread creation involves light-weight process creation.
• Kernel thread is an overhead.
• Limiting the number of total threads.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
One-to-One Model

Figure of One-to-One Model


• The one-to-one model maps each user thread to a kernel thread.
• It provides more concurrency than the many-to-one model by allowing another thread to run when a
thread makes a blocking system call; it also allows multiple threads to run in parallel on
multiprocessors.
• The only drawback to this model is that creating a user thread requires creating the corresponding
kernel thread.
• Because the overhead of creating kernel threads can burden the performance of an application, most
implementations of this model restrict the number of threads supported by the system.
• Linux, along with the family of Windows operating systems, implement the one-to-one model.
Advantages:
• Mainly used in language system, portable libraries.
• One kernel thread controls multiple user thread.

Disadvantages:
• Parallelism is not supported by this model.
• One block can blocks all user threads.

Many-to-Many Model

OR
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
• The many-to-many model multiplexes many user-level threads to a smaller or equal number of kernel
threads.
• The number of kernel threads may be specific to either a particular application or a particular
machine (an application may be allocated more kernel threads on a multiprocessor than on a
uniprocessor).
• The one-to-one model allows for greater concurrency, but the developer has to be careful not to
create too many threads within an application (and in some instances may be limited in the number
of threads she can create).
• he many-to-many model suffers from neither of these shortcomings: developers can create as many
user threads as necessary, and the corresponding kernel threads can run in parallel on a
multiprocessor.
• Also, when a thread performs a blocking system call, the kernel can schedule another thread for
execution.
Advantages:
• Many threads can be created as per user’s requirement.
• Multiple kernels or equal to user threads can be created.
Disadvantages:
• True concurrency cannot be achieved.
• Multiple threads of kernel is an overhead for operating system
Summer- Unit 4- Q1 d State two features of non-preemptive scheduling 2
2024 CPU Answer:
Scheduling 1. Once CPU is allocated to the process, the process keeps the CPU until it releases the CPU either
and by terminating or by switching to the waiting state.
Algorithms 2. A process switches from running state to waiting state or running to terminated state.
3. Low scheduling overhead.
4. Simple to implement and manage.
5. Less responsive in terms of priority for urgent task.
Q2 d What is CPU Scheduler? Explain the preemptive and non-preemptive type of scheduling 4
Answer
CPU Scheduler: When the CPU becomes idle, the CPU scheduler selects one of the processes in the
ready queue for execution. The CPU scheduler selects a process from the processes in memory that are
ready to execute and allocates the CPU to that process.
Pre-emptive scheduling: Once the CPU is allocated to a process, the CPU is forcefully removed from that
process due to occurrence of interrupt or completion of I/O request by the requesting process. In this
scheduling, a process changes its status from running state to ready state or waiting state to ready state.
Non-Preemptive scheduling: Once the CPU is allocated to a process, the process keeps the CPU until it
releases the CPU by terminating or by switching to the waiting state. Control of CPU is with the process to
which it is allocated.In this scheduling, a process changes its status from running to waiting or running to
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
terminate.
Q3 b Define deadlock. State the conditions necessary for deadlock 4
Answer
Deadlock: Deadlock is a situation when two or more processes get locked and cannot processed further
because of inter-dependability. In real world, deadlocks can arise when two persons wait for phone calls
from one another.
OR
Deadlock is defined as, "a situation where a set of processes are blocked because each process is holding
a resource and waiting for another resource acquired by some other process".

Necessary Conditions to Deadlock:


Mutual Exclusion: At least one resource is held in a non-sharable mode, that is only one process at a time
can use the resource. If another process requests that resource, the requesting process must be delayed
until the resource has been released. Each resource is either currently assigned to exactly one process or
is available.
Hold and Wait: There must exist a process that is holding at least one resource and is waiting to acquire
additional resources that are currently being held by another process. Process currently holding resources
granted earlier can request new resources.
No Pre-emption: Resources cannot be pre-empted; i.e. resource can only be released voluntarily by the
process holding it, after the process has completed its task. Resources previously granted cannot be
forcibly taken away from a process. They must be explicitly released by the process holding them.
Circular Wait: There exist a set (P0, P1, ----- Pn) of waiting processes such that P0 is waiting for a
resource which is held by P1, P1 is waiting for a resource which is held by P2. Pn-1 is waiting for resources
which are held by Pn and Pn is waiting for a resource which is held by P0. Thus there must be a circular
chain of two or more processes, each of which is waiting for a resource held by the next member of the
chain.
Q4 d Compare Short Job First (SJF) and Shortest Remaining Time (SRTN) scheduling algorithm 4
(any four points)
Shortest Job First (SJF) Shortest Remaining Time (SRTN)
It is a non-preemptive algorithm. It is a preemptive algorithm.
It involves less overhead than SRJF. It involves more overheads than SJF.
It leads to comparatively lower throughput. It leads to increased throughput as execution time
is less.
It minimizes the average waiting time for each It may or may not minimize the average waiting
process. time for each process.
It involves lesser number of context switching. It involves higher number of context switching.
Short processes are executed first and then Shorter processes run fast and longer processes
followed by longer processes. show poor response time.
6
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Q6 a What is the average turnaround time for the following process using : i) FCFS scheduling
algorithm ii) SJF non preemptive scheduling algorithm iii) Round Robin Scheduling algorithm
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme

Winter- Unit 4- Q1 d Define CPU bound program and I/O bound program 2
2023 CPU Answer: Refer Q2 d of Winter 2019
Scheduling Q2 d Explain following terms w.r.t. Scheduling: a) CPU Utilization b) Throughput c) Turn around 4
and time d) Waiting time
Algorithms Answer: Refer Q2 d of Winer 2022
Q3 b What is deadlock? Discuss any one method of deadlock prevention 4
Answer: Refer Q3 b of Winter 2022
Q4 d Solve given problem bys using FCFS scheduling algorithm. Draw correct Gantt Chart and 4
calculate average waiting time and average turn around time
Process Arrival Time Burst Time (in ms)
P0 0 10
P1 1 29
P2 2 3
P3 3 7
P4 4 12
Answer:

Waiting Time Turnaround Time


Waiting time of Process P0= 0 TAT of process P0=10
Waiting time of Process P1= 10-1=9 TAT of process P1=39-1=38
Waiting time of Process P2= 39-2=37 TAT of process P2=42-2=40
Waiting time of Process P3= 42-3=39 TAT of process P3=49-3=46
Waiting time of Process P4= 49-4=45 TAT of process P4=61-4=57
Average Waiting Time=26 msec Average TAT=38.02 ms
Q6 a How premptive scheduling is better than non preemptive scheduling by solving following 6
problem using SJF (solve it by using pre-emptive SJF and non pre-emptive SJF also)
Process Arrival Time Burst Time (in ms)
P1 0 8
P2 1 4
P3 2 9
P4 3 5
Answer: Refer Q6 c of Summer 2023
Summer- Unit 4- Q1 d Write the difference between preemptive and non-preemptive scheduling 2
2023 CPU Answer: Refer Q1 d of Summer 2022
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Scheduling 2
and Q1 g Define Deadlock
Algorithms Answer: Refer Q3 b of Summer 2024
Q2 c State and explain four scheduling criteria 4
Answer: Refer Q2d of Winter 2022
Q4 c Describe any four condition for deadlock 4
Answer: Refer Q3 b of Summer 2024
Q4 d Explain fixed and variable memory management 4
Answer:
Static Memory Partitioning: Main memory is divided into multiple partitions of fixed size at the time of
system generation. A process may be loaded into a partition of equal size or greater size. Partitions can be
of equal size or unequal size. Each partition in static memory partitioning, contains exactly one process. So
the number of programs to be executed (i.e. degree of multiprogramming) depends on the number of
partitions.

Advantages of Static Memory Partitioning:


• Simple to implement
• It requires minimal operating system software and processing
overhead as
• partitions are fixed at the time of system generation.
Disadvantages of Static Memory Partitioning:
• Memory wastage
• Inefficient use of memory due to internal fragmentation.
• Maximum number of active processes is fixed.

Dynamic Memory partitioning:


When a process enters in main memory, it is allocated exact size that is required by that process. So in this
method, partitions can vary in size depending on memory space required by a process entering in main
memory. Operating system maintains a table indicating which parts of memory are available and which are
occupied. When new process arrives and it needs space, system searches for available memory space in
main memory. If it is available, then memory is allocated to the process by creating a partition in memory.
Like this depending on size of process and available memory, partitions take place in main memory.
For example, assume 256K memory available and a resident monitor of 40K. This situation leaves 216K for
user programs.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme

Q5 b With neat diagram explain multilevel queue scheduling 4


Answer:
• Multilevel Queue Scheduling based on
response - time requirements. Some process
required a quick response by the processor; some
processes can wait.
• A multilevel queue scheduling algorithm
partitions the ready queue into separate queues. In
a multilevel queue scheduling processes are
permanently assigned to one queue, depending
upon their properties such as the size of the
memory or the type of the process or priority of the
process. So each queue follows a separate
scheduling algorithm.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
• In multilevel queue scheduling algorithm scheduling the processes are classified into different
groups such as System processes, Interactive processes, Interactive editing processes, Batch
processes, User processes etc.,
• The interactive processes are known as foreground processes and the batch processes are known
as background processes. These two types of processes have different response-time
requirements and so may have different scheduling needs.
Q6 c Consider the four processes P1, P2, P3 and P4 with length of CPU burst time. Find out 6
Average waiting time and Average Turn-around time for the following algorithms
1) FCFS 2) RR (Slice: 4ms) 3) SJF
Process Arrival Time Burst Time (in ms)
P1 0 8
P2 1 4
P3 2 9
P4 3 5
Answer:
Using FCFS Scheduling Algorithm
Gantt chart

Waiting Time Turnaround Time


Waiting time of Process P1= 0 TAT of process P1= 8
Waiting time of Process P2= 8- TAT of process P2= 12-1 =
1= 7 11
Waiting time of Process P3= 12- TAT of process P3= 21-2 =
2 =10 19
Waiting time of Process P4= 21- TAT of process P4= 26-3 =
3 = 18 23
Average Waiting Time Average TAT=
=(0+7+10+18)/4=35/4=8.75 ms
(8+11+19+23)/4=61/4=15.25
ms

Using Non-Preemptive SJF Scheduling Algorithm


Gantt chart

Waiting Time Turnaround Time


Waiting time of Process P1= 0 TAT of process P1= 8
Waiting time of Process P2= 8-1 = 7 TAT of process P2= 12-1 = 11
Waiting time of Process P3= 17-2 = 15 TAT of process P3= 26-2 = 24
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Waiting time of Process P4= 12-3 = 9 TAT of process P4= 17-3 = 15
Average Waiting Time=(0+7+15+9)/4=31/4=7.75 ms Average TAT=(8+11+24+15)/4=58/4=14.5 ms

Using Preemptive SJF Scheduling Algorithm


Gantt chart

Waiting Time Turnaround Time


Waiting time of Process P1= 10-1 = 9 TAT of process P1= 17
Waiting time of Process P2= 1-1 = 0 TAT of process P2= 5-1 = 4
Waiting time of Process P3= 17-2 = 15 TAT of process P3= 26-2 = 24
Waiting time of Process P4= 5-3 = 2 TAT of process P4= 10-3 = 7
Average Waiting Time=(9+0+15+2)/4=26/4=6.5 ms Average TAT=(17+4+24+7)/4=52/4=13 ms

Using Round Robin (Time Slice: 4 msec)


Gantt Chart

Waiting Time Turnaround Time


Waiting time of Process P1= 12 TAT of process P1= 20
Waiting time of Process P2= 3 TAT of process P2= 8-1=7
Waiting time of Process P3= 6+8+1=15 TAT of process P3= 26-2=24
Waiting time of Process P4= 9+8=17 TAT of process P4= 25-3=22
Average Waiting Time=(12+3+15+17)/4=47/4=11.75 ms Average TAT=(20+7+24+22)/4=73/4=18.25
ms
Winter- Unit 4 Q1 a : Define CPU and I/O burst cycle. 2M
2022 Answer:
CPU CPU Burst : It is the amount of time required by a process or can be said the amount of time required by Correct
Scheduling the process to finish. We cannot estimate the time taken by the process before running it. So most of the Definition
and problem is related to the burst time. Burst Time= Turnaround Time (Completion Time)-Waiting Time 1M each
Algorithms I/O burst cycle: It is a time when process is busy in working with I/O resources.
Q2 d: Describe different scheduling criteria. 4M
Answer:
Scheduling criteria:
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Different CPU-scheduling algorithms have different properties, and the choiceof a particular algorithm may Any four
favor one class of processes over another. In choosing which algorithm to use in a particular situation, we scheduling
must consider the properties of the various algorithms. Many criteria have been suggested for comparing criteria -1M
CPU-scheduling algorithms. The criteria include the following: each
CPU utilization: We want to keep the CPU as busy as possible. Conceptually, CPU utilization can range
from 0 to 100 percent. In a real system, it should range from 40 percent (for a lightly loaded system) to 90
percent (for a heavily used system).
Throughput: If the CPU is busy executing processes, then work is being done. One measure of work is the
number of processes that are completed per time unit, called throughput. For long processes, this rate may
be one process per hour; for short transactions, it may be ten processes per second.
Turnaround time: From the point of view of a particular process, the important criterion is how long it takes
to execute that process. The interval from the time of submission of a process to the time of completion is
the turnaround time. Turnaround time is the sum of the periods spent waiting to get into memory, waiting in
the ready queue, executing on the CPU, and doing I/0.
Waiting time: The CPU-scheduling algorithm does not affect the amount of time during which a process
executes or does I/0; it affects only the amount of time that a process spends waiting in the ready queue.
Waiting time is the sum of the periods spent waiting in the ready queue.
Response time: In an interactive system, turnaround time may not be the best criterion. Often, a process
can produce some output fairly early and can continue computing new results while previous results are
being output to the user. Thus, another measure is the time from the submission of a request until the first
response is produced. This measure, called response time, is the time it takes to start responding, not the
time it takes to output the response.The turnaround time is generally limited by the speed of the output
device.
Q3 b: Describe conditions for deadlock prevention. 4M
Answer:
By ensuring that at least one of below conditions cannot hold, we can Prevent the occurrence of a
deadlock. Any four
Eliminate Mutual Exclusion: The mutual-exclusion condition must hold for non-sharable resources. For conditions
example, a printer cannot be simultaneously shared by several processes. Sharable resources, in 1M each
contrast, do not require mutually exclusive access and thus cannot be involved in a deadlock. Read-only
files are a good example of a sharable resource. If several processes attempt to open a read-only file at
the same time, they can be granted simultaneous access to the file. A process never needs to wait for a
sharable resource. In general, however, we cannot prevent deadlocks by denying the mutual-exclusion
condition, because some resources are intrinsically non-sharable.

Eliminate Hold and Wait: Allocate all required resources to the process before the start of its execution,
this way hold and wait condition is eliminated but it will lead to low device utilization. for example, if a
process requires printer at a later time and we have allocated printer before the start of its execution printer
will remain blocked till it has completed its execution. The process will make a new request for resources
after releasing the current set of resources. This solution may lead to starvation.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme

Eliminate No Preemption: One protocol is ‘If a process that is holding some resources requests another
resources and that resources cannot be allocated to it, then it must release all resources that are currently
allocated to it. Another protocol is "When a process requests some resources, if they are available, allocate
them. If a resource it requested is not available, then we check whether it is being used or it is allocated to
some other process waiting for other resources. If that resource is not being used, then the OS preempts it
from the waiting process and allocate it to the requesting process. If that resource is used, the requesting
process must wait." This protocol can be applied to resources whose states can easily be saved and
restored (registers, memory space). It cannot be applied to resources like printers.

Circular Wait: To avoid circular wait, resources may be ordered and we can ensure that each process can
request resources only in an increasing order of these numbers. The algorithm may itself increase
complexity and may also lead to poor resource utilization. For example, set priorities for rl = 1, r2 = 2, r3 =
3, and r4 = 4. With these priorities, if process P wants to use rl and r3, it should first request rl, then T3.
Another protocol is "Whenever a process requests a resource rj, it must have released all resources rk with
priority (rk) z priority (rj).
Q4 d: Solve given problem by using SJF and FCFS scheduling algorithm using Gantt chart. 4M
Calculate the average waiting time for each algorithm.
Process Burst time (in ms) For each
P1 9 scheduling
P2 7 Gantt chart
1M, Each
P3 3
average
P4 7
waiting time
Answer:
calculation
Gantt Chart SJF
1M
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Waiting Time= Turnaround time – Burst Time
P1==26-9= 17
P2=10-3= 3
P3=3-3= 0
P4=17-7 = 10
Average waiting time=Waiting time of all processes / Number of
processes
=(17+3+0+10) /4
=30/4
=7.5 milliseconds (ms)

Gantt Chart FCFS

Waiting Time= Turnaround time – Burst Time

P1=9-9=0
P2=16-7=9
P3=19-3=16
P4=26-7=19
Average waiting time=Waiting time of all processes / Number of processes
=(0+9+16+19) /4
=44/4
=11 milli seconds (ms)
Q6 a : Solve given problem by using (i) Pre-emptive SJF (ii) Round Robin (Time Slice = 3 ms) 6M
Calculate average waiting time using Gantt Chart.
Process A.T. B.T. (in ms)
P11 0 8
P12 1 4
P13 2 9
Each
P14 3 5
method 3M
- 1M for
Answer:
Gantt chart,
(i) Pre emptive SJF:
1M for
P11 P12 P12 P12 P14 P11 P13 Waiting
0 1 2 3 5 10 17 26 time
calculation,
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Waiting time = Turnaround time- burst time 1M for
P11= (17-0)-8=9 Average
P12= (5-1)-4=0 waiting
P13=(26-2)-9=15 time
P14=(10-3)-5=2
Average waiting time :- (9+0+15+2)/4= 26/4=6.5 ms

(ii) Round Robin (Time Slice = 3 ms)


P11 P12 P13 P14 P11 P12 P13 P14 P11 P13
0 3 6 9 12 15 16 19 21 23 26
Waiting time= Turnaround time- burst time
P11 = (23-0)-8 =15ms,
P12-(16 – 1)- 4 =11ms,
P13-(26-2)-9 =15ms,
P14-(21-3)-5 =13ms
Average waiting time:- (15+11+15+13)/4=54/4= 13.5ms
Summer- Unit 4 Q1 d State difference between preemptive scheduling and non-preemptive scheduling. 4M
2022 Answer:
CPU Preemptive Scheduling Non-Preemptive Scheduling
Scheduling
and Processor can be preempted to execute a different Once Processor starts to execute a process it must
Algorithms
process in the middle of execution of any current finish it before executing the other. It cannot be Any four
process. paused in middle. points 1M
each
CPU utilization is more compared to Non-Preemptive CPU utilization is less compared to Preemptive
Scheduling. Scheduling.

Waiting time and Response time is less. Waiting time and Response time is more.

The preemptive scheduling is prioritized. The highest When a process enters the state of running, the
priority process should always be the process that is state of that process is not deleted from the
currently utilized. scheduler until it finishes its service time.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
If a process with long burst time is running CPU,
If a high priority process frequently arrives in the
then another process with less CPU burst time may
ready queue, low priority process may starve.
starve.

Preemptive scheduling is flexible. Non-preemptive scheduling is rigid.

Ex:- SRTF, Priority, Round Robin, etc. Ex:- FCFS, SJF, Priority, etc.

Q2 d State and describe any two scheduling criteria. 4M


Answer: Refer Q2d of Winter 2022 Any two
scheduling
criteria -1M
each
Q3 b Describe prevention of deadlock occurrence with respect to hold and wait necessary 4M
condition.
Answer: Any two
prevention
point of hold
and wait 1M
each

Eliminate Hold and Wait:


a) Allocate all required resources to the process before the start of its execution, this way hold and wait
condition is eliminated but it will lead to low device utilization. for example, if a process requires printer at a
later time and we have allocated printer before the start of its execution printer will remain blocked till it has
completed its execution.
b) The process will make a new request for resources after releasing the current set of resources. This
solution may lead to starvation.
4M
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Q4 d Write steps required for Banker’s algorithm to avoid deadlock.
Answer:
Let Request i be the request array for process Pi. Request i [j] = k means process Pi wants k instances of
resource type R j. When a request for resources is made by process Pi, the following actions are taken: Correct
1) If Request i<= Need i algorithm
Goto step (2) ; otherwise, raise an error condition, since the process has exceeded its maximum claim. m 4M
2) If Request i<= Available
Goto step (3); otherwise, Pi must wait, since the resources are not available.
3) Have the system pretend to have allocated the requested resources to process Pi by modifying the state
as follows:
Available = Available – Request i
Allocation i = Allocation i + Request i
Need i = Need i– Request i
Examples:
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme

Q5 a Calculate average waiting time for following data using First Come First Served (FCFS) and 6M
Shortest Job First (SJF) algorithms.
Process Burst time Arrival time
P0 08 0
P1 04 1
P2 05 2
P3 03 3

Gantt chart for FCFS


Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme

P0 P1 P2 P3
Each
0 8 12 17 20 method 3M -
1M for Gantt
Waiting time= Turnaround time (Completion time- Arrival time)- Burst time chart, 1M for
P0=(8-0)-8=0 Waiting time
P1=(12-1)-4=7 calculation,
P2= (17-2)-5=10 1M for
P3=(20-3)-3= 14 Average
Avg WT=(0+7+10+14)/4=7.75 ms waiting time
Gantt Chart for SJF
P0 P1 P1 P3 P1 P2 P0
0 1 2 3 6 8 13 20

Waiting time= Turnaround time (Completion time- Arrival time)- Burst time
P0=(20-0)-8=12
P1=(8-1)-4=3
P2= (13-2)-5=6
P3=(6-3)-3= 0
Avg WT= (12+3+6+0)/4=5.25 ms
Winter- Unit 4 Q1 d Explain any four scheduling criteria. 4M
2019 Answer: Refer Q2d of Winter 2022 Any four
CPU scheduling
Scheduling criteria -1M
and each
Algorithms
Q2 d Describe I/o burst and CPU burst cycle with neat diagram. 4M
Answer: Explanation:
2 marks,
CPU-I/O Burst Cycle: The success of CPU scheduling depends on an observed property of processes:
Diagram:2
process execution consists of a cycle of CPU execution and I/0 wait.
marks
CPU Burst : It is the amount of time required by a process or can be said the amount of time required by
the process to finish. We cannot estimate the time taken by the process before running it. So most of the
problem is related to the burst time.
I/O burst cycle: It is a time when process is busy in working with I/O resources.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme

• In a single-processor system, only one


process can run at a time; any others must wait until
the CPU is free and can be rescheduled.
• The objective of multiprogramming is to have
some process running at all times, to maximize CPU
utilization. The idea is relatively simple. A process is
executed until it must wait, typically for the
completion of some I/O request.
• When one process has to wait, the operating
system takes the CPU away from that process and
gives the CPU to another process. This pattern
continues. Every time one process has to wait,
another process can take over use of the CPU.
• Scheduling of this kind is a fundamental
operating-system function. Almost all computer
resources are scheduled before use. The CPU is, of
course, one of the primary computer resources.
Thus, its scheduling is central to operating-system
design.

Objectives of Process Scheduling Algorithm


1. Max CPU utilization [Keep CPU as busy as possible]
2. Fair allocation of CPU.
3. Max throughput [Number of processes that complete their execution per time unit]
4. Min turnaround time [Time taken by a process to finish execution]
5. Min waiting time [Time a process waits in ready queue]
6. Min response time [Time when a process produces first response]
Q3 b Explain deadlock? What are necessary conditions for deadlock? 4M
Answer:
A process requests resources; if the resources are not available at that time, the process enters a waiting Deadlock
state. Sometimes, a waiting process is never again able to change state, because the resources it has description-
requested are held by other waiting processes. This situation is called a deadlock. 2M,
Necessary Conditions: A deadlock situation can arise if the following four conditions hold simultaneously necessary
in a system: conditions -
Mutual exclusion: At least one resource must be held in a non-sharable mode; that is, only one process at 1/2 M each
a time can use the resource. If another process requests that resource, the requesting process must be
delayed until the resource has been released.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Hold and wait: A process must be holding at least one resource and waiting to acquire additional resources
that are currently being held by other processes.
No preemption: Resources cannot be preempted; that is, a resource can be released only voluntarily by the
process holding it, after that process has completed its task.
Circular wait: A set { P0 , Pl, ... , P11 } of waiting processes must exist such that Po is waiting for a
resource held by P1, P1 is waiting for a resource held by P2, ... , Pn-1 is waiting for a resource held by P, v
and P11 is waiting or a resource held by Po.
Q4 d Explain Round Robin algorithm with suitable example. 4M
Solution :
Round Robin Scheduling- In Round Robin Scheduling, explanation
of round
• CPU is assigned to the process on the basis of FCFS for a fixed amount of time.
robin -2M,
• This fixed amount of time is called as time quantum or time slice. example-2M
• After the time quantum expires, the running process is preempted and sent to the ready
queue.
• Then, the processor is assigned to the next arrived process.
• It is always preemptive in nature.
Round Robin Scheduling is FCFS Scheduling with preemptive mode.
Advantages-
• It gives the best performance in terms of average response time.
• It is best suited for time sharing system, client server architecture and interactive system.
Disadvantages: It leads to starvation for processes with larger burst time as they have to repeat the cycle
many times. Its performance heavily depends on time quantum. Priorities cannot be set for the processes.
Round Robin Scheduling Example
Here is the Round Robin scheduling example with gantt chart. Time
Quantum is 5ms.

T
Turnaround time=Completion time –Arrival time
P1=44-0=44
P2=21-0=21
P3=24-0=24
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Waiting time = TAT-Burst time
P1=44-30=14
P2=21-6=15
P3=24-8=16

Q6 a The jobs are scheduled for execution as follows 6M


Process Arrival Time Burst Time
P1 0 7
P2 1 4 SJF 3M
P3 2 10 FCFS 3M
P4 3 6 (1m-gantt
P5 4 8 chart, 2m
Solve the problem using: (i) SJF (ii) FCFS Also find average waiting time using Gantt chart. calculation
Solution : of AWT)
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme

Summer- Unit 5- Q1 e Define following terms:i. Memory compaction ii. Fragmentation 2


2024 Memory i. Memory compaction: The process of shuffling the memory contents so as to place all free
Management memory together in one large block is known as memory compaction.
ii. ii. Fragmentation: When processes are loaded and removed from memory, the free memory
space is broken into little pieces which is known as fragmentation.
Q3 c Explain the following terms with respect to memory management: i) Dynamic relocation ii) 4
Swapping
Answer:
iii) Dynamic Relocation: When a program gets swapped out to a disk memory, then it is not
always possible that when it is swapped back into main memory then it occupies the previous
memory location, since the location may still be occupied by another process. We may need
to relocate the process to a different area of memory. Thus there is a possibility that program
may be moved in main memory due to swapping.
ii) Swapping: Swapping is mechanism in which a process can be swapped temporarily out of main
memory (or move) to secondary storage (disk) and make that memory available to other processes. At
some later time, the system swaps back the process from the secondary storage to main memory.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme

Q4 e Describe variable partitioning with the help of suitable example 4


Answer:
In variable memory partitioning the partitions can vary in number and size. In variable memory partitioning
the amount of memory allocated is exactly the amount of memory a process requires. The operating
system keeps a table indicating which parts of memory are available and which are occupied. Initially all
memory is available for user programs and is considered as one large block of available memory, a hole.
• When a job arrives and needs memory, we search for a hole large. enough for this job. If we find one, we
allocate only as much as is needed, keeping the rest available to satisfy future requests.
For example, assume 256K memory available and a resident monitor of 40K. This situation leaves 216K for
user programs.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme

Q5 c Consider the string: 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7 with frame size 3 and 4, calculate 6


page fault in both the cases using FIFO algorithm
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme

Q5 b Explain bit map vector and linked list free space management techniques with its advantages 6
and disadvantages
1)Bitmap Vector: The free-space list is implemented as a bit map or bit vector. Each block is represented
by 1 bit. If the block is free, the bit is 1; if the block is allocated, the bit is 0. For example, consider a disk
where blocks 2, 3, 4, 5, 8, 9, 10, 11, 12, 13 are free and the rest of the blocks are allocated.
The free-space bit map would be : 0011110011111100

1=Free block 0= Allocated block


The main advantage of this approach is its relative simplicity and its efficiency in finding the first free block
or n consecutive free blocks on the disk.
Advantages of Bit Map vector method
1. Simple and easy to understand.
2. Consumes less memory.
3. It is efficient to find free space.
Disadvantages of the Bit Map vector method
1. The operating system goes through all the blocks until it finds a free block.
2. It is not efficient when the disk size is large.

2) Linked List: In this approach, the free disk blocks are linked together i.e. a free block contains a pointer
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
to the next free block. The block number of the very first disk block is stored at a separate location on disk
and is also cache in memory. In this approach, link all the disk blocks together, keeping a pointer to the first
free block. This block contains a pointer to the next free disk block, and so on.
Advantages of linked list:
1. Files can be extended, no fragmentation problems.
2. Sequential Access is easy: just chase links.
3. No extra space for the free list.
4. Starting and ending of the file can be easily found
out by the linked list.
Disadvantages of linked list:
1. Cannot be effectively used for direct access
method.
2. Random access is virtually impossible. Lots of
seeking, even in sequential access.
3. Pointers which are required need additional memory
space.
4. It is not reliable as the blocks are scattered on the
disk anywhere.

Winter- Unit 5- Q1 d Define Paging and Segmentation 2


2023 Memory Paging: Paging is a storage mechanism used in OS to retrieve processes from secondary storage to the
Management main memory as pages.
Segmentation: Segmentation is a memory administration approach used in operating systems that divides
memory into multiple-sized segments.
Q3 c Describe concept of free space management techniques using bit map method 4
Answer: Refer Q5 b of Summer 2024
Q4 e Which hole is taken for next segment request for 8KB in a swapping system for First fit, Best 4
fit and Worst fit.
OS
4 KB
9 KB
20 KB
16 KB
8 KB
2 KB
6 KB
Answer
First Fit Best Fit Worst Fit
8KB 9 KB 9 KB 20 KB
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Q5 c Find out the total number of Page faults using: 1) Least recently used page replacement 2) 6
Optimal page replacement. Page replacement algorithms of memory management, if the page are
coming in the order 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1
Answer: Refer Q5c of Winter 2022
Q6 b List free space management technique with the help of neat diagram, explain any one 6
technique in detail
Answer: Refer Q5b of Summer 2024
Summer- Unit 5- Q1 e Define following terms: 1) Virtual Memory 2) Paging 2
2023 Memory Virtual Memory:
Management • Virtual Memory is a storage scheme that provides user an illusion of having a very big main
memory.
• Virtual memory is a method that computers use to manage storage space to keep systems running
quickly and efficiently.
• Virtual Memory is a storage scheme that provides user an illusion of having a very big main
memory.

Paging: Paging is a memory management scheme that eliminates the need for a contiguous allocation of
physical memory. The process of retrieving processes in the form of pages from the secondary storage into
the main memory is known as paging.
Q2 d Define Fragmentation? Explain internal and external fragmentation 4
Fragmentation: Fragmentation is an unwanted
problem in the operating system in which the
processes are loaded and unloaded from
memory, and free memory space is fragmented.
Processes can't be assigned to memory blocks
due to their small size, and the memory blocks
stay unused.
Internal Fragmentation: Whenever a memory
block gets allocated with a process, and in case
the process happens to be smaller than the
total amount of requested memory, a free space
is ultimately created in this memory block. And
due to this, the memory block’s free space is unused. This is what causes internal fragmentation.

External Fragmentation: External fragmentation occurs whenever a method of dynamic memory


allocation happens to allocate some memory and leave a small amount of unusable memory. The total
quantity of the memory available is reduced substantially in case there’s too much external fragmentation.
So, there’s enough memory space in order to complete a request, and it is not contiguous. Thus, it is
known as external fragmentation.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme

Q4 d Differentiate between Paging and Segmentation (any four points) 4


Answer: Refer Q1 e of Winter 2022
Q6 b for the page reference string: 7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1 Calculate the page faults 6
applying Optimal b) LRU c)FIFO page replacement algorithms for a memory with three frames.
Using FIFO Page Replacement Algorithm:
Answer:

Page Fault=15
Using LRU Page Replacement Algorithm

Page Faults= 12
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Winter- Unit 5 Q1 e Differentiate between paging and segmentation. 2M
2022 Answer:
Memory Parameters Paging Segmentation
Management
Individual In Paging, we break a process In the case of Segmentation, we break a
Memory address space into blocks known as process address space into blocks known
pages. as sections.
Memory Size The pages are blocks of fixed size. The sections are blocks of varying sizes.
Accountability The OS divides the available memory The compiler mainly calculates the size of Any two
into individual pages. individual segments, their actual address as relevant
well as virtual address. differences
– 1M each
Speed This technique is comparatively much This technique is comparatively much
faster in accessing memory. slower in accessing memory than Paging.
Size The available memory determines the The user determines the individual segment
individual page sizes. sizes.

Fragmentation The Paging technique may The Segmentation technique may not use
underutilize some of the pages- thus some of the memory blocks at all. Thus, it
leading to internal fragmentation. may lead to external fragmentation.

Logical A logical address divides into page A logical address divides into section offset
Address offset and page number in the case of and section number in the case of
Paging. Segmentation.
Data Storage In the case of Paging, the page table In the case of Segmentation, the
leads to the storage of the page data. segmentation table leads to the storage of
the segmentation data.
Q3 c Explain fixed size memory partitioning.
Answer:
• Fixed Size Memory Partitioning (Static)
• Memory is divided into number of fixed size partitions, which is called as fixed or static memory
partitioning.
• Each partition contains exactly one process.
• The number of programs to be executed depends on number of partitions.
• When the partition is free, a selected process from the input queue is loaded into the free partition.
• When the process terminates, the partition becomes available for another process.
• The operating system keeps a table indicating parts of memory which are available and which are
occupied.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
• Initially, all memory is available for user processes and it is considered as one large block of available
memory, a hole.
• When a process arrives, large enough hole of memory is allocated to the processes.
Q4 e Describe free space management technique. (Any two). 4M
Answer:
A file system is responsible to allocate the free blocks to the file therefore it has to keep track of all the free
blocks present in the disk. There are mainly four approaches by using which, the free blocks in the disk are Any 2
managed. techniques
1. Bit Vector Correct
2. Linked List Explanation
2M each
1 )Bit Vector:
The free-space list is implemented as a bit map or bit vector. Each block is represented by 1 bit. If the block
is free, the bit is 1; if the block is allocated, the bit is 0.
For example, consider a disk where blocks 2, 3, 4, 5, 8, 9, 10, 11, 12,13 are free and the rest of the blocks
are allocated.
The free-space bit map would be : 0011110011111100

1=Free block
0= Allocated block
The main advantage of this approach is its relative simplicity and its efficiency in finding the first free block
or n consecutive free blocks on the disk.

2) Linked List
In this approach, the free disk blocks are linked together i.e. a free block contains a pointer to the next free
block. The block number of the very first disk block is stored at a separate location on disk and is also
cached in memory. In this approach, link all the disk blocks together, keeping a pointer to the first free
block. This block contains a pointer to the next free disk block, and so on
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme

Q5 c Given a page reference string with three (03) page frames. Calculate the page faults with 6M
‘Optimal’ and ‘LRU’ page replacement algorithm respectively. 7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1
Answer: Calculation
of page fault
with relevant
diagram- 3M
each
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Q6 b Consider the following memory map and assume a new process P4 comes with memory 6M
requirements of 6 KB. Locate (Draw) this process in memory using. (i) First fit (ii) Best Fit (iii)
Worst fit.
Answer:
Each fit
O.S. diagram 2M
P1
<FREE> 12 KB
P2
<FREE> 19 KB
P3
<FREE> 7KB
Memory

Summer- Unit 5 Q1 e Define the term fragmentation in terms of memory. 2M


2022 Answer:
Memory Memory space in the system constantly goes through loading and releasing processes and their resources
Management because of which the total memory spaces gets broken into a lot of small pieces, this causes creation small 2M for
non utilized fragmented memory spaces, which are so small that normal processes cannot fit into those Correct
small fragments, causing those memory spaces not getting utilized at all, this is called memory Definition
Fragmentation in operating system.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Q3 c with suitable diagram, describe the concept of variable partitioning of memory. 4M
Answer:
Variable Partitioning: Dynamic partitioning tries to overcome the problems caused by fixed partitioning. In
this technique, the partition size is not declared initially. It is declared at the time of process loading.The
first partition is reserved for the operating system. The remaining space is divided into parts. The size of
each partition will be equal to the size of the process. The partition size varies according to the need of the
process so that the internal fragmentation can be avoided.

1M for
diagram and
Explanation
of Variable
partitioning
-3M

Advantages of Dynamic Partitioning over fixed partitioning


1. No Internal Fragmentation: Given the fact that the partitions in dynamic partitioning are created
according to the need of the process, It is clear that there will not be any internal fragmentation
because there will not be any unused remaining space in the partition.
2. No Limitation on the size of the process: In Fixed partitioning, the process with the size greater than
the size of the largest partition could not be executed due to the lack of sufficient contiguous memory.
Here, In Dynamic partitioning, the process size can't be restricted since the partition size is decided
according to the process size.
3. Degree of multiprogramming is dynamic: Due to the absence of internal fragmentation, there will not
be any unused space in the partition hence more processes can be loaded in the memory at the same
time.
Q4 e with suitable example, describe any one free space management technique. 4M
Answer:
The process of looking after and managing the free blocks of the disk is called free space management.
There are some methods or techniques to implement a free space list. These are as follows:
• Bitmap
• Linked list
• Grouping
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
• Counting
Bitmap: This technique is used to implement the free space management. When the free space is explanation
implemented as the bitmap or bit vector then each block of the disk is represented by a bit. When the block of any one
is free its bit is set to 1 and when the block is allocated the bit is set to 0. The main advantage of the bitmap technique
is it is relatively simple and efficient in finding the first free block and also the consecutive free block in the 2M and
disk. Many computers provide the bit manipulation instruction which is used by the users. correct
The calculation of the block number is done by the formula: example
(number of bits per words) X (number of 0-value word) + Offset of first 1 bit 2M
For Example: Apple Macintosh operating system uses the bitmap method to allocate the disk space.
Assume the following are free. Rest are allocated:

Advantages:
• This technique is relatively simple.
• This technique is very efficient to find the free space on the disk.
Disadvantages:
• This technique requires a special hardware support to find the first 1 in a word it is not 0.
• This technique is not useful for the larger disks.
For example: Consider a disk where blocks 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 17, 18, 25,26, and 27 are free
and the rest of the blocks are allocated. The free-space bitmap would be:
001111001111110001100000011100000
Linked list: This is another technique for free space management. In this linked list of all the free block is
maintained. In this, there is a head pointer which points the first free block of the list which is kept in a
special location on the disk. This block contains the pointer to the next block and the next block contain the
pointer of another next and this process is repeated. By using this disk it is not easy to search the free list.
This technique is not sufficient to traverse the list because we have to read each disk block that requires
I/O time. So traversing in the free list is not a frequent action.

Advantages:
• Whenever a file is to be allocated a free block, the operating system can simply allocate the first
block in free space list and move the head pointer to the next free block in the list.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Disadvantages:
• Searching the free space list will be very time consuming; each block will have to be read from the
disk, which is read very slowly as compared to the main memory.
• Not Efficient for faster access.
In our earlier example, we see that keep block 2 is the first free block which points to another block which
contains the pointer of the 3 blocks and 3 blocks contain the pointer to the 4 blocks and this contains the
pointer to the 5 block then 5 block contains the pointer to the next block and this process is repeated at the
last .
Grouping: This is also the technique of free space management. In this, there is a modification of the free-
list approach which stores the address of the n free blocks. In this the first n-1 blocks are free but the last
block contains the address of the n blocks. When we use the standard linked list approach the addresses
of a large number of blocks can be found very quickly. In this approach, we cannot keep a list of n free disk
addresses but we keep the address of the first free block.
Q5 c Describe the concept of virtual memory with respect to paging. Also draw paging hardware 6M
diagram and describe its working with example.
Answer:
Virtual Memory:
• Virtual memory is a technique that allows the execution of process that are not completely present 2M for
in main memory. Virtual
• Virtual memory makes the users view of memory which is larger than actual size of main memory. Memory
• Virtual memory makes the task of programming much easier because the programmer no longer concept
2M for
needs to worry about the amount of physical memory available.
diagram and
• Virtual memory is commonly implemented by Demand Paging. 2M for
• Rather than bringing the entire process in the memory we use a lazy swapper. description
• A lazy swapper swaps in a page into main memory only when it is needed this is known as of paging
Demand Paging.

Paging:
• Paging is memory management technique
• It allows the allocation of a process to be non-contiguous.
• Physical memory is divided into fixed size blocks called as a frame.
• Logical memory is divided into fixed size block called pages
• Size of page is same as size of frame
• Each process is needs to maintain a page table
• The page table is used for mapping purpose
• When the execution of process begins its pages are loaded into memory frames
• The translation of logical address to physical address is done in paging.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme

• The address generated by the CPU is known as logical address


• The logical address consists of

i)Page Number
ii)Offset
• The Page number id used to make an entry into the page table
• Page table contains the frame number in which the page is loaded.
• Page offset is added with the base address of the frame number to get the physical address.

Advantages:
• On the programmer level, paging is a transparent function and does not require intervention.
• Frames do not have to be contiguous.
• Easy to use memory management algorithm
• Swapping is easy between equal-sized pages and page frames.
Disadvantages:
• Paging causes internal fragmentation on older systems.
• Longer memory lookup times compared to segmentation
• It may cause internal fragmentation
• Complex memory management algorithm
• Page tables consume additional memory.
• Multi-level paging may lead to memory reference overhead.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Q6 b Q6 b Consider the following page reference string arrival with three page frames:-5, 6, 7, 8, 9, 6M
7, 8, 5, 9, 7, 8, 7, 9, 6, 5, 6 Calculate number of page faults with optimal and FIFO (First In First Out)
page replacement algorithms.
Answer:
Optimal-
5 6 7 8 9 7 8 5 9 7 8 7 9 6 5 6
5 5 5 5 9 9 9 6 6 Calculation
6 6 8 8 5 8 8 5 of page fault
7 7 7 7 7 7 7 with relevant
H H H H H H H diagram- 3M
Total Page fault=9 each

FIFO -
5 6 7 8 9 7 8 5 9 7 8 7 9 6 5 6
5 5 5 8 8 8 7 7 7 6 6
6 6 6 9 9 9 8 8 8 5
7 7 7 5 5 5 9 9 9
H H H H H
Total Page fault=11
Winter- Unit 5 Q1 e Define virtual memory. 2M
2019 Answer:
Memory Virtual memory is a memory management capability of an operating system (OS) that uses hardware and
Management software to allow a computer to compensate for physical memory shortages by temporarily transferring 2M for
data from random access memory (RAM) to disk storage. Correct
OR Definition
Virtual memory is the separation of user logical memory from physical memory. This separation allows an
extremely large virtual memory to be provided for programmers when only a smaller physical memory is
available. Virtual memory makes the task of programming much easier, because the programmer no longer
needs to worry about the amount of physical memory available, or about what code can be placed in
overlays, but can concentrate instead on the problem to be programmed.
Q3 c Explain partitioning and its types. 4M
Answer:
An important operation of memory management is to bring programs into main memory for execution by Explanation
the processor. Partitioning is a technique that divides a memory into multiple partitions. These partitions of fixed
can be of different size or same size. partitioning
Types of partitioning -2M,
• Fixed partitioning i.e. static partitioning Variable
• Variable partitioning i.e. dynamic partitioning partitioning-
2M
Fixed Partitioning: Main memory is divided into multiple partitions of fixed size at the time of system
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
generation. A process may be loaded into a partition of equal size or greater size. Partitions can be of
equal size or unequal size. Equal size partitioning: Main memory is divided into equal size partitions. Any
process with less or equal size can be loaded in any available partition.

Q5 c Explain LRU page replacement algorithm for following reference string. 6M


70120304230321201701 Calculate the page fault.
Answer:
Least Recently Used Page Replacement Algorithm (LRU):
• The Least Recently Used (LRU) page replacement policy replaces the page that has not been
used for the longest period of time.
• LRU replacement associates with each page the time of that page's last use. LRU
• When a page must be replaced, LRU chooses the page that has not been used for the longest explanation
2M
period of time.
Calculation
• The LRU policy is often used as a page-replacement algorithm and is considered to be good. 4M
• An LRU page-replacement algorithm may require substantial hardware assistance.
Counters:
• In the simplest case, we associate with each page-table entry a time-of-use field and add to the
CPU a logical clock or counter.
• The clock is incremented for every memory reference.
• Whenever a reference to a page is made, the contents of the clock register are copied to the time-
of-use field in the page- table entry for that page.
• In this way, we always have the "time" of the last reference to each page. We replace the page with
the smallest time value.
Stack:
• Another approach to implementing LRU replacement is to keep a stack of page numbers.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
• Whenever a page is referenced, it is removed from the stack and put on the top.
• In this way, the most recently used page is always at the top of the stack and the least recently
used page is always at the bottom.

Q6 b List free space management techniques? Describe any one in detail. 6M


Answer: A file system is responsible to allocate the free blocks to the file therefore it has to keep track of all
the free blocks present in the disk.
There are mainly four approaches by using which, the free blocks in the disk are managed.
• Bit Vector Listing 1M,
• Linked List Explanation
• Grouping of any one
3M ,
• Counting
Diagram 2M
Bit Vector:
• The free-space list is implemented as a bit map or bit vector.
• Each block is represented by 1 bit. If the block is free, the bit is 1; if the block is allocated, the bit is
0.
• For example, consider a disk where blocks
• 2, 3, 4, 5, 8, 9, 10, 11, 12, 13 are free and the rest of the blocks are allocated.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
• The free-space bit map would be : 0011110011111100

The main advantage of this approach is its relative simplicity and its
efficiency in finding the first free block or n consecutive free blocks on
the disk.
Linked List
• In this approach, the free disk blocks are linked together i.e. a free block contains a pointer to the
next free block.
• The block number of the very first disk block is stored at a separate location on disk and is also
cached in memory.
• In this approach, link all the disk blocks together, keeping a pointer to the first free block.
• This block contains a pointer to the next free disk block, and so On

Summer- Unit 6- Q1 f Write syntax of PWD command and explain its use with the help of suitable example. 2
2024 File Syntax: $ pwd PWD command is used to print (display) current working directory.
Management Example: $ pwd Above example displays absolute pathname. Output: /home/poly
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Q1 g List any four file operations. 2
• Creating a file
• Writing a file
• Reading a file
• Repositioning within a file
• Deleting a file
• Appending new information to the end of the file
• Renaming an existing file.
• Truncating a file
• Creating copy of a file, copy file to another I/O device such asprinter or display

Q3 d With suitable diagram, explain how contiguous file allocation is performed? 4


The contiguous allocation method requires each file to occupy a set of contiguous addresses on the disk.
Disk addresses define a linear ordering on the disk. Contiguous allocation of a file is defined by the disk
address of the first block and its length. If the file is ‘n’ blocks long and starts at location ‘b’, then it occupies
blocks b, b+1, b+2, - - - - - b+n-1. The directory entry for each file indicates the address of the starting block
and the length of the area allocated for this file. Contiguous allocation supports both sequential and direct
access. For direct access to block ‘i’ of a file, which starts at block ‘b’, we can immediately access block
b+i. The difficulty with contiguous allocation is finding space for a new file. For direct access to block ‘i’ of a
file, which starts at block ‘b’, we can immediately access block b+i. The difficulty with contiguous allocation
is finding space for a new file. If file to be created are ‘n’ blocks long, we must search free space
list for ‘n’ free contiguous blocks.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Q6 c Explain with diagram single level directory structure and two level directory structure with its 6
advantages and disadvantages.
Answer: Single Level Directory Structure: This is the simplest directory structure. All the files are stored in
the same directory which is easy to support and understand. But a unique name must be assigned to each
file. If the number of files in the directory increases, it may become difficult to remember names of all files.
Advantage:
• Less time required to search the file, because all files are stored in same directory.
• Single level directory structure is easy to implement and maintain.
• Single level directory structure, the operations like creation, searching, deletion, updating are very
easy and faster

Disadvantages
• Not suitable for a large number of files and more than one user.
• Because of single directory files, files require unique file names.
• Difficult to remember names of all the files as the number of files increases. MS-DOS OS allows
only 11 character file name where as UNIX allows 255 character

Two-level directory structure: -In the two-level structures, each user has its own user file directory (UFD).
The UFD lists only files of a single user. System contains a master file directory (MFD) which is indexed by
user name or account number. Each entry in MFD points to the UFD for that user. When a user refers to a
particular file, only his own UFD is searched. Different users can have files with the same name, as long as
all the file names within each UFD are unique. When we create a file for a user, operating system searches
only that user’s UFD to find whether same name file already present in the directory. For deleting a file
again operating system checks the file name in the user’ UFD only.
Advantages:
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
• It solves isolation. i.e. data of one user is separated from other user.
• Searching is also efficient in this type of structure.
• Every user accesses his own directory and files.
• There is no problem of files with same names in different directories.

Disadvantages:
• Two users can not share data or communicate with each other.
• It is difficult to search the files with same names in different directories.

Winter- Unit 6- Q1 g List any four file operations 2


2023 File Answer: Refer Q1g of Winter 2022
Management
Q3 d Draw the diagram of linked file allocation method and explain it 4
Answer: Refer Q3 d of Winter 2022
Q6 c Draw and explain directory structure of a file systemin terms of single level, two level and tree 6
structure.
Refer Q6 c of Summer 2024
Refer Q6 c of winter 2022
Summer- Unit 6- Q1 f List any four file attributes and its meaning 2
2023 File Answer: Refer Q1 g of Winter 2019
Management
Q3 d Explain two level directory structure with suitable diagram 4
Answer: Refer Q6c of Summer 2024
Q6 a List file allocation method and explain any one in details 6
Answer: Refer Q3 d of Summer 2024
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Winter- Unit 6 Q1 g :List any four file operations 2M
2022 Answer:
File List any four file operations.
Management • Creating a file Any four
• Writing a file: operations
• Reading a file: ½ M each
• Repositioning within a file
• Deleting a file
• Appending new information to the end of the file
• Renaming an existing file.
• Creating copy of a file, copy file to another I/O device such as printer or display

Q3 d : Explain linked file allocation method. 4M


Answer:
Linked Allocation:

Correct
explanation
3M, 1M for
Diagram

Figure of Linked file Allocation


• This allocation is on the basis of an individual block. Each block contains a pointer to the next block in
the chain.
• The disk block can be scattered anywhere on the disk.
• The directory contains a pointer to the first and the last blocks of the file.
• To create a new file, simply create a new entry in the directory.
• The following figure shows the linked allocation.
• There is no external fragmentation since only one block is needed at a time.
• The size of a file need not be declared when it is created.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
• A file can continue to grow as long as free blocks are available
• This method is used only for a sequential access files
• This method requires more space to store pointers
• So instead of blocks, clusters are used for allocation but this creates internal fragmentation.
Q6 c : Construct and explain directory structure of a file system in terms of two level and tree 6M
structure.
Answer:
1) Two-level directory: -

Explanation
of structure
2M each,
• In the two-level structures, each user has its own user file directory (UFD). The UFD lists only files of Construction
a single user. of structure
• System contains a master file directory (MFD) which is indexed by user name or account number. 1M each
Each entry in MFD points to the UFD for that user.
• When a user refers to a particular file, only his own UFD is searched. Different users can have files
with the same name, as long as all the file names within each UFD are unique.
• When we create a file for a user, operating system searches only that user’s UFD to find whether
same name file already present in the directory. For deleting a file again operating system checks the
file name in the user’ UFD only.

2) Tree structure:-

• In this directory structure user can create their own sub-directories and organize their files. The tree has
a root directory and every file has a unique path name.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
• A directory contains a set of files or subdirectories. All directories have the same internal format. One bit
in each directory entry defines the entry as a file (0) or as a subdirectory (1).
• Each process has a current directory. Current directory contains files that are currently required by the
process.
• When reference is made to a file, the current directory is searched. If a file needed that is not in the
current directory, then the user usually must either specify a path name or change the current directory.
Summer- Unit 6 Q1 g :List any four operations performed on a file. 2M
2022 File Answer:
Management List any four file operations.
• Creating a file Any four
• Writing a file: operations
• Reading a file: ½ M each
• Repositioning within a file
• Deleting a file
• Appending new information to the end of the file
• Renaming an existing file.
• Creating copy of a file, copy file to another I/O device such as printer or display
Q3 d : Explain linked file allocation method. 4M
Answer:
Linked Allocation:

Correct
explanation
2M, 1M for
Diagram
and 1M for
Advantages

Figure of Linked file Allocation


• This allocation is on the basis of an individual block. Each block contains a pointer to the next block
in the chain.
• The disk block can be scattered anywhere on the disk.
• The directory contains a pointer to the first and the last blocks of the file.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
• To create a new file, simply create a new entry in the directory.
• The following figure shows the linked allocation.
• There is no external fragmentation since only one block is needed at a time.
• The size of a file need not be declared when it is created.
• A file can continue to grow as long as free blocks are available
• This method is used only for a sequential access files
• This method requires more space to store pointers
• So instead of blocks, clusters are used for allocation but this creates internal fragmentation.
Advantages:
• This is very flexible in terms of file size. File size can be increased easily since the system does not
have to look for a contiguous chunk of memory.
• This method does not suffer from external fragmentation. This makes it relatively better in terms of
memory utilization.
• File can continue to grow as long as the free blocks are available.
• Directory entry will only contain the starting block address.

Q5 a : Describe following directory structures in short with neat sketches: i) Single level ii) Two 4M
level iii) Tree structured
Answer:
1) Single level directory structure: For each
Correct
explanation
1M and1M
for Diagram

• It is the simplest form of directory structure, having one directory containing all the files, and
each file must have a unique name.
• Software design is simple. The advantages of this scheme are its simplicity and the ability to
locate files quickly.
• Since all files are in the same directory, they must have unique names. If there are two users
who call their data file "test", then the unique-name rule is violated.
• Even with a single-user, as the number of files increases, it becomes difficult to remember the
names of all the files in order to create files with unique name.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
2) Two-level directory: -

• In the two-level structures, each user has its own user file directory (UFD). The UFD lists
only files of a single user.
• System contains a master file directory (MFD) which is indexed by user name or account
number. Each entry in MFD points to the UFD for that user.
• When a user refers to a particular file, only his own UFD is searched. Different users can
have files with the same name, as long as all the file names within each UFD are unique.
• When we create a file for a user, operating system searches only that user’s UFD to find
whether same name file already present in the directory. For deleting a file again operating
system checks the file name in the user’ UFD only.

3) Tree structure: -

• In this directory structure user can create their own sub-directories and organize their files.
The tree has a root directory and every file has a unique path name.
• A directory contains a set of files or subdirectories. All directories have the same internal
format. One bit in each directory entry defines the entry as a file (0) or as a subdirectory
(1).
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
• Each process has a current directory. Current directory contains files that are currently
required by the process.
• When reference is made to a file, the current directory is searched. If a file needed that is
not in the current directory, then the user usually must either specify a path name or
change the current directory.

Winter- Unit 6 Q1 g : Describe any four file attributes. 2M


2019 Answer:
File File attributes:
Management • Name: The symbolic file name is the only information kept in human readable form.
• Identifier: File system gives a unique tag or number that identifies file within file system
and which is used to refer files internally. Any four
• Type: This information is needed for those systems that support different types. attributes:
½ mark
• Location: This information is a pointer to a device and to the location of the file on that
each
device.
• Size: The current size of the file (in bytes, words or blocks) and possibly the maximum
allowed size are included in this attribute.
• Protection: Access control information determines that who can do reading, writing,
executing and so on.
• Time, Date and User Identification: This information may be kept for creation, Last
modification and last use. These data can be useful for protection, security and usage
monitoring.

Q3 d : Describe sequential and direct access method. 4M


Answer:
Sequential access:
• Information from the file is processed in order i.e.one record after another. It is commonly used access
mode. For example, editors and compilers access files in sequence.
• A read operation read information from the file in a sequence i.e. read next reads the next portion of
the file and automatically advances a file pointer.
Description
• A write operation writes information into the file in a sequence i.e. write next appends to the end of the
of
file and advances to the end of the newly written material. Such a file can be reset to the beginning. sequential
• In some operating systems, a program may be able to skip forward or backward n records for some access-2M,
integer n. Direct
access-2M
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme

Figure of Sequential access file


As shown in above diagram, a file can be rewind (moved in backward direction) from the current position to
start with beginning of the file or it can be read or write in forward direction.

Direct access:
• It is also called as relative access. A file is made up of fixed length logical records that allow
programs to read and write records rapidly in no particular order.
• Direct access method is based on disk model of a file which allows random access to any file block.
• For direct access a file is viewed as a numbered sequence of blocks or records. So we can directly
read block 14, then block 53 and so on.
• This method is used for immediate access to large amount of information.
• Database can be accessed with direct access method. For example, when a query concerning a
particular subject arrives, we compute which block contains the answer and then read that block
directly to provide the desired information.
• Read n operation is used to read the nth block from the file whereas write n is used to write in that
block. The block numbers provided by the user to the operating system is a relative block number.
• A relative block number is an index relative to the beginning of the file. The first relative block of file is
0; the next is 1 and so on.
• Actual absolute disk address of the block is different from the relative address. The use of
• Relative block numbers allow the operating system to decide where the file should be placed and
helps t prevent the user from accessing portions of the file system that may not be part of his file.

Q6 c : Enlist different file allocation methods? Explain contiguous allocation method in detail. 6M
Answer:
• From the user’s point of view, a file is an abstract data type. It can be created, opened, written, read, 1m- listing,
closed and deleted without any real concern for its implementation. The implementation of a file is a 2m for
problem for the operating system. diagram, 3m
• The main problem is how to allocate space to these files so that disk space is effectively utilized and for
explanation
files can be quickly accessed.
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
Three major methods of allocating disk space are in wide use:
• Contiguous
• Linked
• Indexed
Contiguous Allocation

Figure of Contiguous Allocation


• The contiguous allocation method requires each file to occupy a set of contiguous addresses on the
disk. Disk addresses define a linear ordering on the disk. Contiguous allocation of a file is defined by
the disk address of the first block and its length. If
• the file is ‘n’ blocks long and starts at location ‘b’, then it occupies blocks b, b+1, b+2, - - - - - b+n-1.
The directory entry for each file indicates the address of the starting block and the length of the area
allocated for this file. Contiguous allocation supports both sequential and direct access.
• For direct access to block ‘i’ of a file, which starts at block ‘b’,we can immediately access block b+i.
The difficulty with contiguous allocation is finding space for a new file.
• For direct access to block ‘i’ of a file, which starts at block ‘b’, we can immediately access block b+i.
The difficulty with contiguous allocation is finding space for a new file.
• If file to be created are ‘n’ blocks long, we must search free space list for ‘n’ free contiguous blocks.

Advantages of Contiguous File Allocation Method:


1. Supports both sequential and direct access methods.
2. Contiguous allocation is the best form of allocation for sequential files. Multiple blocks can be brought
Examination Paper Analysis (Operating System-22516)
Exam Unit No and Question no as per MSBTE paper Marking
Year Name Scheme
in at a time to improve I/O performance for sequential processing.
3. It is also easy to retrieve a single block from a file. For example, if a file starts at block ‘n’ and the ith
block of the file is wanted, its location on secondary storage is simply n+i.
4. Reading all blocks belonging to each file is very fast.
5. Provides good performance.
Disadvantages of Contiguous File Allocation Method:
1. Suffers from external fragmentation.
2. Very difficult to find contiguous blocks of space for new files.
3. Also with pre-allocation, it is necessary to declare the size of the file at the time of creation which many
a times is difficult to estimate.
4. Compaction may be required and it can be very expensive.

You might also like