CB3402,OSS BOOK
CB3402,OSS BOOK
A diagram that shows the flow of data between these units is as follows −
The input data travels from input unit to ALU. Similarly, the computed data
travels from ALU to output unit. The data constantly moves from storage unit to
ALU and back again. This is because stored data is computed on before being
stored again. The control unit controls all the other units as well as their data.
Input Unit
The input unit provides data to the computer system from the outside. So,
basically it links the external environment with the computer. It takes data
from the input devices, converts it into machine language and then loads
it into the computer system. Keyboard, mouse etc. are the most
commonly used input devices.
Output Unit
The output unit provides the results of computer process to the users i.e it
links the computer with the external environment. Most of the output data
is the form of audio or video. The different output devices are monitors,
printers, speakers, headphones etc.
Storage Unit
Storage unit contains many computer components that are used to store
data. It is traditionally divided into primary storage and secondary
storage. Primary storage is also known as the main memory and is the
memory directly accessible by the CPU. Secondary or external storage is
not directly accessible by the CPU. The data from secondary storage
needs to be brought into the primary storage before the CPU can use it.
Secondary storage contains a large amount of data permanently.
Arithmetic Logic Unit
All the calculations related to the computer system are performed by the
arithmetic logic unit. It can perform operations like addition, subtraction,
multiplication, division etc. The control unit transfers data from storage
unit to arithmetic logic unit when calculations need to be performed. The
arithmetic logic unit and the control unit together form the central
processing unit.
Control Unit
This unit controls all the other units of the computer system and so is
known as its central nervous system. It transfers data throughout the
computer as required including from storage unit to central processing
unit and vice versa. The control unit also dictates how the memory, input
output devices, arithmetic logic unit etc. should behave.
Process Management
The operating system is responsible for managing the processes i.e assigning
the processor to a process at a time. This is known as process scheduling. The
different algorithms used for process scheduling are FCFS (first come first
served), SJF (shortest job first), priority scheduling, round robin scheduling etc.
There are many scheduling queues that are used to handle processes in process
management. When the processes enter the system, they are put into the job
queue. The processes that are ready to execute in the main memory are kept in
the ready queue. The processes that are waiting for the I/O device are kept in
the device queue.
Memory Management
The activities performed by the operating system for memory management are
−
There are many I/O devices handled by the operating system such as mouse,
keyboard, disk drive etc. There are different device drivers that can be
connected to the operating system to handle a specific device. The device
controller is an interface between the device and the device driver. The user
applications can access all the I/O devices using the device drivers, which are
device specific codes.
File Management
Files are used to provide a uniform view of data storage by the operating
system. All the files are mapped onto physical devices that are usually non
volatile so data is safe in the case of system failure.
The files can be accessed by the system in two ways i.e. sequential access and
direct access −
Sequential Access
The information in a file is processed in order using sequential access. The
files records are accessed on after another. Most of the file systems such
as editors, compilers etc. use sequential access.
Direct Access
In direct access or relative access, the files can be accessed in random for
read and write operations. The direct access model is based on the disk
model of a file, since it allows random accesses.
as CPU, softwares, memory etc. are protected. This extends to the operating system as well
as the data in the system. This can be done by ensuring integrity, confidentiality and
availability in the operating system. The system must be protect against unauthorized
Distributed System
• Definition: A distributed system is a collection of autonomous hosts that are
connected through a computer network.
• A distributed system is a collection of independent computers that appears to its
users as a single coherent system. Each host executes components and operates a
distribution middleware.
Middleware enables the components to coordinate their activities. Users perceive
the system as a single, integrated computing facility.
• A distributed computer system consists of multiple software components that are
on multiple computers, but run as a single system. The computers that are in a
distributed system can be physically close together and connected by a local
network, or they can be geographically distant and connected by a wide area
network.
• A distributed system can consist of any number of possible configurations, such
as
mainframes, personal computers, workstations, minicomputers and so on, such a
• Distributed operating systems depend on networking for their operation.
Distributed OS runs on and controls the resources of multiple machines. It sts
provides resource sharing across the boundaries of a single computer system. It
looks to users like a single machine OS.
Distributing OS owns the whole network and makes it look like a virtual otauni-
processor or may be a virtual multiprocessor.
• Definition: A distributed operating system is one that looks to its users like an
ordinary operating system but runs on multiple, independent CPU.
• Distributed systems depend on networking for their functionality. Fig. 1.6.1
shows the distributed system.
Client-Server Computing
• The system is structured as a set of processes, called servers that offer services to
the users, called clients.
• Server systems are of two types: Compute servers and file servers.
Compute-server system: It provides an interface to which a client can send a
request to perform an action. In response, the server performs some operation and
sends the results to the client. Server contains database.
• File-server system: Client can performs various operation like create, read,
update and delete file on file server. Web server is best example of this type.
• Fig. 1.6.2 shows the client server model.
• The client-server model is usually based on a simple request/reply protocol,
implemented with send/receive primitives or using Remote Procedure Calls (RPC)
or Remote Method Invocation (RMI) :
1. The client sends a request (invocation) message to the server asking for some
service;
2. The server does the work and returns a result (e.g. the data requested) or an error
code if the work could not be performed.
• Server is a process; Client is a process. Clients invoke servers, servers send
results to clients. Servers can be clients of other servers.
HTTP server may be a client of a database server. Service may be provided by
multiple servers, as is most often the case within a large enterprise.
• Cache is a repository of recently accessed objects (files, graphics) that is
physically closer to the client than the server from which it originated. Proxy
server sits in between clients and servers and can play many mitigation roles.
Advantages:
1. Simple to implement.
2. Provides good security.
3. All files are stored in a central location.
Disadvantages:
1. Single point of failure.
2. A specialist network operating system is needed.
Peer-to-Peer System
• All processes (objects) play similar role. Do not require a server process.
Processes (objects) interact without particular distinction between clients and
servers.
• The pattern of communication depends on the particular application. Fig. 1.6.3
shows the peer-to-peer model. (See Fig. 1.6.3 on next page.)
• Processing and communication loads for access to objects are distributed across
many computers and access links. This is the most general and flexible model.
• A group of computers connected together to combine their computing and
'processing abilities to search the Internet or solve very complex problems
Operating system is a software that acts as an intermediary between the user
and computer hardware. It is a program with the help of which we are able to
run various applications. It is the one program that is running all the time. Every
computer must have an operating system to smoothly execute other programs.
The OS coordinates the use of the hardware and application programs for
various users. It provides a platform for other application programs to work. The
operating system is a set of special programs that run on a computer system
that allows it to work properly. It controls input-output devices, execution of
programs, managing files, etc.
Services of Operating System
1. Program execution
2. Input Output Operations
3. Communication between Process
4. File Management
5. Memory Management
6. Process Management
7. Security and Privacy
8. Resource Management
9. User Interface
10. Networking
11. Error handling
12. Time Management
Program Execution
It is the Operating System that manages how a program is going to be
executed. It loads the program into the memory after which it is executed. The
order in which they are executed depends on the CPU Scheduling Algorithms.
A few are FCFS, SJF, etc. When the program is in execution, the Operating
System also handles deadlock i.e. no two processes come for execution at the
same time. The Operating System is responsible for the smooth execution of
both user and system programs. The Operating System utilizes various
resources available for the efficient running of all types of functionalities.
Input Output Operations
Operating System manages the input-output operations and establishes
communication between the user and device drivers. Device drivers are
software that is associated with hardware that is being managed by the OS so
that the sync between the devices works properly. It also provides access to
input-output devices to a program when needed.
Communication between Processes
The Operating system manages the communication between processes.
Communication between processes includes data transfer among them. If the
processes are not on the same computer but connected through a computer
network, then also their communication is managed by the Operating System
itself.
File Management
The operating system helps in managing files also. If a program needs access
to a file, it is the operating system that grants access. These permissions
include read-only, read-write, etc. It also provides a platform for the user to
create, and delete files. The Operating System is responsible for making
decisions regarding the storage of all types of data or files, i.e, floppy disk/hard
disk/pen drive, etc. The Operating System decides how the data should be
manipulated and stored.
Memory Management
Let’s understand memory management by OS in simple way. Imagine a cricket
team with limited number of player . The team manager (OS) decide whether
the upcoming player will be in playing 11 ,playing 15 or will not be included in
team , based on his performance . In the same way, OS first check whether the
upcoming program fulfil all requirement to get memory space or not ,if all things
good, it checks how much memory space will be sufficient for program and then
load the program into memory at certain location. And thus , it prevents
program from using unnecessary memory.
Process Management
Let’s understand the process management in unique way. Imagine, our kitchen
stove as the (CPU) where all cooking(execution) is really happen and chef as
the (OS) who uses kitchen-stove(CPU) to cook different dishes(program). The
chef(OS) has to cook different dishes(programs) so he ensure that any
particular dish(program) does not take long time(unnecessary time) and all
dishes(programs) gets a chance to cooked(execution) .The chef(OS) basically
scheduled time for all dishes(programs) to run kitchen(all the system) smoothly
and thus cooked(execute) all the different dishes(programs) efficiently.
Security and Privacy
Security : OS keep our computer safe from an unauthorized user by adding
security layer to it. Basically, Security is nothing but just a layer of protection
which protect computer from bad guys like viruses and hackers. OS provide
us defenses like firewalls and anti-virus software and ensure good safety of
computer and personal information.
Privacy : OS give us facility to keep our essential information hidden like
having a lock on our door, where only you can enter and other are not
allowed . Basically , it respect our secrets and provide us facility to keep it
safe.
Resource Management
System resources are shared between various processes. It is the Operating
system that manages resource sharing. It also manages the CPU time among
processes using CPU Scheduling Algorithms. It also helps in the memory
management of the system. It also controls input-output devices. The OS also
ensures the proper use of all the resources available by deciding which
resource to be used by whom.
User Interface
User interface is essential and all operating systems provide it. Users either
interface with the operating system through the command-line interface or
graphical user interface or GUI. The command interpreter executes the next
user-specified command.
A GUI offers the user a mouse-based window and menu system as an
interface.
Networking
This service enables communication between devices on a network, such as
connecting to the internet, sending and receiving data packets, and managing
network connections.
Error Handling
The Operating System also handles the error occurring in the CPU, in Input-
Output devices, etc. It also ensures that an error does not occur frequently and
fixes the errors. It also prevents the process from coming to a deadlock. It also
looks for any type of error or bugs that can occur while any task. The well-
secured OS sometimes also acts as a countermeasure for preventing any sort
of breach of the Computer System from any external source and probably
handling them.
Time Management
Imagine traffic light as (OS), which indicates all the cars(programs) whether it
should be stop(red)=>(simple queue) , start(yellow)=>(ready
queue),move(green)=>(under execution) and this light (control) changes after a
certain interval of time at each side of the road(computer system) so that the
cars(program) from all side of road move smoothly without traffic.
Kernel Components
The kernel stores and organizes a lot of information. So it has data about which
processes are running in the system, their memory requirements, files in use
etc. To handle all this, three important structures are used. These are process
table, file table and v node/ i node information.
Process Table
The process table stores information about all the processes running in the
system. These include the storage information, execution status, file information
etc.
When a process forks a child, its entry in the process table is duplicated
including the file information and file pointers. So the parent and the child
process share a file.
File Table
The file table contains entries about all the files in the system. If two or more
processes use the same file, then they contain the same file information and the
file descriptor number.
Each file table entry contains information about the file such as file status (file
read or file write), file offset etc. The file offset specifies the position for next
read or write into the file.
The file table also contains v-node and i-node pointers which point to the virtual
node and index node respectively. These nodes contain information on how to
read a file.
Both the v-node and i-node are references to the storage system of the file and
the storage mechanisms. They connect the hardware to the software.
The v-node is an abstract concept that defines the method to access file data
without worrying about the actual structure of the system. The i-node specifies
file access information like file storage device, read/write procedures etc.