Sunteți pe pagina 1din 6

Assignment Set -2 Operating Systems

1. Discuss about Demand paging.

Ans: One of the paging techniques is demand paging. Demand paging I similar to paging with
swapping. When a process is to be executed then and then only that page of the process, which needs
to be currently executed, is swapped into memory. Thus only necessary pages of the process are
swapped into memory thereby decreasing swap time and physical memory requirement.

The protection valid – invalid bit which is used in paging to determine valid / invalid pages
corresponding to a process is used. If the valid-invalid bit is set, then the corresponding page is valid
and also in the physical memory. If the bit is not set then any of the following can occur:

Process is accessing a legal page but the page is currently not in memo ry.
Process is accessing a page not belonging to it , i.e., an illegal memory access.

If the same protection scheme as in paging is used, then in both the above cases page fault
occurs. The error is valid in the second case but not in first.

To avoid page faults, a process starts executing with no page sin memory. When a page fault is
generated the page is brought into memory. After a while all the pages required by the process are in
memory. This is known as pure demand paging.

Hardware required for demand paging is same as that for paging and swapping.

1
Assignment Set -2 Operating Systems

2. What are the different file access methods? Explain.

Ans: Files are stored in the secondary storage which contains various information. When this
information is to be used, it has to be accessed and brought up into main memory. There are various
methods to access a file, they are:

a) Sequential access
b) Direct access
c) Indexed sequential access

a) Sequential access:

It is simplest access method. In this method the information in the file is accessed sequentially one
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. This method is useful when most of the records in the file are to be
processed.

b) Direct access:

When there is no need to process every record in a file, in such situations direct access method is
used. Direct access is based on the disk which is a direct access device and allows random access of
file. Not all the operating system support the direct access method. Sequential access of a direct
access file is possible but direct access of a sequential file is not.

c) Indexed sequential access

This method is a combination of both the sequential access as well as direct access. The main thing is
to access a file direct first and then sequentially from that point onwards. This method therefore
requires an index. The index is a pointer to a block. To access a record in a file, a direct access of the
index is made, the information obtained is then used to access the file. The main advantage in this
type of access is that both direct and sequential access of file is possible.

2
Assignment Set -2 Operating Systems

3. Explain program-controlled I/O?

Ans: The program controlled I/O is one common I/O strategy. It is also called as polled I/O. Here all
I/O is performed under the control of I/O handling procedure and input and output is initiated by this
procedure. The I/O handling procedure will require some status information from I/O device. One
input port can be used to collect status or handshake information from several I/O devices.

Typically there will be several I/O devices connected to the processor; the processor checks
the status input port periodically. If an I/O device requires service, it will signal this need by altering
its input to the status port. When the I/O controlled program detects this then appropriate operation
will be performed on the I/O device which requested the service.

Program controlled I/O has many advantages:

All control is directly under the control of the program, so changes can be implemented.
The order in which the devices are serviced is determined by the program.
It is easy to add or delete the devices.

The major disadvantage of program controlled I/O is that a great deal of time may be spent
testing the status inputs of the I/O devices, when he devices do not need servicing.

Program controlled I/O is used for simple operations which must be performed sequentially.

3
Assignment Set -2 Operating Systems

4. List and explain the main functions of Network Operating System (NOS).

Ans: A network operating system (NOS) is a piece of software that controls a network and its
message (e.g. packet) traffic and queues, controls access by multiple users to network resources such
as files, and provides for certain administrative functions, including security.

The main functions of NOS can be explained as below:

a) Redirection:
Redirection software resides on the client and may reside on server also. Redirection actually
works when an interrupt is executed by a system call generated. It is at the time of execution of
interrupt that redirection software intercepts to check is I/O is local or remote. If it is local then
processing continues, if it is remote then software has to generate a request to the server.

b) Communication Management:
Communication management software runs on both client and server. It is responsible for
communication management and is concerned with the error free transmission of messages to
the destination. Communication management is built as a part of NOS and thus resides on all
the clients and server.

c) File and printer services:


File/printer resources are controlled by these services. This software runs only on the server.
Requests for the shared resources are queued up, scheduled and then run as separate tasks,
making NOS a multitasking operating system.

d) Network Management software:


This software is responsible for monitoring network and its components such as computers,
modems, lines, adapters and many more. Special software enables online testing of these
equipments from time to time, checks their status and hence monitors the entire network. It
maintains a list of hardware equipment along with its location an d status. The network
management software is a part of NOS.

4
Assignment Set -2 Operating Systems

5. Write a note on computer virus.

Ans: A computer virus is written with an intention of infecting other programs. It is a part of a
program that attaches itself on to a valid program. There are many various types of viruses. Some of
the common varieties are:

Boot sector infectors


Memory resident infectors
File specific infectors
General purpose infectors

Viruses infect other programs in the following ways:

Virus code appends itself to a vali d unaffected program.


Virus code replaces original executable program completely or partially.
Virus code deletes some part of executable program.
Virus code gets inserted to the body of the executable code to carry out undesirable actions.

A virus works in a number of ways. Virus detection programs check for the integrity of binary
files by maintaining checksum and recalculating it at regular intervals. A mismatch indicates the
presence of virus.

An ideal virus removal program is very difficult. Anti-virus codes for removal of viruses are
available. But with the number of new viruses increasing every now and then, there is no good cure
available after infection. Therefore one of the safest ways to prevent virus attacks is to use legal
copies of software.

5
Assignment Set -2 Operating Systems

6. What are the advantages of multiprocessors? Explain.

Ans: There are many advantages of multiprocessor systems as shown below:

Performance and computing power:


Use of multiprocessor systems speeds up an application. Also the problems with high inter-
processor interaction can be solved quickly.

Fault tolerance:
The inherent redundancy in multiprocessor systems can be used to increase availability and
eliminate single point failures.

Flexibility:
A multiprocessor system can be made to dynamically reconfigure itself so as to optimize
different objectives for different applications.

Modular growth:
Use of a modular system design overcomes certain problems and can be accomplished by
adding exactly tailor made components such as processors, memories, etc.

Functional specialization:
Specialized processors can be added to improve performance in particular applications.

Cost / performance:
Cost performance ratio in case of multiprocessor systems is far below than that of large
computers of the same capacity and hence multiprocessor systems are cost effective.

S-ar putea să vă placă și