Osy w19 Odd
Osy w19 Odd
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
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)
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)
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)
25 | 2 6 26 | 2 6