0% found this document useful (0 votes)
35 views7 pages

Osy w19 Odd

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)
35 views7 pages

Osy w19 Odd

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/ 7

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)

WINTER – 2019 EXAMINATION b Explain any 4 services provided by OS. 2M


Subject Name: Operating System Model Answer Subject Code: 22516 Ans 1.User Interface: All operating systems have a user interface that 1 marks for
allows users to communicate with the system. Three types of user explaining
Important Instructions to examiners: interfaces are available: any 4
1) The answers should be examined by key words and not as word-to-word as given in the
model answer scheme.
a. Command line interface (CLI) services
2) The model answer and the answer written by candidate may vary but the examiner may try b. Batch interface
to assess the understanding level of the candidate. c. Graphical user interface (GUI)
3) The language errors such as grammatical, spelling errors should not be given more
Importance (Not applicable for subject English and Communication Skills. 2. Program execution: The operating system provides an environment
4) While assessing figures, examiner may give credit for principal components indicated in where the user can conveniently run programs. It also performs other
the figure. The figures drawn by candidate and model answer may vary. The examiner may important tasks like allocation and deallocation of memory, CPU
give credit for any equivalent figure drawn. scheduling etc. It also provides service to end process execution either
5) Credits may be given step wise for numerical problems. In some cases, the assumed normally or abnormally by indicating error.
constant values may vary and there may be some difference in the candidate’s answers and
model answer.
3. I/O operations: When a program is running, it may require
6) In case of some questions credit may be given by judgement on part of examiner of input/output resources such as a file or devices such as printer. So the
relevant answer based on candidate’s understanding.
7) For programming language papers, credit may be given to any other program based on
operating system provides a service to do I/O.
equivalent concept.
4.File system manipulation: Programs may need to read and write data
Q. Sub Answer Marking from and to the files and directories. Operating system manages the
No Q. Scheme secondary storage. Operating system makes it easier for user programs
. N. to accomplish their task such as opening a file, saving a file and deleting
a file from the storage disk.
1. Attempt any Five of the following: 10 M
a Define real time operating system. List its any four applications of 2M 5.Communication: In the system, one process may need to exchange
it. information with another process. Communication can be implemented
Ans Real time Operating System: 1 Mark :- via shared memory or through message passing, in which packets of
A real time system has well defined fixed time constraints. Processing Definition; information are moved between processes by the operating system.
should be done within the defined constraints -Hard and Soft real time 1 Mark :-
system. for any 4 6.Error detection: Operating systems detects CPU and memory
OR correct hardware such as a memory error or power failure, a connection failure
The real-time operating system used for a real-time application means application on a network or lack of paper in the printer etc.
for those applications where data processing should be done in the fixed s
and small quantum of time. 7.Resource allocation: Operating system manages resource allocation
to the processes. These resources are CPU, main memory, file storage
Types of real time operating system and I/O devices.
1. Hard real-time
2. Soft real-time 8.Accounting: Operating system keeps track of usages of various
computer resources allocated to users.
Applications:
1. Flight Control System 9.Protection & security: When several separate processes execute
2. Simulations concurrently, one process should not interfere with the other processes
3. Industrial control or operating system itself. Protection provides controlled access to
4. Military applications system resources. Security is provided by user authentication such as
password for accessing information.

1|26 2|26
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)

2. Attempt any Three of the following: 12M Process Management: The operating system manages many kinds of
a Enlist types of operating system. Explain multiprogramming OS in 4M activities ranging from user programs to system programs like printer
detail. spooler, name servers, file server etc.
Ans Types of operating system 1 Mark:- Each of these activities is encapsulated in a process.
1.Batch Systems Listing;  A process includes the complete execution context (code, data,
2.Multiprogramming 1 Mark:- PC, registers, OS resources in use etc.).
3.Multitasking Diagram  The basic unit of software that the operating system deals with in
4.Time-Sharing Systems 2 Marks:- scheduling the work done by the processor is either a process or
5.Desktop Systems Explanatio a thread, depending on the operating system.
6.Distributed system n  It’s tempting to think of a process as an application, but that
7.Clustered system gives an incomplete picture of how processes relate to the
8.Real Time system: operating system and hardware.
 The application you see (word processor or spreadsheet or game)
Multiprogramming: is, indeed, a process, but that application may cause several other
 In multiprogramming, more than one program lies in the processes to begin, for tasks like communications with other
memory. devices or other computers.
 The scheduler selects the jobs to be placed in ready queue from a  There are also numerous processes that run without giving you
number of programs. direct evidence that they ever exist. A process, then, is software
 The ready queue is placed in memory and the existence of more that performs some action and can be controlled by a user, by
than one program in main memory is known as other applications or by the operating system.
multiprogramming.  It is processes, rather than applications, that the operating system
 Since there is only one processor, there multiple programs controls and schedules for execution by the CPU. In a single-
cannot be executed at a time. tasking system, the schedule is straightforward.
 Instead the operating system executes part of one program, then  The operating system allows the application to begin running,
the part of another and so on. suspending the execution only long enough to deal with
 Example of multiprogramming: user can open word, excel, interrupts and user input.
access and other applications in a system.  The five major activities of an operating system in regard to
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.
c With neat diagram explain inter process communication model. 4M
Ans Inter-process communication: Cooperating processes require an Inter- Define
process communication (IPC) mechanism that will allow them to inter
b List components of OS. Explain process management in detail. 4M exchange data and information. process
Ans List of System Components: 1 Mark:- There are two models of IPC communica
1. Process management Listing; 1. Shared memory tion -1
2. Main memory management 3 Marks:- mark;
3. File management Explanation diagram of
4. I/O system management model - 1
5. Secondary storage management mark;
explanation

5|26 6|26
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)

-a: It shows the processes of all users.


Example: $ ps -a

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


example: $ ps -e
3. Attempt any Three of the following: 12M
a Explain ‘PS’ command with any four options. 4M
Ans ps command: It is used to display the characteristics of a process. This four
command when execute without options, it lists the processes associated options-1M
with a user at a particular terminal. each
Syntax: $ ps [options]
Example: $ ps
output: b Explain deadlock? What are necessary conditions for deadlock? 4M
Ans In multiprogramming environment, several processes may compete for a finite Deadlock
number of resources. A process requests resources and if the resources are not description-
available then the process enters into the waiting state. Sometimes a waiting 2M,
process is never again able to change its status because the resources requested
Each line in the output shows PID, the terminal with which the process necessary
by it are held by other waiting processes. This situation is called as deadlock.
is associated, the cumulative processor time that has been consumed When a process request for resources held by another waiting process which in conditions -
since the process has been started and the process name. turn is waiting for resources held by another waiting process and not a single 1/2 M each
Options: process can execute its task, then deadlock occurs in the system.
-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 Example: Consider a system with three disk drives and three processes. When
the process) and STIME(chronological time that has elapsed since the each process request one disk drive, system allocates one disk drive to each
process. Now there is no more drive available in the system. If all three
process started).
processes request for one more disk drive, then all three processes will go into
Example: $ ps -f the waiting state and system will go in deadlock state. Because any one process
from the three can execute only when one of them will release the disk drive
allocated to it.

Necessary Conditions:
1. Mutual exclusion: At least one resource must be held in a non-
sharable mode; that is, only one process at a time can use the resource.
-u: Shows the activities of any specified user at any time. 2. Hold and Wait: A process must be holding at least one resource and
Example: $ ps -u abc waiting to acquire additional resources that are currently being held by

9|26 10 | 2 6
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)

a query concerning a particular subject arrives, we compute which block  get process attributes, set process attributes
contains the answer and then read that block directly to provide the  wait for time
desired information.  wait event, signal event
Read n operation is used to read the nth block from the file whereas  allocate and free memory
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 File Management: System allows us to create and delete files. For
block number is an index relative to the beginning of the file. The first create and delete operation system call requires the name of the file and
relative block of file is 0; the next is 1 and so on. Actual absolute disk other attributes of the file. File attributes include file type, file size,
address of the block is different from the relative address. The use of protection codes, accounting information and so on. Systems access
relative block numbers allow the operating system to decide where the these attributes for performing operations on file and directories. Once
file should be placed and helps t prevent the user from accessing the file is created, we can open it and use it. System also allows
portions of the file system that may not be part of his file. performing reading, writing or repositioning operations on file.
 create file, delete file
4 Attempt any Three of the following: 12M
 open, close
a Write Unix command for following: 4M
 read, write, reposition
i)create a folder OSY ii) create a file FIRST in OSY folder
 get file attributes, set device attributes
iii) List/display all files and directories.
 logically attach or detach devices
iv) Write command to clear the screen
Ans i) create a folder OSY: Each correct
3. Device Management: When a process is in running state, it requires
$mkdir OSY command-
several resources to execute. These resources include main memory,
1M
disk drives, files and so on. If the resource is available, it is assigned to
ii)create a file FIRST in OSY folder:
the process. Once the resource is allocated to the process, process can
$cd OSY
read, write and reposition the device.
$cat>FIRST or $ touch FIRST
 request device, release device
iii) List/display all files and directories:  read, write, reposition
$ls  get device attributes, set device attributes
 logically attach or detach devices
iv) to clear screen:
$clear 4. Information Maintenance: Transferring information between the
b What is purpose of system call? State two system calls with their 4M user program and the operating system requires system call. System
functions. information includes displaying current date and time, the number of
Ans System call provides an interface between a running program and purpose of current user, the version number of the operating system, the amount of
operating system. It allows user to access services provided by system call- free memory or disk space and so on. Operating system keeps
operating system. This system calls are procedures written using C, 2M, Two information about all its processes that can be accessed with system
C++ and assembly language instructions. Each operating system has its system calls- calls such as get process attributes and set process attributes.
own name for each system call. Each system call is associated with a 1M each  get time or date, set time or date
number that identifies itself.  get system data, set system data
System calls:  get process, file, or devices attributes
Process Control: Program in execution is a process. A process to be  set process, file, or devices attributes
executed must be loaded in main memory. while executing it may need
to wait, terminate or create & terminate child processes. 5. Communication: Processes in the system, communicate with each
 end, abort other. Communication is done by using two models: message passing
 load, execute and shared memory. For transferring messages, sender process
 create process, terminate process connects itself to receiving process by specifying receiving process

13 | 2 6 14 | 2 6
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)

which is known process identification number. Syntax: useradd -m -d /home/<userName> -


Program Counter: It indicates the address of the next instruction to c "<userName>" <userName>
be executed for the process. Example: useradd -m -d /home/xyz -c "xyz" xyz
CPU Registers: The registers vary in number and type depending on File /etc/default/useradd contains some user default options.
the computer architecture. Register includes accumulators, index The command useradd -D can be used to display this file.
registers, stack pointers and general purpose registers plus any Syntax: useradd -D
condition code information.
Memory Management Information: It includes information such as Userdel: To delete a user account userdel command is used.
value of base and limit registers, page tables, segment tables, Syntax: userdel -r <userName>
depending on the memory system used by OS.
Accounting Information: This information includes the amount of Usermod: The command usermod is used to modify the properties of
CPU used, time limits, account holders, job or process number and so an existing user.
on. It also includes information about listed I/O devices allocated to the Syntax: usermod -c <'newName'> <oldName>
process such as list of open files. Example: usermod -c 'vppoly' john
Each PCB gives information about a particular process for which it is
designed. 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

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.
5 Attempt any Two of the following: 12M Example: ls –l /dev
a Enlist the operating system tools. Explain any two in detail. 6M Above example gives the list of device file from kernel.
Ans Following are the operating tools: For List=2 Udev supplies a dynamic device directory containing only the nodes
 User Management Marks and for devices which are connected to the system. It creates or removes
 Security policy Explanatio the device node files in the /dev directory.
 Device Management n any two
C) Performance Monitor:
 Performance Monitor for 4
Marks It is very tough job for every system or network administrator to
 Task Scheduler monitor and debug Linux System Performance problems every day.
The commands discussed below are some of the most fundamental
A) User management: commands when it comes to system analysis and debugging Linux
 User management includes everything from creating a user to server issues such as:
deleting a user on your system. User management can be done 1) vmstat: Virtual memory statistics
in three ways on a Linux system. The vmstat command reports information about processes, memory,
 Command line tools include commands like useradd, userdel, paging, block IO, traps, and cpu activity.
usermod, passwd, etc. These are mostly used by the server $ vmstat 3
administrators.
Useradd: With useradd commands you can add a user. 2)top: Process activity monitoring command

17 | 2 6 18 | 2 6
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)

 The one-to-one model allows for greater concurrency, but the Counters:
developer has to be careful not to create too many threads  In the simplest case, we associate with each page-table entry a
within an application (and in some instances may be limited in time-of-use field and add to the CPU a logical clock or counter.
the number of threads she can create).  The clock is incremented for every memory reference.
 The many-to-many model suffers from neither of these  Whenever a reference to a page is made, the contents of the
shortcomings: developers can create as many user threads as clock register are copied to the time-of-use field in the page-
necessary, and the corresponding kernel threads can run in table entry for that page.
parallel on a multiprocessor.  In this way, we always have the "time" of the last reference to
 Also, when a thread performs a blocking system call, the kernel each page. We replace the page with the smallest time value.
can schedule another thread for execution.
Stack:
 Another approach to implementing LRU replacement is to keep
a stack of page numbers.
 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.

Reference String: 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
(Frame size have not mentioned in question so assume frame size as 3
or 4)
Advantages: LRU: Assume frame size=3
 Many threads can be created as per user’s requirement. 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
 Multiple kernel or equal to user threads can be created. 7 7 7 2 2 4 4 4 0 1 1 * 1 *
Disadvantages: 0 0 0 * 0 * 0 0 3 3 * 3 0 0 *
 True concurrency cannot be achieved.
 Multiple threads of kernel is an overhead for operating system 1 1 3 3 2 2 2 * 2 * 2 7
c Explain LRU page replacement algorithm for following reference 6M Page Fault=12
string. 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1 Assume frame size=4
Calculate the page fault. 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
Ans LRU: LRU 7 7 7 7 3 3 * * 3 7
 The Least Recently Used (LRU) page replacement policy explanation
0 0 0 * 0 * 0 * 0 * 0 *
replaces the page that has not been used for the longest =2M
1 1 1 4 1 * 1 *
period of time. Calculation
2 2 2 * * 2 * 2
 LRU replacement associates with each page the time of that =4 M
page's last use. Page fault=08
 When a page must be replaced, LRU chooses the page that has
6 Attempt any Two of the following: 12M
not been used for the longest period of time.
a The jobs are scheduled for execution as follows: 6M
 The LRU policy is often used as a page-replacement algorithm
SJF=3 m
and is considered to be good. FCFS=3 m
 An LRU page-replacement algorithm may require substantial (1m-gantt
hardware assistance. chart, 2m
calculation

21 | 2 6 22 | 2 6
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)

Linked List access.


 In this approach, the free disk blocks are linked together i.e. a • For direct access to block ‘i’ of a file, which starts at block ‘b’,
free block contains a pointer to the next free block. we can immediately access block b+i. The difficulty with
 The block number of the very first disk block is stored at a contiguous allocation is finding space for a new file.
separate location on disk and is also cached in memory. • For direct access to block ‘i’ of a file, which starts at block ‘b’,
 In this approach, link all the disk blocks together, keeping a we can immediately access block b+i.
pointer to the first free block. • The difficulty with contiguous allocation is finding space for a
 This block contains a pointer to the next free disk block, and so new file.
on. • If file to be created are ‘n’ blocks long, we must search free
space list for ‘n’ free contiguous blocks.

c Enlist different file allocation methods? Explain contiguous


allocation method in detail.
From the user’s point of view, a file is an abstract data type. It can be created, 1m- listing,
Advantages of Contiguous File Allocation Method:
Ans
opened, written, read, closed and deleted without any real concern for its 2m for 1. Supports both sequential and direct access methods.
implementation. The implementation of a file is a problem for the operating diagram, 3m 2. Contiguous allocation is the best form of allocation for
system. for sequential files. Multiple blocks can be brought in at a time to
The main problem is how to allocate space to these files so that disk space is explanation improve I/O performance for sequential processing.
effectively utilized and files can be quickly accessed. 3. It is also easy to retrieve a single block from a file. For
Three major methods of allocating disk space are in wide use: example, if a file starts at block ‘n’ and the ith block of the file
 Contiguous is wanted, its location on secondary storage is simply n + i.
 Linked 4. Reading all blocks belonging to each file is very fast.
 Indexed 5. Provides good performance.
Contiguous Allocation
• The contiguous allocation method requires each file to occupy Disadvantages of Contiguous File Allocation Method:
a set of contiguous addresses on the disk. Disk addresses define 1. Suffers from external fragmentation.
a linear ordering on the disk. Contiguous allocation of a file is 2. Very difficult to find contiguous blocks of space for new files.
defined by the disk address of the first block and its length. If 3. Also with pre-allocation, it is necessary to declare the size of
the file is ‘n’ blocks long and starts at location ‘b’, then it the file at the time of creation which many a times is difficult to
occupies blocks b, b+1, b+2, - - - - - b+n-1. The directory entry estimate.
for each file indicates the address of the starting block and the 4. Compaction may be required and it can be very expensive.
length of the area allocated for this file.
• Contiguous allocation supports both sequential and direct

25 | 2 6 26 | 2 6

You might also like