Model Answer: Important Instructions To Examiners
Model Answer: Important Instructions To Examiners
Model Answer: Important Instructions To Examiners
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
Important Instructions to examiners:
1) The answers should be examined by key words and not as word-to-word as given in the model answer
scheme.
2) The model answer and the answer written by candidate may vary but the examiner may try to assess the
understanding level of the candidate.
3) The language errors such as grammatical, spelling errors should not be given more Importance (Not
applicable for subject English and Communication Skills.
4) While assessing figures, examiner may give credit for principal components indicated in the figure. The
figures drawn by candidate and model answer may vary. The examiner may give credit for any equivalent
figure drawn.
5) Credits may be given step wise for numerical problems. In some cases, the assumed constant values
may vary and there may be some difference in the candidate’s answers and model answer.
6) In case of some questions credit may be given by judgement on part of examiner of relevant answer
based on candidate’s understanding.
7) For programming language papers, credit may be given to any other program based on equivalent
concept.
(i) With neat diagram, explain real time system. List its any four application. 4M
Ans: A real time system has well defined fixed time constraints. Processing should be done (Diagram: 1
within the Defined constraints. mark,
Types of real time system Explanation:
Hard and Soft real time system. 1 mark, any
four
Applications:
½ each)
Satellite Application of real time OS: Satellite application of real time OS The satellite
connected to the computer system sends the digital samples at the rate of 1000 samples
per second. The computer system has an application program that stores these samples
Page | 1
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
in a file. The sample sent by the satellite arrives every millisecond to the application. So
computer must store or respond the sample in less than 1 millisecond. If the computer
does not respond to the sample within this time, the sample will lost.
Applications:
1. Flight Control System
2. Simulations
3. Industrial control
4. Military applications
(ii) Sate any four types of system call provided by an operating system. 4M
Ans: System calls related to Process Control: End, Abort Load, Execute, Create process, (Any four
Terminate process, Ready process, Dispatch process, Suspend, Resume, Get Process types of
attribute, set attribute, Wait for time, Wait event, signal event. System calls:
System calls Related to File Management: Create file, delete file Open file , Close file 1 mark each)
Create directory Read, Write, Reposition Get file attribute , set file attribute, Create a
link, Change the working directory.
System calls Related to Device Management: Request a device, Release a device
Read, Write, Reposition, Get device attribute, Set device attribute
System calls Related to Information Maintenance: Get Time or Date, Set Time or
Date, Get System data, Set system data, Get process, file or device attributes, Set
Process, file or Device attributes.
System calls Related to Communication: create,delete communication connection
send, receive messages, transfer status information, attach or detach remote devices
Ans: Frequently, the free-space list is implemented as a bit map or bit vector. Each block is (Explanation
represented by a 1 bit. If the block is free, the bit is 0; if the block is allocated, the bit is : 4 marks)
1. 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 bit map
would be:
11000011000000111001111110001111…
The main advantage of this approach is that it is relatively simple and efficient to find n
consecutive free blocks on the disk. Unfortunately, bit vectors are inefficient unless the
entire vector is kept in memory for most accesses. Keeping it main memory is possible
for smaller disks such as on microcomputers, but not for larger ones.
Page | 2
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
(iv) Describe first generation of operating system with its advantages and 4M
disadvantages.
Ans: First generation 1945 – 1955 - vacuum tubes, plug boards: The earliest electronic
(Explanation
digital computers had no operating systems. Machines of the time were so primitive that
: 2 marks,
programs were often entered one bit at time on rows of mechanical switches (plug
any two
boards). Programming languages were unknown (not even assembly languages). Advantages:
1/2 mark
Advantages: each, any
two
That was the only electronic during those old days. Disadvantag
Those computers were very fast to calculate. es: 1/2
Vacuum tube technology made possible the advent of electronic digital mark each)
computers.
Use of vacuum tube technology made possible to make electronic digital
computer.
These computers could calculate in milliseconds.
Disadvantages:
Page | 3
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
Ans: (Any six
points: 1
mark each
(any other
valid point
shall be
considered)
Ans: (Diagram: 2
marks,
Kernel: The kernel is the heart of the operating system. It interacts with the Explanations
: 2 marks)
hardware and most of the tasks like memory management, task scheduling and file
management.
Shell: The shell is the utility that processes your requests. When you type in
a command at your terminal, the shell interprets the command and calls the program
that you want. The shell uses standard syntax for all commands. C Shell, Bourne
Shell and Korn Shell are the most famous shells which are available with most of
the Unix variants.
Commands and Utilities: There are various commands and utilities which
you can make use of in your day to day activities. cp, mv, cat and grep, etc. are few
examples of commands and utilities. There are over 250 standard commands plus
numerous others provided through 3rd party software. All the commands come along
with various options.
Page | 5
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
Files and Directories − All the data of Unix is organized into files. All files
are then organized into directories. These directories are further organized into a
tree-like structure called the file system.
Page | 6
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
Most modern operating systems support SMP
Asymmetric multiprocessing:
Each processor is assigned a specific task; master processor schedules and allocated
work to slave processors.
More common in extremely large systems.
Ans: Files can be structured in any of serval ways. Three common possibilities are depicted in (Explanation
fig. The file in fig is an unstructured sequence of bytes. In this model, a file is a : 2 marks,
sequence of fixed-length records, each with some internal structure. The third kind of Example: 2
marks)
file structure is shown in fig. In this organization, a file consists of a tree of records, not
necessarily all the same length, each containing a key field in a fixed position in the
record.
FILE STRUCTURE
Three Kinds of files (a) Byte Sequence . (b) Record Sequence. (c ) Tree
d) Describe stepwise booting process of unix along with diagram. 4M
Ans: The loading of the operating system is done with the help of a special program called (Explanation
BOOT. This program is stored in one or two sectors on the disk with a pre-determined : 2 marks,
address. This portion is called as BOOT Block. The ROM contains minimum program Diagram: 2
called as bootstrap program. When the computer is turn ON, the control is transferred to marks)
this program automatically by the hardware itself. This program in ROM locates the
BOOT program and loads it into predetermined memory locations. This BOOT program
Page | 7
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
loads the operating System into the memory.
Page | 8
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
performance as modern computers have a lot of general and status registers to be saved.
Content switching times are highly dependent on hardware support
Ans: CPU utilization: In multiprogramming the main objective is to keep CPU as busy as (Any four
possible. CPU utilization can range from 0 to 100 percent. scheduling
criteria: 1
Throughput: It is the number of processes that are completed per unit time. It is a mark each)
measure of work done in the system. When CPU is busy in executing processes, then
work is being done in the system. Throughput depends on the execution time required
for any process. For long processes, throughput can be one process per unit time
whereas for short processes it may be 10 processes per unit time.
Turnaround time: The time interval from the time of submission of a process to the
time of completion of that process is called as turnaround time. It is the sum of time
period spent waiting to get into the memory, waiting in the ready queue, executing with
the CPU, and doing I/O operations. It indicates the time period for which a process
exists in the system.
Waiting time: - It is the sum of time periods spent in the ready queue by a process.
When a process is selected from job pool, it is loaded into the main memory (ready
Page | 9
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
queue).A process waits in ready queue till CPU is allocated to it. Once the CPU is
allocated to the process, it starts its execution and if required request for resources.
When the resources are not available that process goes into waiting state and when I/O
request completes, it goes back to ready queue. In ready queue again it waits for CPU
allocation.
Response time:-The time period from the submission of a request until the first
response is produced is called as response time. It is the time when system responds to
the process request not the completion of a process. In the system, a process can
Produce some output fairly early and can continue computing new results while previous
results are being output to the user.
a) Describe activities of I/O system and secondary storage management. (four each) 4M
Ans: I/O System: Input / Output device management provides an environment for the better (Description
interaction between system and the I / O devices such as printers, scanners, tape drives of four
etc. To interact with I/O devices in an effective manner, the operating system uses some activities of
special programs known as device driver. The device drivers take the data that operating I/O system: 2
system has defined as a file and then translate them into streams of bits or a series of marks,
laser. A device driver is a specific type of computer software that is developed to allow Description
interaction with hardware devices. Typically this continues an interface for of four
communicating with the I/O device, through the specific computer bus or activities
communication subsystem that the hardware is connected with. The device driver is a secondary
specialized hardware dependent computer program that enables another program, storage:2
typically an operating system to interact transparently with a hardware device, and marks)
usually provides the required interrupt handling necessary for the time dependent
hardware interfacing.
Activities:
Page | 10
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
processors, editors, and formatters are stored on a disk until loaded into memory.
Secondary storage consists of tapes drives, disk drives, and other media.
Activities:
To read a piece of data that is stored at the end of the file, one has to read all of the data
that comes before it-you cannot jump directly to the desired data. This is similar to the
way cassette tape players work. If one wants to listen to the last song on a cassette tape,
he has to either fast-forward over all of the songs that come before it or listen to them.
There is no way to jump directly to a specific song.
To read a piece of data that is stored at the end of the file, one has to read all of the data
that comes before it-you cannot jump directly to the desired data. This is similar to the
way cassette tape players work. If one wants to listen to the last song on a cassette tape,
Page | 11
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
he has to either fast-forward over all of the songs that come before it or listen to them.
There is no way to jump directly to a specific song.
Direct Access Method: A file is made up of fixed-length logical records that allow
programs to read and write records rapidly in no particular order. Thus, we may read
block 14, then read block 53, and then write block 7. There are no restrictions on the
order of reading or writing for a direct-access file. The direct-access method is based on
a disk model of a file, since disks allow random access to any file block. Direct-access
files are of great use for immediate access to large amounts of information. Databases
are often of this type. For the direct-access method, the file operations must be modified
to include the block number as a parameter. The block number provided by the user to
the OS is normally a relative block number.
A relative block number is an index relative to the beginning of the file.
Thus, the first relative block of the file is 0, the next is 1, and so on, even though the
actual absolute disk address of the block may be 14703 for the first block and 3192
for the second. When you work with a direct access file (which is also known as a
random access file), you can jump directly to any piece of data in the file without
reading the data that comes before it. This is similar to the way a CD player or an
MP3 player works. You can jump directly to any song that you want to listen to.
Sequential access files are easy to work with, and you can use them to gain an
understanding of basic file operations.
Implementation for
direct access
Cp = 0;
Read cp;
Cp= cp+1;
Write cp;
Cp = cp+1
Ans: Each process contains two sections. One is critical section where a process may need to (Relevant
access common variable or objects and other is remaining section containing instructions Description:
for processing of sharable objects or local objects of the process. Each process must 4 marks)
request for permission to enter inside its critical section. The section of code
Page | 12
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
implementing this request is the entry section. In entry section if a process gets
permission to enter into the critical section then it works with common data. At this time
all other processes are in waiting state for the same data. The critical section is followed
by an exit section. Once the process completes its task, it releases the common data in
exit section. Then the remaining code placed in the remainder section is executed by the
process.
do {
Entry section
Critical section
Exit section
Remainder section
} while(TRUE);
Two processes cannot execute their critical sections at the same time. The critical
section problem is to design a protocol that the processes can use to cooperate i.e.
allowing entry to only one process at a time inside the critical section. Before entering
into the critical section each process must request for permission to entry inside critical
section.
Ans: 1. Mutual Exclusion: The resources involved are non-shareable. At least one resource (Four
(thread) must be held in a non-shareable mode, that is, only one process at a time claims Conditions:
Page | 13
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
exclusive control of the resource. If another process requests that resource, the Description
requesting process must be delayed until the resource has been released. of each: 1
2. Hold and Wait: Requesting process hold already, resources while waiting for mark)
requested resources. There must exist a process that is holding a resource already
allocated to it while waiting for additional resource that are currently being held by other
processes.
3. No-Preemptive: Resources already allocated to a process cannot be preempted.
Resources cannot be removed from the processes are used to completion or released
voluntarily by the process holding it.
4. Circular Wait: The processes in the system form a circular list or chain where each
process in the list is waiting for a resource held by the next process in the list.
Example: Consider all the processes in the system are divided into four groups: system,
interactive, interactive editing, batch and student processes queue. Each queue contains
processes. CPU is first scheduled for all queues on may be priority, total burst time or
process type.
Page | 14
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
2. System can use Round Robin algorithm to schedule various queues. Time quantum
can be defined for CPU allocation. For specified time, each queue will execute its
own processes. For example, time quantum 40 milliseconds. CPU will be assigned
first to system queue for 40 milliseconds. Processes from system queue executes one
by one for 40 ms. Once the time quantum expires current process is pre-empted and
CPU is assigned to interactive queue for time quantum of 40 ms. like this each queue
executes one by one in circular form i.e starting with system queue then interactive
queue then batch queue then student queue and again system queue and so on in
circular fashion.
Ans: Monolithic Systems: System is divided into multiple modules written as a collection of (Description:
procedures. Each module is designed for performing specific task such as file 2 marks,
management, I/O management or memory management and so on. Any module can call Diagram: 2
any other module without any major restrictions. Operating system distinguishes marks)
between system mode and user mode while executing an application program. An
application program runs in the user mode. A user makes a request for a service using
application programs. Application programs request for a system call to system call
interface. The operating system locates a system call and executes it in the system mode.
Once execution of system call is over, the execution of the application programs
resumes in the user mode.
Page | 15
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
OR
OR
Ans: Each process is represented as a process control block (PCB) in the operating system. It (Description:
contains information associated with specific process. 2 marks,
Page | 16
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
Process State: It indicates current states of a process. Process state can be new, ready, Diagram: 2
running, waiting and terminated. marks)
Process number: Each process is associated with a unique number.
Process Counter: It indicates the address of the next instruction to be executed for the
process.
CPU Registers: The registers vary in number and type depending on the computer
architecture. Register includes accumulators, index registers, stack pointers and general
purpose registers plus any condition code information.
Memory Management Information: It includes information such as value of base and
limit registers, page tables, segment tables, depending on the memory system used by
OS.
Accounting Information: This information includes the amount of CPU used, time
limits, account holders, job or process number and so on. It also includes information
about listed I/O devices allocated to the process such as list of open files.
Page | 17
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
(iii) Write use of following system calls. 4M
1) fork( )
2) exec( )
3) abort( )
4) end( )
Ans: 1. fork ( ) This system call is used to create a new process. (Use of each
System Call:
2. exec( ) This system call is used to replace the process’s memory space with a 1 mark)
new program. It loads a binary file into memory and starts its execution.
3. abort( ) This system call is used to halt process execution abnormally.
4. end ( ) This system call is used to halt process execution normally.
Page | 18
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
(i) With neat diagram, explain many to one and many to many multithreading model 6M
with its advantages and disadvantages.
Page | 19
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
OR
Advantages:
Developer can create as many user threads as necessary.
Threads can run in parallel on a multiprocessor.
When a thread performs a blocking system call, the kernel can schedule another
thread for execution.
Disadvantage:
Complex to implement
Debugging an application is complicated.
(ii) Explain any two file allocation methods with the help of diagram. 6M
Page | 20
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
2. linked Allocation:-
In this method, each file occupies disk blocks scattered anywhere on the
disk. It is a linked list of allocated blocks. When space has to be allocated to the file,
any free block can be used from the disk and system makes an entry in directory.
Directory entry for allocated file contains file name, a pointer to the first allocated
block and last allocated block of the file. The file pointer is initialized to nil value to
indicate empty file. A write to a file, causes search of free block. After getting free
block data is written to the file and that block is linked to the end of the file. To read
the file, read blocks by following the pointers from block to block starting with block
address specified in the directory entry.
For example, a file of five blocks starting with block 9 and continue with block
16,then block 1,then block 10 an finally block 25.each allocated block contains a
pointer to the next block.
Page | 21
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
3. Indexed Allocation:- In this method, each file has its own index block. This index
block is an array of disk block addresses. When a file is created, an index block
and other disk blocks according to the file size are allocated to that file. Pointer to
each allocated block is stored in the index block of that file. Directory entry
contains file name and address of index block. When any block is allocated to the
file, its address is updated in the index block. Any free disk block can be allocated
to the file. Each ith entry in the index block points to the ith block of the file. To
find and read the ith block, we use the pointer in the ith index block entry.
a) With neat diagram, explain Message passing system. Also describe the following: 8M
(i) Naming
(ii) Synchronization
(iii) Buffering
Ans: Message passing system (Diagram: 3
In this model, communication takes place by exchanging messages between cooperating marks,
processes. It allows processes to communicate and synchronize their action without Explanation:
sharing the same address space. It is particularly useful in a distributed environment 2 marks,
when communication process may reside on a different computer connected by a Description
network. Communication requires sending and receiving messages through the kernel. of given
The processes that want to communicate with each other must have a communication terms: 1
link between them. Between each pair of processes exactly one communication link. mark each)
Page | 22
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
(i) Naming:
Processes which wish to communicate with each other need to know each other with the
name for identification. There are two types of communications :
1. Direct Communication
2. Indirect Communication
In direct communication each process that want to communicate must be explicitly use
name for the sender as well as receiver while communication.
In this type the send( ) and receive( ) primitives are defined as follows:
Send(P,message) – Send message to process P
Receive (Q, message) – Receive a message from process Q.
In an indirect communication the messages could be send or receive from mailboxes or
ports. A mailbox can be viewed as an object in which messages could be kept or even
removed. Each mailbox is associated with the unique number.
In this type the send( ) and receive( ) primitives are defined as follows:
Send(A,message) – Send message to mailbox A.
Receive (A, message) – Receive a message from mailbox A.
(ii) Synchronization:
Communication between the processes takes place through the system calls. OS has to
maintain proper synchronization between the sending and receiving processes.
To send( ) and receive( ) primitives, a special design is required for the implementation
of these primitives.
These are also known as synchronous and asynchronous communication.
Page | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
(iii) Buffering:
The communication could be direct or indirect. The message exchanged by the
communicating processes resides or stores in a temporary queue.
The OS will buffer the messages into the buffers that are created in the system Address
space. A sender’s message will be copied from the sender’s address space to the next
free slot in the system buffers. From this system buffer, the messages will be delivered
to the receiver process in FCFS order when receiver process executes receive calls.
b) Consider the following set of processes, with the length of the CPU burst given in 8M
milliseconds.
P1 10 3
P2 1 1
P3 2 3
P4 1 4
P5 5 2
Page | 24
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
(ii) Round-Robin (RR) (quantum = 1):
P1 P2 P3 P4 P5 P1 P3 P5 P1 P5 P1 P5 P1 P5 P1 P1 P1 P1 P1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
c) Write steps for Banker’s algorithm to avoid dead lock. Also give one example 8M
showing working of Banker’s Algorithm.
Page | 25
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
Example:
a) What is system call? With the help of diagram explain open ( ) system call. 4M
Ans: System Calls: System calls are programming interface to the services provided by the (Definition :
operating 1½ marks ,
system Diagram: 1½
1. Each system call associated with a particular number. marks, Open
2. System call interface maintains a table indexed according to these numbers. System
3. The system call interface invokes intended system call in operating system kernel and Call:1 mark)
returns status of the system call and any return values.
4. The caller needs to know nothing about how the system call is implemented. Just
needs to obey API and understand what OS will do as a result call.
5. Most details of operating system interface hidden from programmers by API. It is
Page | 26
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
managed by run-time support library.
Page | 28
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
Linux has had about 60-100
viruses listed till date. None A rough estimate of UNIX
Security of them actively spreading viruses is between 85 -120
nowadays. viruses reported till date.
Page | 30
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
d) Explain two level Directory Structure with suitable diagram. 4M
Ans: Process is program in execution. A process in execution needs resources like CPU, (Explanation
memory, I/O. Current machines allow several processes to share resources. In reality one :2 marks,
processor is shared among many processes. Process is a program in execution. A process Diagram: 2
does not mean only program but it could contain some part called as text section. It may marks)
contain the current activity, represented by the value of the program counter & the
contents of CPU register. Another part of process is stack. Stack is basically used to
store the temporary values. That values can be parameter or return values of functions,
local variables, addresses of the return values etc. There is another part called data
section. Data section stores the global variable. Global variables are accessible
Page | 31
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
throughout the program. Sometimes it is necessary to use dynamic memory allocation
while executing the program. The heap is a part, which is used for dynamic memory
allocation.
Text Segment: The Text segment (the Instruction segment) contains the executable
program code and constant data. The text segment is marked by the operating system as
read-only and cannot be modified by the process. Multiple processes can share the same
text segment. Processes share the text segment if a second copy of the program is to be
executed concurrently. In this setting, the system references the previously loaded text
segment with the pointer rather than reloading a duplicated. If needed, shared text,
which is the default when using the C/C++ compiler, can be turned off by using the -N
option on the compile time.
Data Segment: The data segment, which is contiguous (in a virtual sense) with the text
segment, can be subdivided into initialized data (e.g. in C/C++, variables that are
declared as static or are static by virtual of their placement) and uninitialized (or 0-
initizliazed) data. The uninitialized data area is also called BSS (Block Started by
Symbol). For example, Initialized Data section is for initialized global variables or static
variables, and BSS is for uninitialized. Stack Segment
The stack segment is used by the process for the storage of automatic identifier, register
variables, and function call information. Stack is basically used to store the temporary
values. The temporary values can be parameter or return values of functions, local
variables, addresses of the return values etc. In the above figure, the stack grows towards
the uninitialized data segment.
The user area: In addition to the text, data, and stack segment, the OS also maintains
for each process a region called the u area (User Area). The u area contains information
specific to the process (e.g. open files, current directory, and signal action, accounting
information) and a system stack segment for process use. If the process makes a system
call (e.g., the system call to write in the function in main), the stack frame information
Page | 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER– 17 EXAMINATION
Subject Title: Operating System Subject Code: 17512
for the system is stored in the system stack segment. Again, this information is kept by
the OS in an area that the process doesn't normally have access to. Thus, if this
information is needed, the process must use special system call to access it. Like the
process itself, the contents of the u area for the process are paged in and out by the OS.
Page | 33