Part 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 60

Operating System(KCS-401)

Introduction to Operating System


By

Puneet Kumar Goyal


Assistant Professor
Department of Information Technology
Ajay Kumar Garg Engineering College, Ghaziabad
Need of OS
The Users of a system can not directly interact with the system
Because computer Hardware only understand the machine language. It will be very
difficult for the users to learn this language and convert those requests instruction
into machine language.

To use the Computer Hardware in an efficient way


The operating system controls and coordinates the use of the hardware among the
various application programs for the various users. A computer system consist of
hardware, software, and data. The operating system provides the means for proper
use of these resources in the operation of the computer system.

An operating system is similar to a government. Like a government, it performs no


useful function by itself. It simply provides an environment within which other
programs can do useful work.
Definition of an OS
Definition of an OS

An Operating System is a system software that works as an


interface between the hardware and the user or between the
hardware and application software or system software. It can
also be defined as resource manager that manages both
hardware and software resources of a system.
Computer System Components
1. Hardware – provides basic computing resources (CPU, memory, I/O
devices).
2. Operating system – controls and coordinates the use of the
hardware among the various application programs for the various
users.
3. Applications programs – define the ways in which the system
resources are used to solve the computing problems of the users
(compilers, database systems, video games, business programs).
4. Users (people, machines, other computers).
Computer System Components
Booting Process in Computer
Booting is the process of loading an operating system. It’s the process that
starts when we turn on the computer (using the power button or by a
software command) and ends when the operating system is loaded into the
memory.
Steps in Booting
When computer is powered on, all the hardware components receive the
power and they get initialized. After that, the computer system goes through
following steps as follows:
1. BIOS is loaded.
2. POST(Power On Self Test) is performed.
3. Loading MBR into RAM.
Booting Process in Computer
4. Running the Bootloader and load the operating system into RAM.
5. Running the OS to complete system configuration and load system
utilities.
6. User authentication is performed.
Views of Operating System
The operating system may be observed from the point of view of the user or the
system, and it is known as the user view and the system view.
1. User View
2. System View
The user viewpoint focuses on how the user interacts with the operating system
through the usage of various application programs. In contrast, the system viewpoint
focuses on how the hardware interacts with the operating system to complete
various tasks.
1. User View
The user's view of the computer varies according to the interface being used.
a) Single User View Point
Most computer users sit in front of a PC, consisting of a monitor, keyboard, mouse,
and system unit.
Such a system is designed for one user to monopolize its resources.
Views of Operating System
The goal is to maximize the work (or play) that the user is performing. In
this case, the operating system is designed mostly for ease of use, with
some attention paid to performance and none paid to resource
utilization—how various hardware and software resources are shared.
b) Multiple User View Point
In other cases, a user sits at a terminal connected to a mainframe or
minicomputer. Other users are accessing the same computer through
other terminals. These users share resources and may exchange
information. The operating system in such cases is designed to maximize
resource utilization.
The client-server architecture is another good example where many
clients may interact through a remote server, and the same constraints of
effective use of server resources may arise.
Views of Operating System
c) Handled User View Point
Moreover, the touchscreen era has given you the best handheld
technology ever. Smartphones interact via wireless devices to perform
numerous operations, but they're not as efficient as a computer
interface, limiting their usefulness.
d) Embedded System User View Point
Some computers have little or no user view. For example, embedded
computers in home devices and automobiles may have numeric keypads
and may turn indicator lights on or off to show status, but they and their
operating systems are designed primarily to run without user
intervention.
Views of Operating System
2. System View
From the user point of view, we've discussed the numerous applications
that require varying degrees of user participation. However, we are more
concerned with how the hardware interacts with the operating system
than with the user from a system viewpoint. The hardware and the
operating system interact for a variety of reasons, including:
a) Resource Allocation
A computer system has many resources that may be required to solve a
problem: CPU time, memory space, file-storage space, I/O devices, and
so on. The operating system acts as the manager of these resources.
Views of Operating System
Facing numerous and possibly conflicting requests for resources, the
operating system must decide how to allocate them to specific programs
and users so that it can operate the computer system efficiently

b) Control Program
A control program manages the execution of user programs to prevent
errors and improper use of the computer. It is especially concerned
with the operation and control of I/O devices.
functions of an operating system
1. Storage Management
a) File System Management
b) Mass Storage Management
2. Device Management
3. Process Management
4. Memory Management
5. Protection and Security
functions of an operating system
1. Storage Management
To make the computer system convenient for users, the operating system
provides a uniform, logical view of information storage.
The operating system abstracts from the physical properties of its storage
devices to define a logical storage unit, the file.
functions of an operating system
a) File Management
A file is a collection of related information defined by its creator.
Commonly,
files represent programs (both source and object forms) and data.
The operating system is responsible for the following activities in
connection with file management:
✓Creating and deleting files
✓Creating and deleting directories to organize files
✓Supporting primitives for manipulating files and directories
✓Mapping files onto secondary storage
✓Backing up files on stable (nonvolatile) storage media
functions of an operating system
Operating systems also define user role and access management. For
example, you may want to keep a file with read-only permission so
unauthorized users can’t edit or delete it.

b) Mass Storage Management


As we know that main memory is too small to accommodate all data and
programs, and because the data that it holds are lost when power is lost,
the computer system must provide secondary storage to back up main
memory.
Hence, the proper management of disk storage is of central importance
to a computer system.
functions of an operating system
The operating system is responsible for the following activities in
connection with disk management:
✓Free-space management
✓Storage allocation
✓Disk scheduling
2. Device management
Most users rely on peripheral devices like mice, printers, and keyboards
to input information into their computers. In turn, these hardware
devices rely on their respective drivers to function. An operating system
uses an input/output (I/O) controller to manage those device drivers and
keep your devices connected to your computer.
functions of an operating system
The operating system does the following tasks:
✓Allocating and deallocating devices to different processes.
✓Keeps records of all the devices attached to the computer.
✓Decides which device to be allocated to which process and for how
much time.
3. Process management
The process is a program under the execution. The operating system
manages all the processes so that each process gets the CPU for a
specific time to execute itself, and there will be less waiting time for each
process. This management is also called process scheduling. For process
scheduling operating system uses various algorithms.
functions of an operating system
The operating system manages processes by doing the following task:
✓Allocating and deallocating the resources.
✓Allocates resources such that the system doesn’t run out of resources.
✓Offering mechanisms for process synchronization.
✓Helps in process communication.
4. Memory management
One of the most critical functions of an operating system is memory
management. This is the process of keeping track of all different
applications and processes running on your computer and all the data
they’re using.
functions of an operating system
Operating systems perform the following tasks-
✓Allocating/deallocating memory to store programs.
✓Deciding the amount of memory that should be allocated to the
program.
✓Memory distribution while multiprocessing.
✓Update the status in case memory is freed
✓Keeps record of how much memory is used and how much is unused.
✓It also makes sure that executing programs do not interfere with each
other.
functions of an operating system
5. Protection and Security
Security grants the system access to the appropriate users only.
While protection deals with the access to the system resources.

In security, external threats are involved. While in protection, internal


threats are involved.
Security illustrates that which person is granted for using the system.
Whereas protection determines that what files can be accessed or
permeated by a special user.
Types of OS
1) Batch Operating System.
2) Multiprogramming Operating System.
3) Multitasking Operating System.
4) Multiprocessing Operating System.
5) Distributed Operating System.
6) Clustered Operating System.
7) Real Time Operating System.
8) Desktop System.
9) Handheld System.
10) Multithreaded Operating System.
Types of OS
1) Batch Operating System
Batch OS is the first operating system for second-generation computers.
In Batch processing, similar types of jobs are grouped together to make a
batch and then these batches are executed one by one based on the
first-come, first, serve principle.
Examples of Batch OS: payroll system, bank statements, data entry, Billing
System etc.
Types of OS
1) Batch Operating System
Memory Layout for a Simple Batch System
Types of OS
Advantages of Batch Operating System
✓Managing large works becomes easy in batch systems.
✓The idle time for a single batch is very less.
✓In batch system all jobs are performed in repeating form with less user’s
intervention.
Disadvantages of Batch Operating System
✓Not Interactive
✓It is hard to debug batch systems.
✓If a job fails, then the other jobs have to wait for an unknown time till the issue
is resolved.
✓Due to any mistake, any job can enter into infinite loop and can cause
starvation.
Types of OS
DOS/360, DOS/VS, GCOS, GECOS, MVS, OS/1100 are some Batch OS.
2) Multiprogramming Operating System
✓To best utilize the CPU, modern operating systems employ multiprogramming
✓which allows several jobs to be in memory at the same time, thus ensuring
the CPU always has a job to execute.
✓Each process needs two types of system time: CPU time and IO time. So if a
running process perform I/O or some other event which does not require CPU
Then in-place of sitting idle, CPU makes a context switch and pick some other
process and this idea will continue till memory has single process to be
executed.
Types of OS
Advantages of Multiprogramming Operating System
✓Therefore, multiprogramming improves the efficiency and throughput of the
system.
✓It also reduces the response time and waiting time.
✓Provides High CPU utilization.
Disadvantages of Multiprogramming Operating System
✓It’s quite complex and sophisticated.
✓CPU scheduling is necessary.
✓Since all types of tasks get stored in the main memory, memory management
is required in the operating system.
Types of OS

Multiprogramming Operating System


Types of OS
3) Multitasking OS/Time Sharing OS/Fair Share/Multiprogramming with
Round Robin Scheduling
✓Multitasking means multiprogramming with time sharing.
✓It is also called multiprogramming with preemption.
✓Only one CPU switches between processes so quickly which makes an illusion that
all the processes are executing at the same time.
Advantages of Multitasking OS
✓The multitasking operating systems have well-defined memory management.
✓ Time Shareable: All jobs are given a defined amount of time, so they don't have
to wait for the CPU.
Types of OS
✓Systems becomes more interactive.
✓It provides less response time.
✓Provides High CPU utilization.
✓It improves the efficiency and throughput of the system.
✓Users can concurrently run several programs, such as internet browsers, games,
Microsoft Excel, PowerPoint, and other tasks in a Multitasking Operating System.
Types of OS
Disadvantages of Multitasking Operating System

✓It’s quite complex and sophisticated.

✓CPU scheduling is necessary.

✓Since all types of tasks get stored in the main memory, memory management is
required in the operating system.
Types of OS

Multitasking Operating System


Types of OS
4) Multiprocessing/Parallel Operating System
In Multiprocessing, Parallel computing is achieved. There are more than one
processors present in the system which can execute more than one process at the
same time. This will increase the throughput of the system.
In a multiprocessing OS, a motherboard can handle many processors.
Types of OS
Advantages of Multiprocessing OS
✓ Increased throughput
✓ Economical -Multiprocessor systems are less expensive than single-
processor computers because they share peripherals, additional storage
devices, and power sources.
✓ Increased reliability
▪ graceful degradation
▪ fail-soft systems

Disadvantages of Multiprocessing OS

✓ Multiprocessing operating systems are more complex and advanced since they
manage many CPUs at the same time.
Types of OS
Multiprocessing/Parallel Operating System
It is also known as Tightly coupled system – processors share memory and a clock;
communication usually takes place through the shared memory.

Types of multiprocessing systems:

a) Symmetrical multiprocessing operating system


b) Asymmetric multiprocessing operating system
Types of OS
4-a) Symmetrical multiprocessing operating system:
✓ In a Symmetrical multiprocessing system, each processor executes the same copy
of the operating system.
✓ It try to create a system in which all processors are equally burdened at any time.
✓ Therefore, any new job submitted by a user can be assigned to any processor that
is least burdened.
✓ The symmetric multiprocessing operating system is also known as a "shared every-
thing" system.
✓ In this system processors do not usually exceed more than 16.
Types of OS
Types of OS
Advantages of Symmetrical multiprocessing operating system:

✓ These systems are fault-tolerant. Failure of a few processors does not bring the
entire system to a halt.

Disadvantages of Symmetrical multiprocessing operating system:

✓ It is very difficult to balance the workload among processors rationally.


✓ Specialized synchronization schemes are necessary for managing multiple
processors.
Types of OS
4-b) Asymmetrical multiprocessing operating system:
✓ In an asymmetric multiprocessing system, there is a master slave relationship
between the processors.
✓ Further, one processor may act as a master processor or supervisor processor
while others work as slave processors.

In the given figure, the asymmetric processing


system shows that CPU n1 acts as a supervisor that
controls the activities of other processors.
Types of OS
Advantages of asymmetrical multiprocessing operating system:
✓ Asymmetric multiprocessing system is much easier to design and handle than
symmetric multiprocessing system. This is one of the reasons it is comparatively
cheaper.
Disadvantages of asymmetrical multiprocessing operating system:
✓ In this type of multiprocessing operating system the processors are unequally
burdened.
✓ In this system, if the process handling a specific work fails, the entire system will go
down.
Types of OS
5) Distributed Operating System
✓ A distributed operating system is one in which several computer systems
connected through a single communication channel.
✓ Moreover, these systems have their individual processors and memory.
✓ Distribute the computation among several physical processors.
✓ Loosely coupled system – each processor has its own local memory; processors
communicate with one another through various communications lines, such as
high-speed buses etc.

✓ It Requires networking infrastructure such as


Local area networks (LAN) or Wide area networks
(WAN)
Types of OS
Advantages of distributed systems
✓ Resources Sharing
✓ Computation speed up – load sharing
✓ Reliability
✓ Communications

Disadvantages of Distributed OS

✓ The cost for set up is more.


✓ Failure of the main system will affect the whole system.
✓ Programming is complex.
Types of OS
Types of Distributed Operating System

5-a) Client/Server Systems


✓ In this system, the client requests the server for a resource. On the other hand, the
server provides this resource to the client.
✓ One client contacts only a single server at a time. Whereas a single server can deal
with multiple clients simultaneously.
✓ The clients and servers connect through a computer network in the system.
5-b) Peer to Peer Systems
✓ In this system, the nodes play an important role. All the work equally divides
among the nodes.
✓ Furthermore, these nodes can share data or resources as per the requirement.
Again, they require a network to connect.
Types of OS
6) Clustered Operating System
✓ Cluster systems like as parallel systems because both systems use multiple CPUs.
But, main difference is that clustered systems are made by two or more individual
systems but they are connected with each other.
✓ They have independent computer system or CPU along with shared storage
medium and all systems perform all tasks together.
Types of OS
✓ A cluster operating system is a combination of hardware and software clusters.
✓ The hardware clusters help in sharing high-performance disks between all the
computer systems or the nodes.
✓ The software cluster ensures and manages the working of all the systems together.
✓ Each node in the cluster system contains the cluster software. This software keeps
an eye on the entire cluster system and ensures it works properly.
Types of OS
There are mainly three types of the clustered operating system:
a) Asymmetric Clustering System
b) Symmetric Clustering System
c) Parallel Cluster System
6-a) Asymmetric Clustering System
✓ In an asymmetric clustering system, one of the nodes is in a hot standby node.
✓ This standby node continuously monitors the entire system.
✓ The hot-standby node is a component of the cluster system, and it's completely fail-
safe.
✓ The hot-standby node is used as a replacement if any of the nodes from the system
fails.
Types of OS

Fig-Asymmetric Clustering System

6-b) Symmetric Clustering System


✓ In a symmetric clustering system, all the nodes run applications and at the same
time monitor other nodes as well.
✓ This type of clustering system is more effective than the asymmetric system as it
doesn't have a specific hot-standby node instead all the nodes monitor other nodes
in the system.
Types of OS

Fig-Symmetric Clustering System

6-c) Parallel Cluster System


✓ In a parallel cluster system, multiple users are allowed to access similar data on the
common shared storage among the nodes.
✓ This is possible using special software and other applications.
Types of OS
Advantages of Cluster Operating System
✓ Superior Availability: The failure of a single node in the system doesn't mean the
loss of service or the task in the system. if any of the node failures occur then the
remaining nodes can take the load of that failed node and do not interrupt the
service.

✓ Efficiency: The cluster operating systems are more cost-effective as compared to


highly reliable and larger storage mainframe computers.

✓ Error Tolerance: If any error or fault occurs in any of the nodes of the system then
the failed node can be swapped with the hot standby node in such situations.

✓ Performance: The cluster operating systems results in high performance as there


are more than two nodes available that are merged.
Types of OS
Advantages of Cluster Operating System

✓ Scalability: These cluster systems are scalable as it is easy to add more nodes to
the system.

Disadvantages of Cluster Operating System

✓ High Cost: The major disadvantage of the cluster operating system is that it
requires more cost to meet the hardware and software requirements to create a
cluster.

✓ Maintenance: The cluster resources are challenging to maintain and manage and
thus require a high cost to improve the system.
Types of OS
7) Real Time Operating System:
✓ A real-time operating system (RTOS) is a special-purpose operating system used in
computers that has strict time constraints for any job to be performed.
✓ This system is time-bound and has a fixed deadline.
✓ The processing in this type of system must occur within the specified constraints.
Otherwise, This will lead to system failure.
✓ Real-time operating systems employ special-purpose operating systems because
conventional operating systems do not provide such performance.
Types of OS
Types of Real Time Operating System:
7-a) Hard Real-Time operating system:
✓ In Hard RTOS, all critical tasks must be completed within the specified time
duration, i.e., within the given deadline.
✓ Not meeting the deadline would result in critical failures such as damage to
equipment or even loss of human life.
✓ For example airbags provided by carmakers along with a handle in the driver's seat.
✓ Similarly, consider an on-stock trading software.
✓ Also airplane sensor and autopilot systems.
Types of OS
Types of Real Time Operating System:
7-b) Soft Real-Time operating system:
✓ This operating system provides some relaxation in the time limit.
✓ There may be a closing date assigned for a particular job, but a delay for a small
amount of time is acceptable.
✓ In soft real-time tasks, even after the deadline, result is not considered incorrect
and system failure does not occur.
✓ Examples are Personal computer, Personal computer, Audio and video systems,
Set-top boxes, Weather Monitoring Systems, Web browsing, Railway Reservation
System, Electronics games etc.
Types of OS
Types of Real Time Operating System:
7-c) Firm Real-Time operating system:
✓ Firm real-time tasks are such type of real-time tasks which are associated with time
bound and the task need to produce the result within the deadline.
✓ In firm real-time tasks, result obtained after the deadline is considered incorrect
but system failure does not occur.
✓ Example: Satellite based tracking, Video Conferencing, Set-top box etc.
Types of OS
Advantages of RTOS:
a) Maximum consumption: Maximum utilization of devices and systems.
b) Real-Time Operating System In Embedded System: Since the size of programs is
small, RTOS can also be embedded systems.
c) Error Free Systems.
d) Memory Allocation: Memory allocation is best managed in these types of
systems.
Types of OS
Disadvantages of RTOS:
a) Limited Tasks: Very few tasks run simultaneously.
b) The algorithms used are very complex and difficult for the designer to write on.
c) Real-time operating systems are very complex and can consume critical CPU
cycles.
Types of OS
8) Desktop Systems:
✓ Personal computers – computer system dedicated to a single user.
✓ I/O devices – keyboards, mice, display screens, small printers.
✓ User convenience and responsiveness.
✓ Can adopt technology developed for larger operating system’ often individuals
have sole use of computer and do not need advanced CPU utilization of protection
features.
✓ May run several different types of operating systems (Windows, MacOS, UNIX,
Linux)
Types of OS
9) Handheld Systems:
✓ Personal Digital Assistants (PDAs)
✓ Cellular telephones
✓ Issues:
✓ Limited memory
✓ Slow processors
✓ Small display screens.
Kernel in OS

You might also like