Unit 3 & 4 Os
Unit 3 & 4 Os
in
SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in
UNIT-III
Device Controllers
Device drivers are software modules that can be plugged into an OS to handle a
particular device. Operating System takes help from device drivers to handle all
I/O devices.
The Device Controller works like an interface between a device and a device
driver. I/O units (Keyboard, mouse, printer, etc.) typically consist of a
mechanical component and an electronic component where electronic
component is called the device controller.
There is always a device controller and a device driver for each device to
communicate with the Operating Systems. A device controller may be able to
handle multiple devices. As an interface its main task is to convert serial bit
stream to block of bytes, perform error correction as necessary.
Any device connected to the computer is connected by a plug and socket, and
the socket is connected to a device controller. Following is a model for
SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in
connecting the CPU, memory, controllers, and I/O devices where CPU and
device controllers all use a common bus for communication.
What is a device driver?
A device driver is a special kind of software program that controls a specific
hardware device attached to a computer. Device drivers are essential for a
computer to work properly.
These programs may be compact, but they provide the all-important means for a
computer to interact with hardware, for everything from mouse, keyboard and
display -- user input/output -- to working with networks, storage and graphics.
SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in
File management is one of the basic but important features provided by the
operating system. File management in operating system is nothing but software
that handles or manages the files (binary, text, pdf, docs, audio, video, etc.)
present in computer software. The file system in the operating system is capable
of managing individual as well as groups of files present in the computer
system. The file system in operating system tells us about the location, owner,
time of creation and modification, type, and state of a file present on the
computer system.
What is Directory?
On a computer, a directory is used to store, arrange, and segregate files and
folders. It is similar to a telephone directory in that it just contains lists of
names, phone numbers, and addresses rather than the real papers. It uses a
hierarchical structure to organize files and directories. On many computers,
directories are referred to as drawers or folders, much like a workbench or a
standard filing cabinet in an office. You may, for instance, create a directory for
images and another for all of your documents. You could easily access the type
of file you wanted to see by saving particular file types in a folder.
SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in
SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in
directory. Here f1, f2, f3, f4, f5 represent the five different files. Practically it
can be thought of as a structure where all the files are stored in the same folder.
Advantages of single-level directory
The main advantage of a single-level directory is that it is very simple to
implement.
Since all the files are present in the same directory, in case the number of
files is less, then searching for a particular file is faster and easier.
Simple operations like file creation, search, deletion, and updating are
possible with a single-level directory structure.
The single-level directory is easier to understand in practical life.
Disadvantages of single-level directory
In case we want to organize the files in some groups, it is not possible to
do so since we cannot create subdirectories.
Two file names cannot be the same. In case two files are given the same
name, the previous one is overridden.
If the number of files is very large, searching a particular file is very
inefficient.
Segregation of important and unimportant files is not possible.
The single-level directory is not useful for multi-user systems.
Two-level directory
We saw how the single-level directory proves to be inefficient if multiple users
are accessing the system. If two different users wanted to create a file with the
same name (say report.doc), it was not allowed in a single level directory.
In a two-level directory structure, there is a master node that has a separate
directory for each user. Each user can store the files in that directory. It can be
practically thought of as a folder that contains many folders, each for a
particular user, and now each user can store files in the allocated directory just
like a single level directory.
The pictorial representation of a two-level directory is shown below. For every
user, there is a separate directory. At the next level, every directory stores the
files just like a single-level directory. Although not very efficient, the two-level
directory is better than a single-level directory structure.
SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in
SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in
each user. The users can, however, create subdirectories inside their directory
and also store the files.
This is how things work on our PCs. We can store some files inside a folder and
also create multiple folders inside a folder.
The pictorial representation of a tree-structured directory is shown below. The
root directory is highly secured, and only the system administrator can access it.
We can see how there can be subdirectories inside the user directories. A user
cannot modify the root directory data. Also, a user cannot access another user's
directory.
SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in
SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in
UNIT-IV
SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in
This operating system consists of numerous computers, nodes, and sites joined
together via LAN/WAN lines. It enables the distribution of full systems on a
couple of center processors, and it supports many real-time products and
different users. Distributed operating systems can share their computing
resources and I/O files while providing users with virtual machine abstraction.
Types
There are three types of Distributed OS.
Client-Server Systems − It is a tightly coupled operating system. It is
used for multiprocessors and homogeneous multicomputer. Client-Server
Systems works as a centralized server because it provides the approval to all
requests, which are generated by the client systems side.
Peer-to-Peer Systems − It is a loosely coupled system. It is implemented
in the computer network application because it contains a bunch of processors,
SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in
and they are not shareable memories or clocks as well. Every processor consists
of its own local memory, and these processors communicate with each other
through various communication media such as high-speed buses or telephone
lines.
Middleware − It allows the interoperability in the between of all
applications, which are running on other operating systems. By using these
services those applications are capable of transferring all data to each other. It
allows distribution transparency.
2. Transparency:
An important goal of a distributed system is to hide the fact that its process
and resources are physically distributed across multiple computers. A
distributed system that is capable of presenting itself to users and applications
such that it is only a single computer system is called transparent.
The concept of transparency can be applied to many aspects of a distributed
system as shown in table.
3. Performance:
Building a transparent, flexible, reliable distributed system is useless if it is
slow like molasses. In particular application on a distributed system, it should
not deteriorate better than running some application on a single processor.
Various performance metrics can be used. Response time is one, but so are
throughput, system utilization, and amount of network capacity consumed.
Furthermore, the results of any benchmark are often highly dependent on the
nature of the benchmark. A benchmark involves a large number of
independent highly CPU-bound computations which give radically different
SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in
results than a benchmark that consists of scanning a single large file for same
pattern.
SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in
Pros of Multiprocessing OS
Increased reliability: Processing tasks can be spread among numerous
processors in the multiprocessing system. This promotes reliability because if
one processor fails, the task can be passed on to another.
Increased throughout: More work could be done in less time as the number of
processors increases.
The economy of scale: Multiprocessor systems are less expensive than single-
processor computers because they share peripherals, additional storage devices,
and power sources.
Cons of Multiprocessing OS
Multiprocessing operating systems are more complex and advanced since they
manage many CPUs at the same time.
SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in
SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in
2. Task Shifting –
Time assigned for shifting tasks in these systems is very less. For example, in
older systems, it takes about 10 microseconds. Shifting one task to another and
in the latest systems, it takes 3 microseconds.
3. Focus On Application –
Focus on running applications and less importance to applications that are in
the queue.
5. Error Free –
These types of systems are error-free.
6. Memory Allocation –
Memory allocation is best managed in these types of systems.
Disadvantages:
The disadvantages of real-time operating systems are as follows-
1. Limited Tasks –
Very few tasks run simultaneously, and their concentration is very less on few
applications to avoid errors.
SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in
3. Complex Algorithms –
The algorithms are very complex and difficult for the designer to write on.
5. Thread Priority –
It is not good to set thread priority as these systems are very less prone to
switching tasks.
SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in
SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in
SBS @PROPERITARY