0% found this document useful (0 votes)
9 views

Unit 1 Operating System

An Operating System (OS) serves as an interface between users and hardware, managing processes, resources, and providing an environment for program execution. Various types of operating systems include Batch, Multiprogramming, Multiprocessing, Multitasking, Network, Real-Time, Time-Sharing, and Distributed systems, each with distinct advantages and disadvantages. Personal computers (PCs) are integral to daily life, facilitating education, entertainment, communication, and information access, but they also pose risks such as physical health issues and internet addiction.

Uploaded by

Atish
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Unit 1 Operating System

An Operating System (OS) serves as an interface between users and hardware, managing processes, resources, and providing an environment for program execution. Various types of operating systems include Batch, Multiprogramming, Multiprocessing, Multitasking, Network, Real-Time, Time-Sharing, and Distributed systems, each with distinct advantages and disadvantages. Personal computers (PCs) are integral to daily life, facilitating education, entertainment, communication, and information access, but they also pose risks such as physical health issues and internet addiction.

Uploaded by

Atish
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 27

Operating System

Operating System can be defined as an interface between user and the


hardware. It provides an environment to the user so that, the user can
perform its task in convenient and efficient way.

The Operating System Tutorial is divided into various parts based on its
functions such as Process Management, Process Synchronization, Deadlocks
and File Management.

Operating System Definition and Function


In the Computer System (comprises of Hardware and software), Hardware
can only understand machine code (in the form of 0 and 1) which doesn't
make any sense to a naive user.

We need a system which can act as an intermediary and manage all the
processes and resources present in the system.

An Operating System can be defined as an interface between user and


hardware. It is responsible for the execution of all the processes, Resource
Allocation, CPU management, File Management and many other tasks.

The purpose of an operating system is to provide an environment in which a


user can execute programs in convenient and efficient manner.

Structure of a Computer System


A Computer System consists of:
o Users (people who are using the computer)
o Application Programs (Compilers, Databases, Games, Video player,
Browsers, etc.)
o System Programs (Shells, Editors, Compilers, etc.)
o Operating System ( A special program which acts as an interface
between user and hardware )
o Hardware ( CPU, Disks, Memory, etc)

What does an Operating system do?


1. Process Management
2. Process Synchronization
3. Memory Management
4. CPU Scheduling
5. File Management
6. Security

Types of Operating Systems (OS)


An operating system is a well-organized collection of programs that manages
the computer hardware. It is a type of system software that is responsible for
the smooth functioning of the computer system.

Batch Operating System


In the 1970s, Batch processing was very popular. In this technique, similar
types of jobs were batched together and executed in time. People were used
to having a single computer which was called a mainframe.

In Batch operating system, access is given to more than one person; they
submit their respective jobs to the system for the execution.

The system put all of the jobs in a queue on the basis of first come first serve
and then executes the jobs one by one. The users collect their respective
output when all the jobs get executed.
The purpose of this operating system was mainly to transfer control from one
job to another as soon as the job was completed. It contained a small set of
programs called the resident monitor that always resided in one part of the
main memory. The remaining part is used for servicing jobs.
Advantages of Batch OS

o The use of a resident monitor improves computer efficiency as it


eliminates CPU time between two jobs.

Disadvantages of Batch OS
1. Starvation

Batch processing suffers from starvation.

For Example:
There are five jobs J1, J2, J3, J4, and J5, present in the batch. If the execution
time of J1 is very high, then the other four jobs will never be executed, or
they will have to wait for a very long time. Hence the other processes get
starved.

2. Not Interactive

Batch Processing is not suitable for jobs that are dependent on the user's
input. If a job requires the input of two numbers from the console, then it will
never get it in the batch processing scenario since the user is not present at
the time of execution.

Multiprogramming Operating System


Multiprogramming is an extension to batch processing where the CPU is
always kept busy. Each process needs two types of system time: CPU time
and IO time.

In a multiprogramming environment, when a process does its I/O, The CPU can start
the execution of other processes. Therefore, multiprogramming improves the
efficiency of the system.
Advantages of Multiprogramming OS

o Throughout the system, it increased as the CPU always had one


program to execute.
o Response time can also be reduced.

Disadvantages of Multiprogramming OS

o Multiprogramming systems provide an environment in which various


systems resources are used efficiently, but they do not provide any
user interaction with the computer system.

Multiprocessing Operating System or Parallel


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 Multiprocessing, Parallel computing is achieved. More than one processor present
in the system can execute more than one process simultaneously, which will
increase the throughput of the system.

Advantages of Multiprocessing operating system:

o Increased reliability: Due to the multiprocessing system, processing


tasks can be distributed among several processors. This increases
reliability as if one processor fails, the task can be given to another
processor for completion.
o Increased throughout: As several processors increase, more work
can be done in less.

Disadvantages of Multiprocessing operating System

o Multiprocessing operating system is more complex and sophisticated


as it takes care of multiple CPUs simultaneously.

Multitasking Operating System

The multitasking operating system is a logical extension of a multiprogramming


system that enables multiple programs simultaneously. It allows a user to perform
more than one computer task at the same time.
Advantages of Multitasking operating system

o This operating system is more suited to supporting multiple users


simultaneously.
o The multitasking operating systems have well-defined memory
management.

Disadvantages of Multitasking operating system

o The multiple processors are busier at the same time to complete any
task in a multitasking environment, so the CPU generates more heat.

Network Operating System


An Operating system, which includes software and associated protocols to
communicate with other computers via a network conveniently and cost-
effectively, is called Network Operating System.

Advantages of Network Operating System


o In this type of operating system, network traffic reduces due to the
division between clients and the server.
o This type of system is less expensive to set up and maintain.

Disadvantages of Network Operating System

o In this type of operating system, the failure of any node in a system


affects the whole system.
o Security and performance are important issues. So trained network
administrators are required for network administration.

Real Time Operating System


In Real-Time Systems, each job carries a certain deadline within which the
job is supposed to be completed, otherwise, the huge loss will be there, or
even if the result is produced, it will be completely useless.

The Application of a Real-Time system exists in the case of military


applications, if you want to drop a missile, then the missile is supposed to be
dropped with a certain precision.
Advantages of Real-time operating system:

o Easy to layout, develop and execute real-time applications under the


real-time operating system.
o In a Real-time operating system, the maximum utilization of devices
and systems.

Disadvantages of Real-time operating system:

o Real-time operating systems are very costly to develop.


o Real-time operating systems are very complex and can consume
critical CPU cycles.

Time-Sharing Operating System


In the Time Sharing operating system, computer resources are allocated in a
time-dependent fashion to several programs simultaneously. Thus it helps to
provide a large number of user's direct access to the main computer. It is a
logical extension of multiprogramming. In time-sharing, the CPU is switched
among multiple programs given by different users on a scheduled basis.
A time-sharing operating system allows many users to be served
simultaneously, so sophisticated CPU scheduling schemes and Input/output
management are required.

Time-sharing operating systems are very difficult and expensive to build.

Advantages of Time Sharing Operating System

o The time-sharing operating system provides effective utilization and


sharing of resources.
o This system reduces CPU idle and response time.

Disadvantages of Time Sharing Operating System

o Data transmission rates are very high in comparison to other methods.


o Security and integrity of user programs loaded in memory and data
need to be maintained as many users access the system at the same
time.
Distributed Operating System
The Distributed Operating system is not installed on a single machine, it is
divided into parts, and these parts are loaded on different machines. A part
of the distributed Operating system is installed on each machine to make
their communication possible. Distributed Operating systems are much more
complex, large, and sophisticated than Network operating systems because
they also have to take care of varying networking protocols.

Advantages of Distributed Operating System

o The distributed operating system provides sharing of resources.


o This type of system is fault-tolerant.

What is a PC or personal computer systems?


Generally, a PC contains a keyboard, mouse, monitor, and system unit. Most
of the personal computers have an Internet or a network connection,
including ports for connecting peripheral devices like external hard drives,
scanners, printers, digital cameras, and more. Even if the term PC can refer
to any personal computer, including an Apple Macintosh computer, but it is
commonly used in the computer industry to describe an IBM or IBM-
compatible computer.

Personal computers are used to create spreadsheets, write papers, play


games, track our finances, account, run databases, and many other tasks.
Also, at home, it is widely used for playing PC games, multimedia
entertainment, accessing the Internet and more. If your PC is connected to
the Internet, you can use it for communicating with friends via instant
messaging programs, browsing the Web, checking e-mail, and downloading
data or files. It is normal for a personal computer to create a network by
connecting more than one PC together, even though they are designed to
use as single-user systems.

A personal computer can be a laptop computer, a microcomputer, a


handheld PC, a desktop computer, or a tablet PC. Additionally, without PCs,
life can be difficult as it has become such an integral part of our lives.

Usually, PCs have various parts, which are as follows:

o Computer case
o Motherboard
o Power supply
o CD/DVD drives/writers
o Random-access memory (RAM)
o Hard disk(s)
o Numerous external devices, such as a keyboard, printer, visual display
and pointing device

Computers were only affordable by large enterprises and universities and


occupied whole rooms in the mid-1960s and 1970s. Multiple users
accessed these computers through the attached terminals. In the early
1980s, the term PC become popular and build as the Man of the Year on
Time Magazine's choice of PC for 1982. Technology had advanced far enough
by the late 1980s that a small computer owned by a single individual and
could be used to perform a specific task. IBM termed as the IBM PC,
introduced its first personal computer in 1981. It became more popular
speedily in the market.

Benefits of Personal Computers


Personal computers play an important role for individuals in both personal
and professional ways. From preschoolers to senior citizens, personal
computers have advantages for everyone. The technology of the personal
computer provides you various benefits by saving your money, time, and
many other ways.

o Education: A personal computer can be used for education purposes


at school or college, work and home. In school, a personal computer
can be used to make an attendance sheet for students. Also, a teacher
can use the personal computer to learn about subjects if he does not
have expertise in the subject in which he is going to discuss a
classroom. It may be used to take quizzes in the classroom and learn
about other cultures with the help of software programs.
A personal computer can be used to learn new skills to improve your
performance and new processes in the workplace. At home, it can be
used by students or others to learn subjects such as math, spelling,
and reading by using a software program on the computer.
o Entertainment: A personal computer is also used for entertainment.
On the computer, you can play games with other people through
software programs, even though they are thousands of miles away.
Additionally, if anyone does not want to play a game with someone, it
offers users options to use single-player games on the personal
computer as well.
It allows you to watch movies and television shows any time, but you
are required to download them. You can also watch the videos online
by connecting your personal computer to the Internet or a network. In
this way, you can manage your schedule accordingly, rather than let
the television networks control it for you.
o Communication: A personal computer offers multiple options for
communication with others. As you can use your computer to make a
call over the Internet, and do not need a separate telephone. A
personal computer is not only used for work but can also be used to
share and synchronize schedules for personal life as well. It can be
used by employees to work with other employees as a team on
opposite work schedules with the help of sharing documents and
leaving notes about the project. Furthermore, it helps to reduce
society's reliance on the phone by communicating over e-mail and
instant messaging on computers.
Communication is also possible between humans and machines as well
as between humans over a computer. For example, you can turn off
your lights while you are outside your house. Also, you can set your
DVR to record a movie if it is connected to your computer via a
wireless Internet connection.

Information: A personal computer helps people to have information


constantly at their fingertips by connecting the Internet. On the computer, a
user can type a desirable website URL into the search bar of the browser and
visit this site in just a few seconds. There are several user-submitted
communities, books, and encyclopedias, available online that are designed
to offer specific types of information, such as walkthroughs, video game.

Disadvantages of Personal Computers


o Physical Side Effects: The use of a computer frequently can lead to a
variety of physical problems like backaches, tight hamstrings, wrist
soreness and tension headaches. Laptop users have faced problems as
they need to bend their back in order to appropriately view the screen.
It can also be harmful to people who use a computer all day, as they
can prone to tight muscles, strained eyes and carpal tunnel syndrome.
Furthermore, with a personal computer, people are required to sit all
day that can be a reason for more thoughtful health conditions.
o Internet Addiction: A person who has a deep addiction to the
Internet may include addiction to online gaming, cyber-relationships,
online gambling, etc. Internet addiction people may use the Internet to
avoid from loneliness, stress, or depression in their daily life and get
anxiety when they are offline. Although the use of the internet within a
limit is healthy and normal, people who have an addiction to the
Internet always feel as must constantly be them on the Internet. This
often affects work and decrease school performance.

Multi-User Operating System


A multi-user operating system is an operating system that permits
several users to access a single system running to a single operating
system. These systems are frequently quite complex, and they must
manage the tasks that the various users connected to them require.
Users will usually sit at terminals or computers connected to the
system via a network and other system machines like printers. A multi-
user operating system varies from a connected single-user operating
system in that each user accesses the same operating system from
different machines.

The main goal of developing a multi-user operating system is to use it for


time-sharing and batch processing on mainframe systems. This multi-user
operating system is now often used in large organizations, the government
sector, educational institutions like large universities, and on servers' side
such as Ubuntu Server or Windows Server. These servers allow several users
to access the operating system, kernel, and hardware at the same time.

It is usually responsible for handling memory and processing for other


running programs, identifying and using system hardware, and efficiently
handling user interaction and data requests. It's especially important for an
operating system, a multi-user operating system because several users rely
on the system to function properly at the same time.
Components of Multi-User Operating System
There are various components of a multi-user operating system. Some of
them are as follows:

Memory
The physical memory present inside the system is where storage occurs. It is
also known as Random Access Memory (RAM). The system may rectify
the data that is present in the main memory. So, every executed program
should be copied from physical storage like a hard disk. Main memory is
determined as an important part of OS because it specifies how many
programs may be executed simultaneously.

Kernel
A multi-user operating system makes use of the Kernel component, which is
built in a low-level language. This component is embedded in the computer
system's main memory and may interact directly with the system's H/W.

Processor
The CPU (Central Processing Unit) of the computer is sometimes known
as the computer's brain. In large machines, the CPU would necessitate more
ICS. On smaller computers, the CPU is mapped in a single chip known as a
microprocessor.

User Interface
The user interface is the way of interaction between users and all software
and hardware processes. It enables the users to interact with the computer
system in a simple manner.

Device Handler
Each input and output device needs its device handler. The device handler's
primary goal is to provide all requests from the whole device request queue
pool. The device handler operates in continuous cycle mode, first discarding
the I/O request block from the queue side.

Spooler
Spooler stands for 'Simultaneous Peripheral Output on Line'. The
Spooler runs all computer processes and outputs the results at the same
time. Spooling is used by a variety of output devices, including printers.

Types of Multi-User Operating System


There are various types of multi-user operating systems. Some of them are
as follows:

Distributed System
A distributed system is also known as distributed computing. It is a collection
of multiple components distributed over multiple computers that interact,
coordinate, and seem like a single coherent system to the end-user. With the
aid of the network, the end-user would be able to interact with or operate
them.

Time-Sliced Systems
It's a system in which each user's job gets a specific amount of CPU time. In
other words, each work is assigned to a specific time period. These time
slices look too small to the user's eyes. An internal component known as the
'Scheduler' decides to run the next job. This scheduler determines and
executes the job that must perform based on the priority cycle.

Multiprocessor System
Multiple processors are used in this system, which helps to improve overall
performance. If one of the processors in this system fails, the other processor
is responsible for completing its assigned task.

Multithreading in Operating System


What is Multithreading?
Multithreading is a feature in operating systems that allows a program to do
several tasks at the same time. Think of it like having multiple hands working
together to complete different parts of a job faster. Each “hand” is called a
thread, and they help make programs run more efficiently. Multithreading
makes your computer work better by using its resources more effectively,
leading to quicker and smoother performance for applications like web
browsers, games, and many other programs you use every day.
How Does Multithreading Work?
Multithreading works by allowing a computer’s processor to handle multiple
tasks at the same time. Even though the processor can only do one thing at
a time, it switches between different threads from various programs so
quickly that it looks like everything is happening all at once.
Here’s how it simplifies:
 Processor Handling : The processor can execute only one instruction at
a time, but it switches between different threads so fast that it gives the
illusion of simultaneous execution.
 Thread Synchronization : Each thread is like a separate task within a
program. They share resources and work together smoothly, ensuring
programs run efficiently.
 Efficient Execution : Threads in a program can run independently or wait
for their turn to process, making programs faster and more responsive.
 Programming Considerations : Programmers need to be careful about
managing threads to avoid problems like conflicts or situations where
threads get stuck waiting for each other.

Operating Systems Structures


The operating system can be implemented with the help of various
structures. The structure of the OS depends mainly on how the various
standard components of the operating system are interconnected and merge
into the kernel. This article discusses a variety of operating system
implementation structures and explains how and why they function.
What is a System Structure for an Operating System?
A system structure for an operating system is like the blueprint of how an OS
is organized and how its different parts interact with each other. Because
operating systems have complex structures, we want a structure that is easy
to understand so that we can adapt an operating system to meet our specific
needs. Similar to how we break down larger problems into smaller, more
manageable subproblems, building an operating system in pieces is simpler.
The operating system is a component of every segment. The strategy for
integrating different operating system components within the kernel can be
thought of as an operating system structure. As will be discussed below,
various types of structures are used to implement operating systems.
Types of Operating Systems Structures
Depending on this, we have the following structures in the operating system:
 Simple Structure
 Monolithic Structure
 Micro-Kernel Structure
 Hybrid-Kernel Structure
 Exo-Kernel Structure
 Layered Structure
 Modular Structure
 Virtual Machines
Simple Structure
Simple structure operating systems do not have well-defined structures and
are small, simple, and limited. The interfaces and levels of functionality are
not well separated. MS-DOS is an example of such an operating system. In
MS-DOS, application programs are able to access the basic I/O routines.
These types of operating systems cause the entire system to crash if one of
the user programs fails.

Advantages of Simple Structure


 It delivers better application performance because of the few interfaces
between the application program and the hardware.
 It is easy for kernel developers to develop such an operating system.
Disadvantages of Simple Structure
 The structure is very complicated, as no clear boundaries exist between
modules.
 It does not enforce data hiding in the operating system.
Monolithic Structure
A monolithic structure is a type of operating system architecture where the
entire operating system is implemented as a single large process in kernel
mode. Essential operating system services, such as process management,
memory management, file systems, and device drivers, are combined into a
single code block.
Advanatages of Monolithic Structure
 Performance of Monolithic structure is fast as since everything runs in a
single block, therefore communication between components is quick.
 It is easier to build because all parts are in one code block.
Disadvanatges of Monolithic Architecture
 It is hard to maintain as a small error can affect entire system.
 There are also some security risks in the Monolithic architecture.
Micro-Kernel Structure
Micro-Kernel structure designs the operating system by removing all non-
essential components from the kernel and implementing them as system and
user programs. This results in a smaller kernel called the micro-
kernel. Advantages of this structure are that all new services need to be
added to user space and does not require the kernel to be modified. Thus it
is more secure and reliable as if a service fails, then rest of the operating
system remains untouched. Mac OS is an example of this type of OS.
Advantages of Micro-kernel Structure
 It makes the operating system portable to various platforms.
 As microkernels are small so these can be tested effectively.
Disadvantages of Micro-kernel Structure
 Increased level of inter module communication degrades system
performance.
Hybrid-Kernel Structure
Hybrid-Kernel structure is nothing but just a combination of both monolithic-
kernel structure and micro-kernel structure. Basically, it combines properties
of both monolithic and micro-kernel and make a more advance and helpful
approach. It implement speed and design of monolithic and modularity and
stability of micro-kernel structure.
Advantages of Hybrid-Kernel Structure
 It offers good performance as it implements the advantages of both
structure in it.
 It supports a wide range of hardware and applications.
 It provides better isolation and security by implementing micro-kernel
approach.
 It enhances overall system reliability by separating critical functions into
micro-kernel for debugging and maintenance.
Disadvantages of Hybrid-Kernel Structure
 It increases overall complexity of system by implementing both structure
(monolithic and micro) and making the system difficult to understand.
 The layer of communication between micro-kernel and other component
increases time complexity and decreases performance compared to
monolithic kernel.
Exo-Kernel Structure
Exokernel is an operating system developed at MIT to provide application-
level management of hardware resources. By separating resource
management from protection, the exokernel architecture aims to enable
application-specific customization. Due to its limited operability, exokernel
size typically tends to be minimal.
The OS will always have an impact on the functionality, performance, and
scope of the apps that are developed on it because it sits in between the
software and the hardware. The exokernel operating system makes an
attempt to address this problem by rejecting the notion that an operating
system must provide abstractions upon which to base applications. The
objective is to limit developers use of abstractions as little as possible while
still giving them freedom.
Advantages of Exo-Kernel
 Support for improved application control.
 Separates management from security.
 It improves the performance of the application.
 A more efficient use of hardware resources is made possible by accurate
resource allocation and revocation.
 It is simpler to test and create new operating systems.
 Each user-space program is allowed to use a custom memory
management system.
Disadvantages of Exo-Kernel
 A decline in consistency.
 Exokernel interfaces have a complex architecture.
Layered Structure
An OS can be broken into pieces and retain much more control over the
system. In this structure, the OS is broken into a number of layers (levels).
The bottom layer (layer 0) is the hardware, and the topmost layer (layer N) is
the user interface. These layers are so designed that each layer uses the
functions of the lower-level layers. This simplifies the debugging process, if
lower-level layers are debugged and an error occurs during debugging, then
the error must be on that layer only, as the lower-level layers have already
been debugged. The main disadvantage of this structure is that at each
layer, the data needs to be modified and passed on which adds overhead to
the system. Moreover, careful planning of the layers is necessary, as a layer
can use only lower-level layers. UNIX is an example of this structure.

Advantages of Layered Structure


 Layering makes it easier to enhance the operating system, as the
implementation of a layer can be changed easily without affecting the
other layers.
 It is very easy to perform debugging and system verification.
Disadvantages of Layered Structure
 In this structure, the application’s performance is degraded as compared
to simple structure.
 It requires careful planning for designing the layers, as the higher layers
use the functionalities of only the lower layers.
Modular Structure
It is considered as the best approach for an OS. It involves designing of a
modular kernel. The kernel has only a set of core components and other
services are added as dynamically loadable modules to the kernel either
during runtime or boot time. It resembles layered structure due to the fact
that each kernel has defined and protected interfaces, but it is more flexible
than a layered structure as a module can call any other module. For example
Solaris OS is organized as shown in the figure.
Virtual Machines (VMs)
Based on our needs, a virtual machine abstracts the hardware of our
personal computer, including the CPU, disc drives, RAM, and NIC (Network
Interface Card), into a variety of different execution contexts, giving us the
impression that each execution environment is a different computer. An
illustration of it is a virtual box.
An operating system enables us to run multiple processes concurrently while
making it appear as though each one is using a different processor and
virtual memory by using CPU scheduling and virtual memory techniques.
The fundamental issue with the virtual machine technique is disc systems.
Let’s say the physical machine only has three disc drives, but it needs to
host seven virtual machines. The program that creates virtual machines
would need a significant amount of disc space in order to provide virtual
memory and spooling, so it should be clear that it is impossible to assign a
disc drive to every virtual machine. The answer is to make virtual discs
available.

You might also like