MIT201

advertisement
SPRING 2014 ASSIGNMENT
PROGRAM - Master of Science in Information Technology (MSc IT) Revised Fall 2011
SEMESTER 2
SUBJECT CODE & NAME - MIT201 – OPERATING SYSTEM
CREDIT 4 BK ID B1405 MAX. MARKS 60
Q.No1. Define Operating system. List any six functions of operating system 4+6= 10
Answer:
Operating System – Definition
Operating System is a System Software (Set of system programs) which provides an environment to help
the user to execute the programs. The Operating System is a resource manager which allocates and
manages various resources like processor(s), main memory, input/output devices and information on
secondary storage devices.
Functions of Operating System
Operating systems perform the following important functions:
i) Processor Management: It means assigning processor to different tasks which has to be performed
by the computer system.
ii) Memory Management: It means allocation of main memory and secondary storage areas to the
system programmes, as well as user programmes and data.
iii) Input and Output Management: It means co-ordination and assignment of the different output
and input devices while one or more programmes are being executed.
iv) File System Management: Operating system is also responsible for maintenance of a file system, in
which the users are allowed to create, delete and move files.
v) Establishment and Enforcement of a Priority System: It means the operating system
determines and maintains the order in which jobs are to be executed in the computer system.
vi) Assignment of system resources, both software and hardware to the various users of the system.
2 Differentiate between direct and Indirect communication. 5+5 10
Answer:
Direct Communication:
In the direct-communication discipline, each process that wants to communicate must explicitly name the
recipient or sender of the communication. In this scheme, the send and receive primitives are defined as
follows:
Send (P, message). Send a message to process P.
Receive (Q, message). Receive a message from process Q.
A communication link in this scheme has the following properties:
A link is established automatically between every pair of processes that want to communicate. The
processes need to know only each other's identity to communicate.
e exists exactly one link.
-directional.
Indirect Communication:
With indirect communication, the messages are sent to and received from mailboxes (also referred to as
ports). A mailbox can be viewed abstractly as an object into which messages can be placed by processes
and from which messages can be removed. Each mailbox has a unique identification. In this scheme, a
process can communicate with some other process via a number of different mailboxes. Two processes
can communicate only if the processes have a shared mailbox. The send and receive primitives are defined
as follows: send (A, message). Send a message to mailbox A. receive (A, message). Receive a message from
mailbox A.
In this scheme, a communication link has the following properties:
number of different links, each link
corresponding to one mailbox.
-directional.
3 How a virtual memory can be implemented? What are the benefits of using virtual
memory? 5+5=10
Answer:
Virtual memory implementation:
Every process needs to be loaded into physical memory for execution. One brute force approach to this is
to map the entire logical space of the process to physical memory, as in the case of paging and
segmentation.
Many a time, the entire process need not be in memory during execution. The following are some of the
instances to substantiate the above statement:
conditions occur, which is usually a rare occurrence, may be one or no occurrences in an execution.
than 10% of the limit.
hancement, never used, as
enhancements are never implemented.
overlays.
Virtual memory is the separation of logical memory from physical memory. This separation provides a
large logical / virtual memory to be mapped on to a small physical memory.
Virtual memory is implemented using demand paging. Also demand segmentation could be used. A
combined approach using a paged segmentation scheme is also available. Here user view is segmentation
but the operating system implements this view with demand paging.
Benefits of using virtual memory:
and execute them.
ysical memory required for a program is less. Hence degree of multi-programming can be increased
because of which utilization and throughput increase.
4 Differentiate between Sequential access and Direct access methods. 5+5= 10
Answer:
Sequential access
In this simple access method, information in a file is accessed sequentially one record after another. To
process the ith record all the i-1 records previous to i must be accessed. Sequential access is based on the
tape model that is inherently a sequential access device. Sequential access is best suited where most of the
records in a file are to be processed. For example, transaction files.
Direct access
Sometimes it is not necessary to process every record in a file. It may not be necessary to process records
in the order in which they are present. Information present in a record of a file is to be accessed only if
some key value in that record is known. In all such cases, direct access is used. Direct access is based on
the disk that is a direct access device and allows random access of any file block. Since a file is a collection
of physical blocks, any block and hence the records in that block are accessed. For example, master files.
Databases are often of this type since they allow query processing that involves immediate access to large
amounts of information. All reservation systems fall into this category. Not all operating systems support
direct access files. Usually files are to be defined as sequential or direct at the time of creation and
accessed accordingly later. Sequential access of a direct access file is possible but direct access of a
sequential file is not.
5 Write short notes on:
a) Global Operating System (GOS)
b) Remote Procedure Call (RPC) 5+5 = 10
Answer:
a) Global Operating System (GOS)
The NOS is responsible for activities such as memory and process management on the server. The NOS
converts a request into a task, schedules and executes it. Memory and processing power in all other
computers in the network is not tapped to the maximum by NOS. This is exactly what the GOS attempts to
do. It has a list of processes executing on different machines and the resources needed by each one of
them. Relatively free processors can be scheduled with tasks for execution. Memory is managed at a global
level. The various functions of the GOS are:
A typical GOS environment is depicted in the figure 11.2. Part of the kernel of a GOS is duplicated at all
sites. This kernel contains software to control hardware. Resources like information, memory, etc are
managed by software that need not be replicated.
Fig: GOS environment
Migration
The GOS has a pool of resources that it allocates to various processes / tasks at a global level. Migrations
are necessary for optimal use of available resources. Migrations include:
Data migration involves movement of data. A program running at a site X wants access to a file at site Y.
Two options exist:
The GOS may sometimes resort to computation migration. If nodes are distributed in a hierarchical
fashion then data migration will need to transfer all files between levels.
The GOS maintains a global list of all resources and allocates them to processes. This also includes
migrated processes. The resource allocation may lead to deadlocks. Deadlock handling in distributed
systems is complex due to difficulties in maintaining an updated list of global resources.
b) Remote Procedure Call (RPC)
A distributed environment consists of servers and clients. Server is a computer that offers services of
shared resources. Client is a computer that requests for a shared resource present on the server through a
request. A procedure is present on the server to locate and retrieve data present on a shared device
attached to it. This procedure is part of the operating system running on the server. When a client
requests for some data on the server this procedure on the server operating system is called remotely from
the client. Hence it is called a remote procedure call (RPC).
6 Differentiate between master/slave and Symmetric Multi- processor Operating Systems
5+5=10
Answer:
Master/Slave
In this approach, one processor – the master is dedicated to execute the operating system. The remaining
processors are slaves and form a pool of computational processors. The master schedules and controls the
slaves. This arrangement allows parallelism in an application by allocating to it many slaves.
Master / slave systems are easy to develop. A uniprocessor operating system can be adapted for master /
slave multiprocessor operations with the addition of slave scheduling. Such systems have limited
scalability. Major disadvantages are that computational power of a whole processor is dedicated for
control activity only and if the master fails, the entire system is down.
Symmetric
All processors are functionally identical. They form a pool of resources. Other resources such as memory
and I/O devices are available to all processors. If they are available to only a few then the system becomes
asymmetric.
The operating system is also symmetric. Any processor can execute it. In response to workload
requirements and processor availability, different processors execute the operating system at different
times. The processor which executes the operating system temporarily is the master (also called floating
master).
An existing uniprocessor operating system such as UNIX can easily be ported to a shared memory UMA
multiprocessor. Shared memory contains the resident operating system code and data structures. Any
processor can execute the operating system. Parallel execution of applications is possible using a ready
queue of processes in shared memory. The next ready process to the next available processor until either
all processors are busy / queue is empty could be a possible allocation scheme. Concurrent access of
shared data structures provides parallelism.
Download