0% found this document useful (0 votes)
1 views103 pages

Unit 1

The document provides an introduction to operating systems, detailing their definitions, characteristics, functionalities, and the booting process. It covers various types of operating systems, including batch, multi-programming, and real-time systems, while explaining their roles as intermediaries between users and hardware. Additionally, it discusses the Basic Input Output System (BIOS) and the Power On Self Test (POST) involved in the booting process.

Uploaded by

jolir46341
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)
1 views103 pages

Unit 1

The document provides an introduction to operating systems, detailing their definitions, characteristics, functionalities, and the booting process. It covers various types of operating systems, including batch, multi-programming, and real-time systems, while explaining their roles as intermediaries between users and hardware. Additionally, it discusses the Basic Input Output System (BIOS) and the Power On Self Test (POST) involved in the booting process.

Uploaded by

jolir46341
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
You are on page 1/ 103

Introduction to Operating System

Compiled By:
Dr. Narendra Kumar Sharma
Associate Professor, Dept. of MCA
Pranveer Singh Institute of Technology, Kanpur
Topics to be covered:

• Introduction to OS
• Operating System Definition
• Structure of a Computer System
• History of Operating System
• Characteristics of Operating Systems
• Functionalities of Operating System
• Conceptual View (Abstract) of OS
• Operating System Services
• Basic Input Output System (BIOS)
• Power On Self Test (POST)
• Booting Process
– Cold booting
– Warm booting
Introduction to Operating System

• An operating system acts as an intermediary between the user of a


computer and computer hardware.
• The purpose of an operating system is to provide an environment in
which a user can execute programs conveniently and efficiently.
• An operating system is software that manages computer hardware. The
hardware must provide appropriate mechanisms to ensure the correct
operation of the computer system and to prevent user programs from
interfering with the proper operation of the system.
Definition of Operating System

• Definition 1: 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.

• Definition 2: 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.
• 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.
Structure of a Computer System

1. Users (people who are using the computer)


2. Application Programs (Compilers, Databases, Games, Video player, Browsers, etc.)
3. System Programs (Shells, Editors, Compilers, etc.)
4. Operating System ( A special program which acts as an interface between user and
hardware )
5. Hardware ( CPU, Disks, Memory, etc)
History of Operating System

Electronic device Types of OS


Generation Year
used Devices

First 1945-55 Vacuum Tubes Plug Boards

Second 1955-65 Transistors Batch Systems

Third 1965-80 Integrated Circuits(IC) Multiprogramming

Large Scale
Fourth Since 1980 PC
Integration
Characteristics of Operating Systems

• Device Management: The operating system keeps track of all the


devices. So, it is also called the Input/output Controller that decides
which process gets the device, when, and for how much time.
• File Management: It allocates and de-allocates the resources and also
decides who gets the resource.
• Job Accounting: It keeps track of time and resources used by various
jobs or users.
• Error-detecting Aids: These contain methods that include the
production of dumps, traces, error messages, and other debugging and
error-detecting methods.
• Memory Management: It keeps track of the primary, like what part of it
is in use by whom, or what part is not in use, etc. and It also allocates
the memory when a process or program requests it.
• Processor Management: It allocates the processor to a process and
then de-allocates the processor when it is no longer required or the job
is done.
• Control on System Performance: It records the delays between the
request for a service and the system.
• Security: It prevents unauthorized access to programs and data using
passwords or some kind of protection technique.
• Convenience: An OS makes a computer more convenient to use.
• Efficiency: An OS allows the computer system resources to be used
efficiently.
• Ability to Evolve: An OS should be constructed in such a way as to
permit the effective development, testing, and introduction of new
system functions at the same time without interfering with service.
• Throughput: An OS should be constructed so that It can give maximum
throughput (Number of tasks per unit time).
Functionalities of Operating System
• Resource Management: When parallel accessing happens in the OS, means
when multiple users are accessing the system then OS works as Resource
Manager, Its responsibility is to provide hardware to the user. It decreases the
load in the system.
• Process Management: It includes various tasks like scheduling and
termination of the process. It is done with the help of CPU scheduling
algorithms.
• Storage Management: The file system mechanism used for the management of
the storage. All the data is stored in various tracks of Hard disks that are all
managed by the storage manager. It included Hard Disk.
• Memory Management: Refers to the management of primary memory. The
operating system has to keep track of how much memory has been used and by
whom. It has to decide which process needs memory space and how much. OS
also has to allocate and deallocate the memory space.
• Security/Privacy Management: Privacy is also provided by the Operating system
using passwords so that unauthorized applications can’t access programs or
data. For example, Windows uses Kerberos authentication to prevent
unauthorized access to data.
Conceptual View (Abstract View) of OS
• Every general-purpose computer consists of hardware, an operating
system(s), system programs, and application programs.
• The hardware consists of memory, CPU, ALU, I/O devices, peripheral
devices, and storage devices.
• The system program consists of compilers, loaders, editors, OS, etc. The
application program consists of business programs and database
programs.
Operating System Services

• The operating system provides the programming environment in which


a programmer works on a computer system. The user program
requests various resources through the operating system.
• The operating system gives several services to utility programmers and
users. Applications access these services through application
programming interfaces or system calls.
• By invoking those interfaces, the application can request a service from
the operating system, pass parameters, and acquire the operation
outcomes.
• Following are the services provided by an operating system -
1. Program execution
2. Control Input/output devices
3. Program creation
4. Error Detection and Response
5. Accounting
6. Security and Protection
7. File Management
8. Communication
• Program execution
To execute a program, several tasks need to be performed. Both the
instructions and data must be loaded into the main memory. In
addition, input-output devices and files should be initialized, and other
resources must be prepared. The Operating structures handle these
kinds of tasks.

• Control Input/output devices


As there are numerous types of I/O devices within the computer
system, and each I/O device calls for its own precise set of instructions
for the operation. The Operating System hides that info with the aid of
presenting a uniform interface. Thus, it is convenient for programmers
to access such devices easily.

• Program Creation
The Operating system offers the structures and tools, including editors
and debuggers, to help the programmer create, modify, and debugging
programs.
• Error Detection and Response
An Error in a device may also cause malfunctioning of the entire device.
These include hardware and software errors such as device failure,
memory error, division by zero, attempts to access forbidden memory
locations, etc. To avoid error, the operating system monitors the system
for detecting errors and takes suitable action with at least impact on
running applications.

• While working with computers, errors may occur quite often. Errors
may occur in the:
– Input/ Output devices: For example, connection failure in the
network, lack of paper in the printer, etc.
– User program: For example: attempt to access illegal memory
locations, divide by zero, use too much CPU time, etc.
– Memory hardware: For example, Memory error, the memory
becomes full, etc.
• Accounting
An Operating device collects utilization records for numerous assets
and tracks the overall performance parameters and responsive time to
enhance overall performance. These personal records are beneficial for
additional upgrades and tuning the device to enhance overall
performance.

• Security and Protection


Operating device affords safety to the statistics and packages of a
person and protects any interference from unauthorized users. The
safety feature counters threats, which are published via way of
individuals out of doors the manage of the running device.

• Communication
The operating system manages the exchange of data and programs
among different computers connected over a network. This
communication is accomplished using message passing and shared
memory.
• File management
Computers keep data and information on secondary storage devices
like magnetic tape, magnetic disk, optical disk, etc. Each storage media
has its capabilities like speed, capacity, data transfer rate and data
access methods.
For file management, the operating system must know the types of
different files and the characteristics of different storage devices. It has
to offer the proportion and safety mechanism of documents
additionally.
Basic Input Output System (BIOS)

• It provides a set of instructions and is responsible for booting the


computer.
• The BIOS performs all the test needed at startup time. These tests are
collectively known as Power On Self Test (POST) .
• The computer contains hardware like keyboard, monitor, disk drives,
etc., there functioning requires interfacing with the operating system.
• The BIOS provides drivers for basic hardware like keyboard and
monitor, mouse, etc.
Power On Self Test (POST)

• POST consists of a series of diagnostic test that runs


automatically when a user turns on the computer.
• The actual test may differ depending on the
configuration of the BIOS.
• However, the usual test includes testing of the RAM,
keyboard and the disk drives.
• If these tests are successful the computer boots
itself and loads the operating system but if these
tests are unsuccessful, the computer reports the
errors through a series of beeps to draw the
operator’s attention and finally an error message is
displayed on the monitor.
Location Of BIOS

• BIOS is typically placed in a chip known as Read Only Memory (ROM)


that comes with the computer.
• This ensures that the BIOS will always be available even if the hard disk
is formatted or replaced.
• However, in many cases the content of the ROM is transferred to the
RAM when the system is started. This is because the RAM allows
quicker access as compared to the ROM.
• Copying of the content of the ROM to the RAM is known as shadowing.
Booting Process

• Booting is the process of operations that involves loading and


executing the OS from the point where the user switches on the power
button. It is also known as starting, rebooting, or booting up.
• The starting instructions are loaded from the computer's ROM during
booting. The current boot disk is used to load the operating system.
Usually, an internal hard drive serves as the boot disk.
• Once the OS has been loaded, and the system is ready for use, the boot
procedure is complete.

• There are two types of booting process:


1. Cold booting
2. Warm booting
1. Cold Booting

• The method of turning on a computer system after it has been shut off
is known as “cold booting”.
• Usually, this is done by pushing the power button of the computer.
Using cold booting, the “Power on Self-Test” (POST) is carried out.
• It is a series of system checks carried out when the boot process first
begins.
Steps For Cold Booting:

• Shutdown: Start by shutting down the PC. This may be carried out through the
running device’s shutdown option or by urgent the power button till the device
powers off.
• Power Off: Ensure that the pc is completely powered off.
• Wait: Wait for a few seconds for the system to completely power down.
• Power On: Press the power button to show on the pc. This initiates the cold
boot process.
• BIOS Initialization: The Basic Input Output System (BIOS) starts running,
initializing hardware components together with the CPU, memory, and devices.
It additionally performs a Power On Self Test (POST) to check for any hardware
issues.
• Operating System Load: Once the hardware initialization is done, the BIOS
locates the boot tool (commonly the difficult force or SSD) and masses
the operating system into memory.
• Operating System Initialization: The working machine starts running, initializing
software components and loading important drivers and services.
• User Login: If required, the operating device prompts the consumer to log in.
Once logged in, the consumer can begin the use of the pc.
2. Warm Booting

• The process of resetting/restarting the computer system is called as


warm booting.
• It is done with the help of a reset button or keys (Ctrl+Alt+Del).
• This testing doesn’t test the booting RAM because no power is
performed on the self-test. It may be started up using the Operating
System.
• In Windows, you may warm boot by choosing the restart option from
the start menu. On a Mac, warm booting may be accomplished by
selecting restart from the Apple menu.
Steps For Warm Booting:

• Operating System Command: Start from inside the operating system. This may
be performed with the aid of choosing the restart option from the shutdown
menu or through urgent particular key combinations (e.g., Ctrl+Alt+Del) to
initiate a restart.
• Software Restart: The operating system sends a command to restart the device
without powering off.
• Hardware Reset: The CPU receives the restart command and initiates a
hardware reset.
• BIOS Skipped: Since the power isn’t became off, the BIOS initialization step is
skipped in the course of heat booting. This saves time as compared to cold
booting.
• Operating System Reload: The operating system reloads, restarting all device
services and tactics even as maintaining the machine country.
• User Login: If required, the operating system activates the consumer to log in
again. Once logged in, the person can resume using the computer with the
previous country preserved.
Difference between Cold Booting and Warm Booting

Comparison Cold Booting Warm Booting

Reset button or by
Initialized by Power button. pressing Ctrl+Alt+Del
simultaneously.

Performed Frequent basis. Not very common.

Hard Booting, Cold start


Alternate names Soft Booting.
and dead start.

POST (Power On Self Test) Included. Not included.

Turning a computer ON Resetting a computer from


Basic
from a powerless state. already in running state.

Can severely affect the


Does not affect the data or
Consequence system causing the data
other hardware.
loss.
THANKS
Classification of Operating
Systems

Compiled By:
Dr. Narendra Kumar Sharma
Associate Professor, Dept. of MCA
Pranveer Singh Institute of Technology, Kanpur
Topics to be covered:

• Types of Operating Systems


1. Batch Operating System
2. Multi-Programming System
3. Multi-Processing System
4. Multi-Tasking Operating System
5. Time-Sharing Operating System
6. Distributed Operating System
7. Network Operating System
8. Real-Time Operating System
• Main Task of Operating System
Types of Operating Systems

• Operating System is a type of software that works as an interface


between the system program and the hardware.

• There are several types of Operating Systems in which many of which


are mentioned below.
1. Batch Operating System
2. Multi-Programming System
3. Multi-Processing System
4. Multi-Tasking Operating System
5. Time-Sharing Operating System
6. Distributed Operating System
7. Network Operating System
8. Real-Time Operating System
1. Batch Operating System

• This type of operating system does not interact with the computer
directly. There is an operator which takes similar jobs having the same
requirement and groups them into batches. It is the responsibility of
the operator to sort jobs with similar needs.
2. Multi-Programming Operating System

• Multiprogramming Operating Systems can be simply illustrated as more


than one program is present in the main memory and any one of them
can be kept in execution. This is basically used for better execution of
resources.
3. Multi-Processing Operating System

• Multi-Processing Operating System is a type of Operating System in


which more than one CPU is used for the execution of resources. It
betters the throughput of the System.
4. Multi-Tasking Operating System

• Multitasking Operating System is simply a multiprogramming Operating


System with having facility of a Round-Robin Scheduling Algorithm. It
can run multiple programs simultaneously.
5. Time-Sharing Operating Systems

• Each task is given some time to execute so that all the tasks work
smoothly. Each user gets the time of the CPU as they use a single
system. These systems are also known as Multitasking Systems. The
task can be from a single user or different users also. The time that each
task gets to execute is called quantum. After this time interval is over
OS switches over to the next task.
6. Distributed Operating System

• Various autonomous interconnected computers communicate with


each other using a shared communication network. Independent
systems possess their own memory unit and CPU. These are referred to
as loosely coupled systems or distributed systems. These systems
processors differ in size and function.
7. Network Operating System

• These systems run on a server and provide the capability to manage


data, users, groups, security, applications, and other networking
functions. These types of operating systems allow shared access to
files, printers, security, applications, and other networking functions
over a small private network.
8. Real-Time Operating System
• These types of OS serve real-time systems. The time interval required to
process and respond to inputs is very small. This time interval is
called response time.
• Real-time systems are used when there are time requirements that are
very strict like missile systems, air traffic control systems, robots, etc.

• Types of Real-Time Operating Systems

1. Hard Real-Time Systems:


Hard Real-Time OS’s are meant for
applications where time constraints are very
strict and even the shortest possible delay is
not acceptable.
2. Soft Real-Time Systems:
These OS’s are for applications where time
constraint is less strict.
Main Task of Operating System

• Provides the facilities to create and modify programs and data files
using an editor.
• Access to the compiler for translating the user program from high-level
language to machine language.
• Provide a loader program to move the compiled program code to the
computer’s memory for execution.
• Provide routines that handle the details of I/O programming.
THANKS
System Components
and
System Call

Compiled By:
Dr. Narendra Kumar Sharma
Associate Professor, Dept. of MCA
Pranveer Singh Institute of Technology, Kanpur
Topics to be covered:
• Components of Operating System
– Process Management
– File Management
– Network Management
– Main Memory Management
– Secondary Storage Management
– I/O Device Management
– Security Management
– Command Interpreter System
• System Call
• Need of System Call
• Types of System Call
– Process Control
– File Management
– Device Management
– Information Maintenance
– Communication
Components of Operating System

• An operating system is a large and complex system that can only be


created by partitioning into small parts. These pieces should be a well-
defined part of the system, carefully defining inputs, outputs, and
functions.
• Although Windows, Mac, UNIX, Linux, and other OS do not have the same
structure, most operating systems share similar OS system components,
such as file, memory, process, I/O device management.
• There are the following components of an operating system, such as:
1. Process Management
2. File Management
3. Network Management
4. Main Memory Management
5. Secondary Storage Management
6. I/O Device Management
7. Security Management
8. Command Interpreter System
1. Process Management

• The process management component is a procedure for managing


many processes running simultaneously on the operating system. Every
running software application program has one or more processes
associated with them.
• For example, when you use a search engine like Chrome, there is a
process running for that browser program.
• Process management keeps processes running efficiently. It also uses
memory allocated to them and shutting them down when needed.
• The execution of a process must be sequential so, at least one
instruction should be executed on behalf of the process.
• Functions of process management: Here are the following functions of
process management in the operating system, such as:

i. Process creation and deletion


ii. Suspension and resumption
iii. Synchronization process
iv. Communication process
2. File Management

• A file is a set of related information defined by its creator. It commonly


represents programs (both source and object forms) and data. Data
files can be alphabetic, numeric, or alphanumeric.
• Function of file management: The operating system has the following
important activities in connection with file management:

i. File and directory creation and deletion.


ii. For manipulating files and directories.
iii. Mapping files onto secondary storage.
iv. Backup files on stable storage media.
3. Network Management
• Network management is the process of administering and managing
computer networks. It includes performance management,
provisioning of networks, fault analysis, and maintaining the quality of
service.

• The computers in the network are connected through a communication


network, which can configure in many different ways. The network can
fully or partially connect in network management, which helps users
design routing and connection strategies that overcome connection
and security issues.
• Network management provides the following functions, such as:
i. Distributed systems help you to various computing resources in size
and function.
ii. They may involve minicomputers, microprocessors, and many general-
purpose computer systems.
iii. A distributed system also offers the user access to the various
resources the network shares.
iv. It helps to access shared resources that help computation to speed up
or offers data availability and reliability.
4. Main Memory management

• Main memory is a large array of storage or bytes, which has an address.


The memory management process is conducted by using a sequence of
reads or writes of specific memory addresses.
• It should be mapped to absolute addresses and loaded inside the
memory to execute a program. The selection of a memory
management method depends on several factors.
• Functions of Memory management: An Operating System performs the
following functions for Memory Management in the operating system:

i. It helps you to keep track of primary memory.


ii. Determine what part of it are in use by whom, what part is not in use.
iii. In a multiprogramming system, the OS decides which process will get
memory and how much.
iv. Allocates the memory when a process requests.
v. It also de-allocates the memory when a process no longer requires or
has been terminated.
5. Secondary-Storage Management

• The most important task of a computer system is to execute programs.


These programs help you to access the data from the main memory
during execution.
• This memory of the computer is very small to store all data and
programs permanently. The computer system offers secondary storage
to back up the main memory.
• Functions of Secondary storage management: Here are some major
functions of secondary storage management in the operating system:

i. Storage allocation
ii. Free space management
iii. Disk scheduling
6. I/O Device Management

• One of the important use of an operating system that helps to hide the
variations of specific hardware devices from the user.
• Functions of I/O management: The I/O management system offers the
following functions, such as:

i. It offers a buffer caching system


ii. It provides general device driver code
iii. It provides drivers for particular hardware devices.
iv. I/O helps you to know the individualities of a specific device.
7. Security Management
• The various processes in an operating system need to be secured from
other activities. Therefore, various mechanisms can ensure those
processes that want to operate files, memory CPU, and other hardware
resources should have proper authorization from the operating system.
• Security refers to a mechanism for controlling the access of programs,
processes, or users to the resources defined by computer controls to be
imposed, together with some means of enforcement.
8. Command Interpreter System
• One of the most important components of an operating system is its
command interpreter. The command interpreter is the primary
interface between the user and the rest of the system.
• Many commands are given to the operating system by control
statements. A program that reads and interprets control statements is
automatically executed when a new job is started in a batch system or a
user logs into a time-shared system.

• This program is variously called as


– The control card interpreter,
– The command-line interpreter,
– The shell (in UNIX), and so on.
System Calls

• 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.
• A figure representing the execution of the system call is given as follows −
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.
Types of System Calls

• There are commonly five types of system calls. These are as follows:
1. Process Control
2. File Management
3. Device Management
4. Information Maintenance
5. Communication

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

2. 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.
3. 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.

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

5. 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 and Unix system calls

Process Windows Unix


Process Control CreateProcess() Fork()
ExitProcess() Exit()
WaitForSingleObject() Wait()
File Manipulation CreateFile() Open()
ReadFile() Read()
WriteFile() Write()
CloseHandle() Close()
Device Management SetConsoleMode() Ioctl()
ReadConsole() Read()
WriteConsole() Write()
Information GetCurrentProcessID() Getpid()
Maintenance SetTimer() Alarm()
Sleep() Sleep()
Communication CreatePipe() Pipe()
CreateFileMapping() Shmget()
MapViewOfFile() Mmap()
Protection SetFileSecurity() Chmod()
InitializeSecurityDescriptor() Umask()
SetSecurityDescriptorgroup() Chown()
Brief description about methods

• open(): The open() system call allows you to access a file on a file
system. It allocates resources to the file and provides a handle that the
process may refer to. Many processes can open a file at once or by a
single process only. It's all based on the file system and structure.

• read(): It is used to obtain data from a file on the file system. It accepts
three arguments in general:
– A file descriptor.
– A buffer to store read data.
– The number of bytes to read from the file.
The file descriptor of the file to be read could be used to identify it and
open it using open() before reading.
• wait(): In some systems, a process may have to wait for another
process to complete its execution before proceeding. When a parent
process makes a child process, the parent process execution is
suspended until the child process is finished. The wait() system call is
used to suspend the parent process. Once the child process has
completed its execution, control is returned to the parent process.

• write(): It is used to write data from a user buffer to a device like a file.
This system call is one way for a program to generate data. It takes
three arguments in general:
– A file descriptor.
– A pointer to the buffer in which data is saved.
– The number of bytes to be written from the buffer.
• fork(): Processes generate clones of themselves using
the fork() system call. It is one of the most common ways to create
processes in operating systems. When a parent process spawns a child
process, execution of the parent process is interrupted until the child
process completes. Once the child process has completed its execution,
control is returned to the parent process.

• close(): It is used to end file system access. When this system call is
invoked, it signifies that the program no longer requires the file, and
the buffers are flushed, the file information is altered, and the file
resources are de-allocated as a result.
• exec(): When an executable file replaces an earlier executable file in an
already executing process, this system function is invoked. As a new
process is not built, the old process identification stays, but the new
process replaces data, stack, data, head, etc.

• exit(): The exit() is a system call that is used to end program execution.
This call indicates that the thread execution is complete, which is
especially useful in multi-threaded environments. The operating system
reclaims resources spent by the process following the use of
the exit() system function.
THANKS
Operating System Structure

Compiled By:
Dr. Narendra Kumar Sharma
Associate Professor, Dept. of MCA
Pranveer Singh Institute of Technology, Kanpur
Topics to be covered:
• What is an Operating System Structure?
• Types of Operating System Structure
– Simple Structure
– Monolithic Structure
– Micro-Kernel Structure
– Hybrid-Kernel Structure
– Exo-Kernel Structure
– Layered Structure
– Modular Structures
– Virtual Machines
What is an Operating System Structure?

• An operating system has a complex structure, so we need a well


defined structure to assist us in applying it to our unique requirements.
• Just as we break down a big problem into smaller, easier to solve sub
problems, designing an operating system in parts is a simpler approach
to do it. And each section is an Operating System component.
• The approach of interconnecting and integrating multiple operating
system components into the kernel can be described as an operating
system structure.
Types of Operating System Structure

• Operating System structure is the basic model which is needed to


implement Operating Systems.
• Types of structures implementing Operating Systems as mentioned
below.
1. Simple Structure
2. Monolithic Structure
3. Micro-Kernel Structure
4. Hybrid-Kernel Structure
5. Exo-Kernel Structure
6. Layered Structure
7. Modular Structures
8. Virtual Machines
1. Simple Structure
• It is the simplest Operating System Structure and is not well defined; It
can only be used for small and limited systems.
• In this structure, the interfaces and levels of functionality are well
separated; hence programs can access I/O routines which can cause
unauthorized access to I/O routines.

• This structure is implemented in MS-DOS operating system. The MS-


DOS operating System is made up of various layers, each with its own
set of functions.
• These layers are:
– Application Program
– System Program
– MS-DOS device drivers
– ROM BIOS device drivers
• Layering has an advantage in the MS-
DOS operating system since all the levels
can be defined separately and can interact
with each other when needed.
• It is easier to design, maintain, and update
the system if it is made in layers. So that's
why limited systems with less complexity
can be constructed easily using Simple
Structure.
• If one user program fails, the entire
operating system gets crashed.
• The abstraction level in MS-DOS systems is
low, so programs and I/O routines are
visible to the end-user, so the user can
have unauthorized access.
Advantages of Simple Structure
• It is easy to develop because of the limited number of interfaces and
layers.
• Offers good performance due to lesser layers between hardware and
applications.
• Minimal overhead, suitable for resource-constrained environments.

Disadvantages of Simple Structure


• If one user program fails, the entire operating system crashes.
• Limited functionality.
• Abstraction or data hiding is not present as layers are connected and
communicate with each other.
• Layers can access the processes going in the Operating System, which
can lead to data modification and can cause Operating System to crash.
2. Monolithic Structure

• The Monolithic operating System in which the kernel acts as a manager


by managing all things like file management, memory management,
device management, and operational processes of the Operating
System.
• The kernel is the heart of a computer operating system. Kernel delivers
basic services to all other elements of the System. It serves as the
primary interface between the Operating System and the hardware.
• In monolithic systems, kernels can directly access all the resources of
the operating System like physical hardware, exp Keyboard, Mouse etc.

• The monolithic kernel is another name for the monolithic operating


system. Batch processing and time-sharing maximize the usability of a
processor by multiprogramming.
• The monolithic kernel functions as a virtual machine by working on top
of the Operating System and controlling all hardware components.
• This is an outdated operating system that was used in banks to
accomplish minor activities such as batch processing and time-sharing,
which enables many people at various terminals to access the
Operating System.
Advantages of Monolithic structure:
• It is simple to design and implement because all operations are
managed by kernel only, and layering is not needed.
• As services such as memory management, file management, process
scheduling, etc., are implemented in the same address space, the
execution of the monolithic kernel is relatively fast as compared to
normal systems. Using the same address saves time for address
allocation for new processes and makes it faster.
• Simple design and implementation.

Disadvantages of Monolithic structure:


• If any service in the monolithic kernel fails, the entire System fails
because, in address space, the services are connected to each other and
affect each other.
• Lack of modularity makes maintenance and extensions difficult.
• It is not flexible, and to introduce a new service
3. Micro-Kernel Structure

• Micro-Kernel structure designs the


Operating System by removing all
non-essential components of
the kernel.
• These non-essential components
of kernels are implemented as
systems and user programs. Hence
these implemented systems are
called as Micro-Kernels.
• Each Micro-Kernel is made
independently and is isolated from
other Micro-Kernels. So this makes
the system more secure and reliable.
• If any Micro-Kernel fails, then the
remaining operating System remains
untouched and works fine.
Advantages of Micro-kernel structure:
• It allows the operating system to be portable between platforms.
• Enhanced system stability and security.
• As each Micro-Kernel is isolated, it is safe and trustworthy.
• Because Micro-Kernels are smaller, they can be successfully tested.
• If any component or Micro-Kernel fails, the remaining operating System
is unaffected and continues to function normally.

Disadvantages of Micro-kernel structure:


• Increased inter-module communication reduces system performance.
• System is complex to be constructed.
• Complexity in managing user-space components.
4. Hybrid-Kernel Structure

• A hybrid kernel structure combines elements of both monolithic and


microkernel structures.
• The core of the hybrid kernel is a small microkernel that provides
essential services, such as memory management, process scheduling,
and inter-process communication (IPC).
• Other operating system services are implemented as modules that run
in user space.
• This approach aims to strike a balance between the performance
advantages of a monolithic kernel and the stability and modularity
benefits of a microkernel.
Advantages of Hybrid-Kernal Structure
• Hybrid kernels can achieve good performance because frequently used
services can be implemented as modules in user space, which avoids
the overhead of system calls.
• Hybrid kernels are more modular than monolithic kernels, which makes
them easier to maintain and extend.
• Hybrid kernels can be tailored to specific needs by adding or removing
modules.
• Hybrid kernels can be more secure than monolithic kernels because
modules in user space are less likely to contain security vulnerabilities.

Disadvantages of Hybrid-Kernel Structure


• Hybrid kernels can be more complex than monolithic kernels because
they must manage the interaction between the microkernel and the
modules in user space.
• There is some performance overhead associated with IPC between the
microkernel and the modules in user space.
5. Exo-Kernal Structure

• An exokernel is a type of operating system kernel that provides only the


most basic services, such as memory management and communication.
• All other services are provided by user-level processes. This makes
exokernels highly modular and flexible, but also very complex to
implement.
• The exokernel structure is an alternative operating system design that
is quite different from traditional monolithic or microkernel
architectures.
• In an exokernel, the kernel provides a minimal interface to applications
and exposes hardware resources directly, allowing applications to
manage these resources.
Advantages of Exo-Kernal Structure
• Exo-kernels are the most modular type of operating system structure.
This makes them easy to modify and extend.
• Exo-kernels are the most flexible type of operating system structure.
They can be used to support a wide variety of operating system
designs.
• Exo-kernels can be more secure than other types of operating system
structures because they provide a smaller attack surface.
• Exo-kernels can achieve good performance because they avoid the
overhead of system calls.

Disadvantages of Exo-Kernal Structure


• Exo-kernels are the most complex type of operating system structure
to implement. This is because they must provide a low-level interface to
hardware that is still secure and reliable.
• There can be some performance overhead associated with the
communication between user-level processes and the exo-kernel.
6. Layered Structure

• In this type of structure, OS is divided into layers or levels. The


hardware is on the bottom layer (layer 0), while the user interface is on
the top layer (layer N).
• These layers are arranged in a hierarchical way in which the top-level
layers use the functionalities of their lower-level levels.
• In this approach, functionalities of each layer are isolated, and
abstraction is also available.
• In layered structure, debugging is easier as it is a hierarchical model, so
all lower-level layered is debugged, and then the upper layer is checked.
• So all the lower layers are already checked, and the current layer is to
be checked only.
• The following are some of the key characteristics of a layered operating
system structure:
1. Each layer is responsible for a specific set of tasks. This makes it easier
to understand, develop, and maintain the operating system.
2. Layers are typically arranged in a hierarchy. This means that each layer
can only use the services provided by the layers below it.
3. Layers are independent of each other. This means that a change to
one layer should not affect the other layers.
Advantages of Layered Structure
• A layered structure is highly modular, meaning that each layer is
responsible for a specific set of tasks. This makes it easier to
understand, develop, and maintain the operating system.
• Each layer has its functionalities, so work tasks are isolated, and
abstraction is present up to some level.
• Debugging is easier as lower layers are debugged, and then upper
layers are checked.

Disadvantages of Layered Structure


• In Layered Structure, layering causes degradation in performance.
• It takes careful planning to construct the layers since higher layers only
utilize the functions of lower layers.
• There can be some performance overhead associated with the
communication between layers. This is because each layer must pass
data to the layer above it.
7. Modular Structure

• In a modular operating system structure, the operating system is


divided into a set of independent modules.
• Each module is responsible for a specific task, such as memory
management, process scheduling, or device drivers.
• Modules can be loaded and unloaded dynamically, as needed.
Advantages of Modular Structure
• A modular structure is highly modular, meaning that each module is
independent of the others. This makes it easier to understand, develop,
and maintain the operating system.
• A modular structure is very flexible. New modules can be added easily,
and existing modules can be modified or removed without affecting the
rest of the operating system.

Disadvantages of Modular Structure


• There can be some performance overhead associated with the
communication between modules. This is because modules must
communicate with each other through well-defined interfaces.
• A modular structure can be more complex than other types of
operating system structures. This is because the modules must be
carefully designed to ensure that they interact correctly.
7. Virtual Machines

• Virtual Machines (VMs) are a form of virtualization technology that


allows multiple operating systems to run on a single physical machine
simultaneously.
• Each virtual machine acts as an independent, isolated system with its
own OS and applications.
Advantages of Virtual Machines
• VMs provide a high degree of isolation between guest operating systems. This
makes it difficult for malware or other problems in one guest to affect other
guests or the host system.
• VMs can be used to create secure environments for running untrusted code. For
example, a VM can be used to run a web browser without risking the entire
system to malware infection.
• VMs can be easily moved from one physical machine to another. This makes it
easy to deploy and manage applications across multiple servers.

Disadvantages of Virtual Machines


• VMs typically have some performance overhead compared to running software
directly on the hardware. This is because the VM must emulate the hardware
for the guest operating system.
• VMs can be complex to manage. This is because they require additional
software to be installed and configured.
• VMs can consume a significant amount of system resources. This is because
they must run a guest operating system in addition to the host operating
system.
THANKS
Layered Structure of Operating
System

Compiled By:
Dr. Narendra Kumar Sharma
Associate Professor, Dept. of MCA
Pranveer Singh Institute of Technology, Kanpur
Topics to be covered:
• Layered Structure of OS
• Architecture of Layered Structure
– Hardware
– CPU Scheduling
– Memory Management
– Process Management
– IO Buffers
– User Program
• Advantages of Layered Structure
Layered Structure of Operating System

• The layered structure approach breaks up the operating system into


different layers and retains much more control on the system.
• 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 only.
• It simplifies the debugging process as if lower-level layers are
debugged, and an error occurs during debugging.
• The error must be on that layer only as the lower-level layers have
already been debugged.
• This allows implementers to change the inner workings and increases
modularity.
• As long as the external interface of the routines doesn't change,
developers have more freedom to change the inner workings of the
routines.
• The main advantage is the simplicity of construction and debugging.
The main difficulty is defining the various layers.
Architecture of Layered Structure

• This type of operating system was created as an improvement over the


early monolithic systems.
• The operating system is split into various layers in the layered operating
system, and each of the layers has different functionalities. There are
some rules in the implementation of the layers as follows.
– A particular layer can access all the layers present below it, but it
cannot access them. That is, layer n-1 can access all the layers from
n-2 to 0, but it cannot access the nth
– Layer 0 deals with allocating the processes, switching between
processes when interruptions occur or the timer expires. It also
deals with the basic multiprogramming of the CPU.
• Thus if the user layer wants to interact with the hardware layer, the
response will be traveled through all the layers from n-1 to 1.
• Each layer must be designed and implemented such that it will need
only the services provided by the layers below it.
• There are six layers in the layered operating system. A diagram
demonstrating these layers is as follows:
• Hardware: This layer interacts with the system hardware and
coordinates with all the peripheral devices used, such as a printer,
mouse, keyboard, scanner, etc. These types of hardware devices are
managed in the hardware layer.
The hardware layer is the lowest and most authoritative layer in the
layered operating system architecture. It is attached directly to the core
of the system.

• CPU Scheduling: This layer deals with scheduling the processes for the
CPU. Many scheduling queues are used to handle processes. 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. This layer is responsible for managing how many
processes will be allocated to the CPU and how many will stay out of
the CPU.

• Memory Management: Memory management deals with memory and


moving processes from disk to primary memory for execution and back
again. This is handled by the third layer of the operating system. All
memory management is associated with this layer. There are various
types of memories in the computer like RAM, ROM.
• Process Management: This layer is responsible for managing the
processes, i.e., assigning the processor to a process and deciding how
many processes will stay in the waiting schedule. The priority of the
processes is also managed in this layer. The different algorithms used
for process scheduling are FCFS (first come, first served), SJF (shortest
job first), priority scheduling, round-robin scheduling, etc.

• I/O Buffer: I/O devices are very important in computer systems. They
provide users with the means of interacting with the system. This layer
handles the buffers for the I/O devices and makes sure that they work
correctly.

• User Programs: This is the highest layer in the layered operating


system. This layer deals with the many user programs and applications
that run in an operating system, such as word processors, games,
browsers, etc. You can also call this an application layer because it is
concerned with application programs.
Advantages of Layered Structure

• Modularity: This design promotes modularity as each layer performs


only the tasks it is scheduled to perform.
• Easy debugging: As the layers are discrete so it is very easy to debug.
Suppose an error occurs in the CPU scheduling layer. The developer can
only search that particular layer to debug, unlike the Monolithic system
where all the services are present.
• Easy update: A modification made in a particular layer will not affect the
other layers.
• No direct access to hardware: The hardware layer is the innermost layer
present in the design. So a user can use the services of hardware but
cannot directly modify or access it, unlike the Simple system in which
the user had direct access to the hardware.
• Abstraction: Every layer is concerned with its functions. So the
functions and implementations of the other layers are abstract to it.
THANKS

You might also like