0% found this document useful (0 votes)
19 views17 pages

Overview of Operating System Types

An operating system (OS) serves as an intermediary between users and hardware, managing processes, resources, and providing an environment for program execution. Various types of operating systems exist, including batch, multiprogramming, multiprocessing, multitasking, network, real-time, time-sharing, and distributed systems, each with distinct advantages and disadvantages. System calls facilitate communication between user programs and the OS, allowing for tasks like file management, process control, and device management.

Uploaded by

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

Overview of Operating System Types

An operating system (OS) serves as an intermediary between users and hardware, managing processes, resources, and providing an environment for program execution. Various types of operating systems exist, including batch, multiprogramming, multiprocessing, multitasking, network, real-time, time-sharing, and distributed systems, each with distinct advantages and disadvantages. System calls facilitate communication between user programs and the OS, allowing for tasks like file management, process control, and device management.

Uploaded by

pritigaikwad801
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Operating System

Unit 1: - Introduction and Operating System Structure


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 simple 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)
1
Operating System
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.

2
Operating System
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.

3
Operating System
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


In Multiprocessing, Parallel computing is achieved.
There is more than one processor 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.

4
Operating System

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.

5
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.

6
Operating System
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.

Disadvantages of Distributed Operating System


o Protocol overhead can dominate computation cost .

7
Operating System

System Components
 System services: - Both Users and programs benefit from the services provided
by an operating system. It provides a platform for programs to run in and gives users
the ability to run programs in a more convenient way. Following are the various
services provided by the operating system.

1. Program Execution:-Several tasks must be completed in order to run a


programme. Both the data and instructions must be loaded into the main memory.
Furthermore, files and input-output devices should be initialized, as well as other
resources that have to be prepared. These types of jobs are handled by the operating
structures. The user no longer has to be concerned about memory allocation,
multitasking, or anything else.

2. Control Input/output Devices:- Because there are many different types of I/O
devices in a computer system, each one has its own set of precise instructions for
operation. By offering a unified interface, the operating system hides such
information. As a result, it is simple for a programmer to access such devices.

3. Program Creation:- The operating system provides structures and tools, like
editors and debuggers, to aid programmers in the creation, modification, and
debugging of programs.

4. Error Detection and Response:- An error in a device can cause the entire device
to malfunction. Device failure, division by zero, memory errors, attempts to access
restricted memory regions, and other hardware and software problems are
examples. The OS monitors the system for problems and takes appropriate action
with minimal impact on running programs to avoid errors.

5. Accounting:- To improve overall performance, an operating device collects


utilisation records for a variety of assets and tracks overall performance metrics and
responsive time. These personal records are useful for future upgrades and device
adjustments to improve overall performance.

6. Security and Protection:- The operating device secures a person’s statistics and
packages from unauthorised users and prevents them from being tampered with.
The security feature guards against threats that are broadcast by people who are not
in control of the running device.

7. File Management:- The OS must be aware of the many types of files as well as the
properties of various storage devices in order to manage them. It must also provide
the proportion and security method for papers.

8. Communication:- The operating system is in charge of coordinating the transfer of


data and programs across computers connected by a network. Message passing and
shared memory are used to accomplish this communication.

8
Operating System

System Calls in Operating System (OS)

A system call is a way for a user program to interface with the operating system. The
program requests several services, and the OS responds by invoking a series of system calls
to satisfy the request. A system call can be written in assembly language or a high-level
language like C or Pascal. System calls are predefined functions that the operating system
may directly invoke if a high-level language is used.

What is a System Call?


A system call is a method for a computer program to request a service from the kernel of
the operating system on which it is running. A system call is a method of interacting with the
operating system via programs. A system call is a request from computer software to an
operating system's kernel.

The Application Program Interface (API) connects the operating system's functions to user
programs. It acts as a link between the operating system and a process, allowing user-level
programs to request operating system services. The kernel system can only be accessed using
system calls. System calls are required for any programs that use resources.

When a computer software needs to access the operating system's kernel, it makes a system
call. The system call uses an API to expose the operating system's services to user programs.
It is the only method to access the kernel system. All programs or processes that require
resources for execution must use system calls, as they serve as an interface between the
operating system and user programs.

Why do you need system calls in Operating System?


There are various situations where you must require system calls in the operating system.
Following of the situations are as follows:

1. It is must require when a file system wants to create or delete a file.


2. Network connections require the system calls to sending and receiving data packets.
3. If you want to read or write a file, you need to system calls.
4. If you want to access hardware devices, including a printer, scanner, you need a system
call.
5. System calls are used to create and manage new processes.

How System Calls Work


The Applications run in an area of memory known as user space. A system call connects to the
operating system's kernel, which executes in kernel space. When an application creates a

9
Operating System
system call, it must first obtain permission from the kernel. It achieves this using an interrupt
request, which pauses the current process and transfers control to the kernel.

If the request is permitted, the kernel performs the requested action, like creating or deleting a
file. As input, the application receives the kernel's output. The application resumes the
procedure after the input is received. When the operation is finished, the kernel returns the
results to the application and then moves data from kernel space to user space in memory.

A simple system call may take few nanoseconds to provide the result, like retrieving the system
date and time. A more complicated system call, such as connecting to a network device, may
take a few seconds. Most operating systems launch a distinct kernel thread for each system call
to avoid bottlenecks. Modern operating systems are multi-threaded, which means they can
handle various system calls at the same time.

Types of System Calls


There are commonly five types of system calls. These are as follows:

Process Control
Process control is the system call that is used to direct the processes. Some process control
examples include creating, load, abort, end, execute, process, terminate the process, etc.

File Management
File management is a system call that is used to handle the files. Some file management
examples include creating files, delete files, open, close, read, write, etc.

Device Management
Device management is a system call that is used to deal with devices. Some examples of device
management include read, device, write, get device attributes, release device, etc.

10
Operating System
Information Maintenance
Information maintenance is a system call that is used to maintain information. There are some
examples of information maintenance, including getting system data, set time or date, get time
or date, set system data, etc.

Communication
Communication is a system call that is used for communication. There are some examples of
communication, including create, delete communication connections, send, receive messages,
etc.

Examples of Windows system calls


There are various examples of Windows and Unix system calls. These are as listed below in
the table:

Process Windows

Process Control CreateProcess()


ExitProcess()
WaitForSingleObject()

File Manipulation CreateFile()


ReadFile()
WriteFile()
CloseHandle()

Device Management SetConsoleMode()


ReadConsole()
WriteConsole()

Information Maintenance GetCurrentProcessID()


SetTimer()
Sleep()

Communication CreatePipe()
CreateFileMapping()
MapViewOfFile()

Protection SetFileSecurity()
InitializeSecurityDescriptor()
SetSecurityDescriptorgroup()

11
Operating System

System Program:-
System programs also known as system utilities, provide a convenient environment for
program development and execution. Some of them are simply user interfaces to system calls,
others are considerably more complex. These system programs can be divided into following
categories.

 File Management: - These programs create, delete, copy, rename, print, dump, list,
and generally manipulate files and directories.
 Status information: - some program simply asks the system for the date, time,
amount of available memory or disk space, number of users or similar status
information.
 File modification: - several text editors may be available to create and modify the
content of files stored on disk or other storage devices.
 Programming language support: - compliers, assemblers, debuggers and
interpreters for common programming languages are often provided to the user with
the operating system.
 Program loading and execution: - once the program is assembled or complied
it must be loaded into the memory to be executed. The system may provide absolute
loaders, relocatable loaders, linkage editors and overlay loaders.
 Communication: - these programs provide the mechanism for creating virtual
connections among processes, users and computer systems. They allow user to send
messages to one another’s screen, to browse web pages or to transfer files from one
machine to another.

Operating System Structure: -


We want a clear structure to let us apply an operating system to our particular needs
because operating systems have complex structures. It is easier to create an operating
system in pieces, much as we break down larger issues into smaller, more manageable
subproblems. Every segment is also a part of the operating system. Operating system
structure can be thought of as the strategy for connecting and incorporating various
operating system components within the kernel. Operating systems are implemented
using many types of structures
Simple structure: -It is the most straightforward operating system structure, but it lacks
definition and is only appropriate for usage with tiny and restricted systems. Since the
interfaces and degrees of functionality in this structure are clearly defined, programs

12
Operating System

are able to access I/O routines, which may result in unauthorized access to I/O
procedures.

This organizational structure is used by the MS-DOS operating system:

o There are four layers that make up the MS-DOS operating system, and each has its own
set of features.
o These layers include ROM BIOS device drivers, MS-DOS device drivers, application
programs, and system programs.
o The MS-DOS operating system benefits from layering because each level can be
defined independently and, when necessary, can interact with one another.
o If the system is built in layers, it will be simpler to design, manage, and update. Because
of this, simple structures can be used to build constrained systems that are less complex.
o When a user program fails, the operating system as whole crashes.
o Because MS-DOS systems have a low level of abstraction, programs and I/O
procedures are visible to end users, giving them the potential for unwanted access.

The following figure illustrates layering in simple structure:

Advantages of Simple Structure:

o Because there are only a few interfaces


and levels, it is simple to develop.
o Because there are fewer layers between
the hardware and the applications, it
offers superior performance.

Disadvantages of Simple Structure:

o The entire operating system breaks if just


one user program malfunctions.
o Since the layers are interconnected, and
in communication with one another,
there is no abstraction or data hiding.
o The operating system's operations are accessible to layers, which can result in data
tampering and system failure.

13
Operating System
LAYERED STRUCTURE
The OS is separated into layers or levels in this kind of arrangement. Layer 0 (the lowest layer)
contains the hardware, and layer 1 (the highest layer) contains the user interface (layer N).
These layers are organized hierarchically, with the top-level layers making use of the
capabilities of the lower-level ones.

The functionalities of each layer are separated in this


method, and abstraction is also an option. Because
layered structures are hierarchical, debugging is simpler,
therefore all lower-level layers are debugged before the
upper layer is examined. As a result, the present layer
alone has to be reviewed since all the lower layers have
already been examined.

Advantages of Layered Structure:

o Work duties are separated since each layer has its


own functionality, and there is some amount of
abstraction.
o Debugging is simpler because the lower layers are examined first, followed by the top
layers.

Disadvantages of Layered Structure:

o Performance is compromised in layered structures due to layering.


o Construction of the layers requires careful design because upper layers only make use
of lower layers' capabilities.
o

MICRO-KERNEL STRUCTURE
The operating system is created using a micro-
kernel framework that strips the kernel of any
unnecessary parts. Systems and user applications
are used to implement these optional kernel
components. So, Micro-Kernels is the name given
to these systems that have been developed

Each Micro-Kernel is created separately and is


kept apart from the others. As a result, the system
is now more trustworthy and secure. If one
Micro-Kernel malfunctions, the remaining
operating system is unaffected and continues to
function normally.

14
Operating System
Advantages of Micro-Kernel Structure:

o It enables portability of the operating system across platforms.


o Due to the isolation of each Micro-Kernel, it is reliable and secure.
o The reduced size of Micro-Kernels allows for successful testing.
o The remaining operating system remains unaffected and keeps running properly even
if a component or Micro-Kernel fails.

Disadvantages of Micro-Kernel Structure:

o The performance of the system is decreased by increased inter-module communication.


o The construction of a system is complicated.

VIRTUAL MACHINES (VMs)


The hardware of our personal computer, including the CPU, disc drives, RAM, and NIC
(Network Interface Card), is abstracted by a virtual machine into a variety of various execution
contexts based on our needs, giving us the impression that each execution environment is a
separate computer. A virtual box is an example of it.

Using CPU scheduling and virtual memory techniques, an operating system allows us to
execute multiple processes simultaneously while giving the impression that each one is using
a separate processor and virtual memory. System calls and a file system are examples of extra
functionalities that a process can have that the hardware is unable to give. Instead of offering
these extra features, the virtual machine method just offers an interface that is similar to that of
the most fundamental hardware. A virtual duplicate of the computer system underneath is made
available to each process.

We can develop a virtual machine for a variety of reasons, all of which are fundamentally
connected to the capacity to share the same underlying hardware while concurrently supporting
various execution environments, i.e., various operating systems.

Disk systems are the fundamental problem with the virtual machine technique. If the actual
machine only has three-disc drives but needs to host seven virtual machines, let's imagine that.
It is obvious that it is impossible to assign a disc drive to every virtual machine because the
program that creates virtual machines would require a sizable amount of disc space in order to
offer virtual memory and spooling. The provision of virtual discs is the solution.

The result is that users get their own virtual machines. They can then use any of the operating
systems or software programs that are installed on the machine below. Virtual machine
software is concerned with programming numerous virtual machines simultaneously into a
physical machine; it is not required to take into account any user-support software. With this
configuration, it may be possible to break the challenge of building an interactive system for
several users into two manageable chunks.

15
Operating System
Advantages of Virtual Machines:

o Due to total isolation between each virtual machine and every other virtual machine,
there are no issues with security.
o A virtual machine may offer an architecture for the instruction set that is different from
that of actual computers.
o Simple availability, accessibility, and recovery convenience.

Disadvantages of Virtual Machines:

o Depending on the workload, operating numerous virtual machines simultaneously on a


host computer may have an adverse effect on one of them.
o When it comes to hardware access, virtual computers are less effective than physical
ones.

Operating System Design and Implementation

 Design Goals: - The first problem in designing a system is to define goals and
specification. At the highest level, the design of the system will be affected by the
choice of hardware and the type of the system: batch, shared, single user, multiuser,
distributed, real time or general purpose. The requirement can however, be divided into
two basic groups: user goals and system goals.

Users desire certain properties in the system. The system should be convenient to use, easy to
learn and to use, reliable, safe, and fast. The similar set of requirements can be defined by those
people who must design, create, maintain and operate the system. The system should be easy
to design, implement and maintain and it should be flexible, reliable, error free and efficient.
The wide range of systems in existence show that different requirements can result in a large
variety of solutions for different environments. Specifying and designing an operating system
is a highly creative task.

 Mechanisms and policies:-One important principle is the separation of policy


from mechanism. Mechanisms determine how to do something; policies determine
what will be done.
Eg: - The timer construct is a mechanism for ensuring CPU protection, but deciding
how long the timer is to be set for a particular user is a policy decision.
The separation of policy and mechanism is important for flexibility. Policies are likely
to change across places or over time. In the worst case, each change in policy would

16
Operating System

require a change in the underlying mechanism. Micro kernel based operating systems
take the separation of mechanism and policy to one extreme by implementing a basic
set of primitive building blocks.
Policy decisions are important for all resource allocation. Whenever it is necessary to
decide whether or not to allocate a resource, a policy decision must be made. Whenever
the question is how rather than what, it is a mechanism that must be determined.

 Implementation: - Once an operating system is designed, it must be implemented.


Traditionally, operating systems have been written in assembly language. Now,
however, they are most commonly written in higher-level language such as C or C++.
The advantages of using a higher-level language or at least a systems implementation
language for implementing operating system are: - the code can be written faster, is
more compact, and is easier to understand and debug. Improvements in complier
technology will improve the generated code for the entire operating system by simple
recompilation. Finally, an operating system is far easier to port- to move to some other
hardware if written in a higher- level language.

Operating System Generation

It is possible to design code, and implement an operating system specifically for one machine
at one site. Operating systems are designed to run on any of a class of machines at a variety
of sites with a variety of peripheral configurations. The system must then be configured or
generated for each specific computer site, a process sometimes known as system generation
(SYSGEN).

The operating system is normally distributed on disk, on CD-ROM or DVD-ROM, which is a


file in the format of a CD-ROM or DVD-ROM. To generate a system, we use a special
program. This SYSGEN program reads from a given file, or asks the operator of the system
for information concerning the specific configuration of the hardware system, or probes the
hardware directly to determine what components are there. System generation involves
simply creating the appropriate tables to describe the system.

17

You might also like