1
1. Discuss the role of operating system and its type.
An Operating System is the interface between the computer hardware and the end-
user. Processing of data, running applications, file management and handling
the memory is all managed by the computer OS. Windows, Mac, Android etc.
Are examples of Operating systems which are generally used nowadays.
The role of an operating system: -
Memory Management.
Keeps tracks of primary memory, i.e., what part of it are in use by
whom, what part are not in use.
In multiprogramming, the OS decides which process will get
memory when and how much.
Allocates the memory when a process requests it to do so.
De-allocates the memory when a process no longer needs it or has
been terminated.
Processor Management
Keeps tracks of processor and status of process. The program
responsible for this task is known as traffic controller.
Allocates the processor (CPU) to a process.
De-allocates processor when a process is no longer required.
Device Management An Operating System manages device
communication via their respective drivers. It does the following
activities for device management
Keeps tracks of all devices. Program responsible for this task is known
as the I/O controller.
Decides which process gets the device when and for how much time.
Allocates the device in the efficient way.
De-allocates devices.
Device Management
the management of the I/O devices such as a keyboard, magnetic
tape, disk, printer, microphone, USB ports, scanner, camcorder etc.as
well as the supporting units like control channels.
File Management
Keeps track of information, location, uses, status etc. The
collective facilities are often known as file system.
Decides who gets the resources.
By:- Rahul
2
Allocates the resources.
De-allocates the resources.
Security
By means of password and similar other techniques, it prevents
unauthorized access to programs and data.
Control over system performance
− Recording delays between request for a service and response
from the system
Job accounting
− Keeping track of time and resources used by various jobs and users.
Error detecting aids
Production of dumps, traces, error messages, and other debugging and
error detecting aids.
Coordination between other software and users Memory
Coordination and assignment of compilers, interpreters,
assemblers and other software to the various users of the computer
systems.
TYPES OF OPERATIMG SYSTEM
(A). Batch Operating System
There is no direct communication between the computer and the OS
There is an intermediate, the Operator, which needs to distribute the work into
batches and sort similar jobs
Multiple users can use it
Can easily manager a large amount of work
(B). Real-Time Operating System
It has a data processing system
The processing time is very small between the user’s command and the output
Used in fields where the response needs to be quick and rapid
By :- Rahul
3
(C) Time-Sharing Operating System
Multiple people at various terminals can use a program at the same time
The main motive is to minimize the response time
(D) Distributed Operating System
When two or more systems are connected to each other and one can
open files which are not present in their system but in other devices
connected in the network
Its usage has now increased over the years
They use multiple central processors to serve real-time applications
Failure of one system does not affect the other systems connected in the
network
(E) Embedded Operating System
These special Operating systems are built into larger systems
They generally are limited to single specific functions like an ATM
(F) Network Operating System
They have one main server which is connected to other client servers
All the management of files, processing of data, access to sharing files,
etc. are performed over this small network
It is also a secure operating system for working with multiple users
(G) Mobile Operating System
With the advancement in the field of technology, smartphones now are
released with an Operating system.
They are designed in a manner that they can help a small device work
efficiently
2. Explain various directory structure used in operating
system for storing files give its merits and demerits.
A directory is a container that is used to contain folders and files. It organizes files
and folders in a hierarchical manner.
There are many types of directory structure in Operating System.
1) Single Level Directory
The single-level directory is the simplest directory structure. In it, all files are
contained in the same directory which makes it easy to support and understand. A
By :- Rahul
4
single level directory has a significant limitation, however, when the number of
files increases or when the system has more than one user. Since all the files are in
the same directory, they must have a unique name. if two users call their dataset
test, then the unique name rule violated.
Merits
Since it is a single directory, so its implementation is very easy.
If the files are smaller in size, searching will become faster.
The operations like file creation, searching, deletion, updating are very easy
in such a directory structure.
Demerits
There may chance of name collision because two files cannot have the same
name.
Searching will become time taking if the directory is large.
This cannot group the same type of files together.
2) Two Level Directory
As we have seen, a single level directory often leads to confusion of files names
among different users. the solution to this problem is to create a separate directory
for each user. In the two-level directory structure, each user has their own user
files directory (UFD). The UFDs have similar structures, but each list only the
files of a single user. system’s master file directory (MFD) is searches whenever
a new user id=s logged in. The MFD is indexed by username or account number,
and each entry points to the UFD for that user.
Merits
We can give full path like /User-name/directory-name/.
Different users can have the same directory as well as the file name.
Searching of files becomes easier due to pathname and user-grouping.
Demerits
A user is not allowed to share files with other users.
Still, it not very scalable, two files of the same type cannot be grouped
together in the same user.
3) Tree-structured directory
Once we have seen a two-level directory as a tree of height 2, the natural
generalization is to extend the directory structure to a tree of arbitrary height.
This
By :- Rahul
5
generalization allows the user to create their own subdirectories and to
organize their files accordingly. A tree structure is the most common directory
structure. The tree has a root directory, and every file in the system has a unique
path.
Merits
Very general, since full pathname can be given.
Very scalable, the probability of name collision is less.
Searching becomes very easy, we can use both absolute paths as well as
relative.
Demerits
Every file does not fit into the hierarchical model, files may be saved
into multiple directories.
We cannot share files.
It is inefficient, because accessing a file may go under multiple directories.
4) Acyclic graph directory
An acyclic graph is a graph with no cycle and allows us to share subdirectories
and files. The same file or subdirectories may be in two different directories. It
is a natural generalization of the tree-structured directory. It is used in the
situation like when two programmers are working on a joint project and they need
to access files. The associated files are stored in a subdirectory, separating
them from other projects and files of other programmers since they are working
on a joint project so they want the subdirectories to be into their own
directories. The common subdirectories should be shared. So here we use Acyclic
directories. It is the point to note that the shared file is not the same as the copy
file. If any programmer makes some changes in the subdirectory it will reflect in
both subdirectories.
Merits
We can share files.
Searching is easy due to different-different paths.
Demerits
We share the files via linking, in case deleting it may create the problem,
If the link is a soft link, then after deleting the file we left with a
dangling pointer.
In the case of a hard link, to delete a file we have to delete all the
references associated with it.
By :- Rahul
6
5) General graph directory structure
In general graph directory structure, cycles are allowed within a directory structure
where multiple directories can be derived from more than one parent directory.
The main problem with this kind of directory structure is to calculate the total
size or space that has been taken by the files and directories.
Merits
It allows cycles.
It is more flexible than other directory’s structure.
Demerits
It is more costly than others.
It needs garbage collection
By :- Rahul