0% found this document useful (0 votes)
5 views90 pages

NEP-OS - Unit 1

The document provides an overview of operating systems (OS), detailing their functions, characteristics, and types. It explains the role of an OS as an intermediary between users and hardware, managing resources, processes, files, and security. Additionally, it outlines the evolution of OS, examples of different types, and their advantages and disadvantages.

Uploaded by

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

NEP-OS - Unit 1

The document provides an overview of operating systems (OS), detailing their functions, characteristics, and types. It explains the role of an OS as an intermediary between users and hardware, managing resources, processes, files, and security. Additionally, it outlines the evolution of OS, examples of different types, and their advantages and disadvantages.

Uploaded by

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

KLE SOCITY’S

G I BAGEWADI BCA COLLEGE,NIPANI

NEP - OS

UNIT 1
Introduction to OS
-In the Computer System (comprises of Hardware and software),
- Hardware - 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.
Introduction to OS
-A Computer System consists of
- Users (people who are using the computer)
- Application Programs (Compilers, Databases, Games, Video player,
Browsers, etc.)
- System Programs (Shells, Editors, Compilers, etc.)
- Operating System ( A special program which acts as an interface
between user and hardware )
- Hardware ( CPU, Disks, Memory, etc)
Introduction to OS

What does an operating system do:


Manages resources: The OS allocates resources - memory,
processors, and devices to programs.
Manages processes: The OS controls which programs run and
when.
Manages files: The OS manages files on the computer.
Manages input and output: The OS handles how data is sent to
and from the computer.
Manages devices: The OS controls peripheral devices like printers
and disk drives.
Manages networks: The OS manages the computer's network
connection.
Manages security: The OS manages the computer's security.
Introduction to OS

Definition:
An operating system acts as an intermediary between the user of a
computer and computer hardware. In short its an interface between
computer hardware and user.
Introduction to OS

-OS provide environment – in which program – executes conveniently – and efficiently


-OS is s/w – manage – h/w & s/w
-h/w ensure correct mechanism to ensure correct – operation of computer system
-Concerned with – assigning – resources among program – eg. Memory- processor- input
& output devices.
-Examples of OS:
- Windows, macOS, and Linux.
History & Examples of Operating
System

The operating system has been evolving through the years. The
following table shows the history of OS.
Era Key Developments Examples

The first Operating System was GN-NAA


1956 GM-NAA I/O (1956)
I/O in 1956 by Genera; Motors.

IBM developed a time sharing system


1960s OS/360, DOS/360 and TSS/360
TSS/360
Unix popularized simplicity and
1970s multitasking; rise of personal computers Unix (1971), CP/M (1974)
with basic OSs.

GUI-based OSs gained traction; Apple Macintosh (1984), Windows


1980s
networking features became standard. (1985)

Open-source Linux emerged; GUIs in


1990s Linux (1991), Windows 95 (1995)
Windows and Mac OS improved.
Mobile OSs dominated; cloud and
2000s-
virtualization technologies advanced iOS (2007), Android (2008)
Present
computing.
Computer System Organization with Operating
System

-Computer system organization in an operating system (OS) is the way a


computer's hardware and software are structured to allow users to
interact with the computer.
-The OS manages the computer's resources, including memory,
processors, and input/output devices.
-Components of a computer system
- Central processing unit (CPU):
The main processor that runs the OS and apps. The CPU's
control unit decodes and executes instructions from the
program.
- Memory unit:
Stores data.
Computer System Organization with Operating
System
Computer System Organization with Operating
System

Input/output devices:
Allows users to interact with the computer.
Arithmetic logic unit (ALU):
A circuit board in the CPU that performs mathematical and logical
operations.
Accumulator register:
Temporarily stores data from memory before transferring it to the ALU.
How the OS works
• The OS acts as an interface between the user and the hardware.
• The OS manages the computer's hardware and software resources.
• The OS assigns resources among programs, such as memory, processors,
and input/output devices.
• The OS runs all the time on the computer, usually called the kernel.
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.
Characteristics of Operating Systems

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 is responsible for managing the primary memory of a computer,
including what part of it are in use by whom also check how much
amount free or used and allocate process
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.
Characteristics of Operating Systems

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.
Characteristics of Operating Systems

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).
Types of Operating Systems (OS)

-OS is set – programs – that manages – computer hardware & software


resources
-Act as – intermediately between – user & computer h/w
-Ensure operation – interaction between application – and hardware components
are – efficient
-OS allow – smooth functioning – provide stable – and consistent environment of
other s/w to be get executed.
Types of Operating Systems (OS)

-Types of OS
1. Batch Os
2. Multiprogramming OS
3. Multitasking OS
4. Multiprocessing OS
5. Network OS
6. Time Sharing OS
7. Real Time OS
8. Distributed OS
Types of Operating Systems (OS)

1. Batch OS:
- Invented in 1970 - Similar types of – jabs batched together – executed in time
- People were used to single computer – called – mainframe
- Access is given to more than one person
- They submit their respective jobs to system – for execution
- System collect – all jobs in queue – FCFS manner – then executes the jobs one
by one
- The user collects – output when all jobs are executed
Types of Operating Systems (OS)

1. Batch OS:
- Purpose is to transfer the control from one job to another
- Contains resident monitor –part of main memory – remaining part is served
for job processing.
-
Types of Operating Systems (OS)

1. Batch OS:
- Advantages :
- It has increased efficiency, like a resident monitor that eliminates
CPU idle time between jobs to enable it to smoothen the
switching of tasks.
- The automatic handling of the processing of jobs
- Resource utilization is appropriate – resources are not idle
- Well present – in payroll – keep processing jobs in batches
- Complex jobs executed – without any intermission
- Group of jobs removes many – manual setup
- It logs and – deals with error at the time – when batch is over
Types of Operating Systems (OS)

1. Batch OS:
Disadvantages :
- Batch OS – suffers from starvation
- 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.
- Not interactive
- Batch Os is not supportive is jobs are dependent on user i/p
- If job require – i/p as input 2 number then it will not work
- Delayed output:
- Jobs submitted in batches – sends batch wise output
- Difficult to Debug:
- Once entire batch is processed then it will displays errors of all jobs
Types of Operating Systems (OS)

1. Batch OS:
Disadvantages :
- Requires knowledge of Job Scheduling:
- Large job causes delay:
- If batch has – large job to get executed – then processing needs
delay – therefore slow down the system performance
How it works
Similar jobs are grouped together into batches
The jobs are placed in a queue, first come, first served
The jobs are executed one at a time, without manual intervention
Example
Credit card companies use batch processing to generate monthly
bills for customers
Types of Operating Systems (OS)

2. 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
•Example : windows, Linux, Mac OS Andriod, iOS
Types of Operating Systems (OS)

2. Multiprogramming Operating System

Advantages:
- Throughput increases – as one program to execute
- Response time to be get – reduced
- Maximum utilization of resources
- Multiple programs are running simultaneously – so more task are
completed –enhance throughput of the system
- If program is waiting for I/O operation – processor does not get idle –
it takes another job for execution.
- System support short & long jobs to get executed in parallel – which
makes dynamic support for job execution
Types of Operating Systems (OS)

2. Multiprogramming Operating System

Disadvantages:
- Resource utilization is more – but do not provide interaction of user
with system – Also Multiple program execution – increases – system
complexity – as needs more resources to be get utilized
- Requires more memory – as multiple program are running
- The operating system has to switch between the running processes
continuously, and this leads to scheduling overhead and reduces
performance.
- As several concurrent operations access shared resources
simultaneously, the system is likely to experience deadlocks: two or
more processes waiting for each other for further actions.
- Resource contention due to competition for scarce resources could
Types of Operating Systems (OS)

3. Multiprocessing Operating System


- Parallel Computing
- More than one processor are present – which executes more than one process
at the same time - Increase throughput of the system
- Executes several procedure in collaboration – split procedure in part – so it
run part
- As several processor working in parallel – it completes multiple task fastly
- System executes the task – which scatters among processor – so minimizing
waiting period for procedure
- If one processor is faulty – then other processor will continue the work –
which enhance reliability
- Example scientific simulations, real-time data processing, and server
environments
Types of Operating Systems (OS)

3. Multiprocessing Operating System

Working
-Concurrent execution of processes
-Processes are divided and allotted among multiple processor
-Which enhance throughput, good resource allocation, smooth distribution of
workload, fault tolerance (means if one processor fails – other processor continue
with work)
-Types 1) Symmetric Multiprocessing 2) Asymmetric Multiprocessing
Types of Operating Systems (OS)

3. Multiprocessing Operating System

Symmetric Multiprocessing:
-Every processor – has same copy of OS – they share memory, I/O
devices – each processor can do any task – workload is balanced among
them – if one processor fails other can continue

Asymmetric Multiprocessing:
- One processor controls other processor – manages the task given to
other processor – master processor – provides task to OS – the other
processor performs specific task – system performance is balanced but
some time it is bottlenecked if work loaded more on master processor.
Types of Operating Systems (OS)

3. Multiprocessing Operating System

Advantages:
-Increased reliability : as multiple processor are present – if one failed –
task is given to another one.
-Increased Throughput: Multiple jobs are done by – multiple processor
than single processor system
-Efficient Resource Utilization: productive on resource utilization
-Parallelism: Many processes run at same time – execution speed
increased
-Scalability: As workload increased – more processor can be get added
Types of Operating Systems (OS)

3. Multiprocessing Operating System

Disadvantages:
-Complexity: As number of processor are more – distribution of task is
complicated task
-Increased Cost: More hardware are added – which increases cost
-Communication Overhead: Communication among processor for
distribution of task over headed as multiple tasks are running
-Software Compatibility Problems: generally most software is not
designed properly with multiprocessing
Example
- Windows, linux, Unix,
Types of Operating Systems (OS)

4. Multitasking Operating System


-Multiprogramming extends to an
multitasking – enable to run various
program simultaneously
-Provides more than one at the same time –
allows us to share resources like sharing
CPU among multiple task
-This assures efficient use of the CPU
because it shifts between tasks quickly;
hence, it seems that they are running
parallel.
-Multitasking system – supportive in all
computer – example user might run web
Types of Operating Systems (OS)

4. Multitasking Operating System


-Types of Multitasking
- Pre-emptive Multitasking
- Cooperative Multitasking
Pre-emptive Multitasking:
-OS has full control to allocate CPU
-In this any processes is interrupted in the middle and CPU is
allocated to any another process – based on scheduling criteria
-Responsiveness is more – no any single process to monopolize the
CPU.
Cooperative Multitasking:
- Any process can voluntarily release the CPU so other task may
complete its work.
Types of Operating Systems (OS)

4. Multitasking Operating System


-Types of Multitasking
Cooperative Multitasking:
-Any process can voluntarily release the CPU so other task may
complete its work.
-So process runs completely or voluntarily release – which means
small control over context switch
-OS rely as processes to be cooperate with each other
-It leads to problem if CPU is allocated and that processes fails to
complete its task.
Types of Operating Systems (OS)

4. Multitasking Operating System -Advantages:


-Rapid shift between task – which reduce response time – so system
can handle multiple task at once. - Memory is allocated dynamically –
efficient usage of resources. - More application runs at same time –
increases the productivity
-Also due to multitasking switching task is more faster – utilization of
CPU is more – also resources are consumed more.
Disadvantages:
-As multiple processes are running at same time – the CPU generate
more heat
-Managing of different task – requires more sophisticated algorithm
-As so many task are running some time – it degrade the performance
-Delay in task completion – as many task needs same resource to
Types of Operating Systems (OS)

5. Network Operating System -Advantages:


-It allow computer to communicate & share
resources over network – it is the backbone of
computer – share resources over network – like
computer, printer and server. - NOS allow
devices to share s/w applications, files &
hardware – so everyone in network can have –
what they need.
-Examples of network operating systems are
Microsoft Windows Server, Linux, and Novell
NetWare.
-The enterprise saves money since resources like
printers or storage drives do not have to be
Types of Operating Systems (OS)

5. Network Operating System -Advantages:


-Types of Network OS:
- Peer to peer system -Client server System
Peer to Peer:
-This OS allow user to share & access file & resources on other
computer
-P2p is decentralized – means they don’t have client server or file
server
-Working
- All computer are equal – each computer can be works like client or
server
- Computers can share resources & services directly with others
- P2P designed for small to medium local area n/w
Types of Operating Systems (OS)

5. Network Operating System -Advantages:

Client – Server System:


-Client server OS allows personal computer to – interact with shared
servers
-client operating system, which runs on a desktop or portable device,
and a server operating system, which runs on a server.
Working
-Client device – request a resources or services from server
-Server device – provides a resources / services to user
-Client – server communicate over network to exchange data / perform
task
-Example: gmail / windows server
Types of Operating Systems (OS)

5. Network Operating System -Advantages:


-Network application – split in client & server – it minimizes total
number of communication over network – so increased performance
-Configuring and maintaining NOS is less expensive than other
-NOS grants centralized control over – data, security & resource
management
-NOS system can be easily scaled up – as we can add client and server
without reconfiguring system – resource sharing is easily
Types of Operating Systems (OS)

5. Network Operating System -Advantages:

Disadvantages:
-If one node or server fails – effect whole system so reliability
decreases
-Security must be robust – as unauthorized user access is restricted
-Needs skilled n/w administrator – who handles system performance –
security & troubleshooting
-If n/w size is to large – then traffic is heavy – which degrade with time
if not monitored & maintained
Types of Operating Systems (OS)

6. Real Time Operating System:


-In such OS each task has clear deadline – if system is fail to complete
then consequences will be get arises.
-Real-time systems are widely used in areas where timing is the issue,
for example, the manufacturing of medical equipment, automotive
controls, or even industrial automation.
-For instance, in an anti-lock braking system (ABS) in a car, the
response must come in milliseconds in order to assure safety.
-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.
Types of Operating Systems (OS)

6. Real Time Operating System:


-Types
Hard Real Time OS
-In hard real-time systems, it is absolutely impossible to fail to meet a
deadline.
-The consequence of missing a deadline may be disastrous, even failing
the system or loss of life.
-Examples: Flight navigation and control aircraft, Medical devices, like
pacemakers.
-It is required that strict guarantees be established so that the jobs will
definitely be executed on time. Failure can be very disastrous.
Types of Operating Systems (OS)

6. Real Time Operating System:


-Types
Soft Real Time OS
-Occasional missed deadlines may not result in catastrophic failure but
can degrade the performance or usability of the system.
-Examples: Video streaming (occasional delays or buffering are
acceptable) and online transaction systems (like bank ATMs, where
slight delays are tolerable)
-System may work though if deadline missed.
-This has focused on efficiency and the removal of delays rather than
absolute precision.
Types of Operating Systems (OS)

6. Real Time Operating System:


-Types
Firm Real Time OS
-In that case, there is no crash, but the result of the task is worthless
when it doesn't meet the deadline.
-There's a minimum kind of penalty, but the value of the completion of
the task goes significantly down if it is not made in time.
-Examples: Automated stock trading systems (late transactions lose
relevance) and some e-commerce systems (for example, offers run out).
Types of Operating Systems (OS)

6. Real Time Operating System:

Advantages:
-Easy to develop – design – implement under real time OS
-Maximum utilization of resources
-Fast response to events
-High reliability
-Strict scheduling
Disadvantages:
-Very expensive
-Resource intensive
-Less multitasking support
-Lack of adaptability
-Demand specific s/w
Types of Operating Systems (OS)

6. Real Time Operating System:

Examples
QNX Neutrino: A POSIX-compliant RTOS used in industries like
automotive, medical devices, and robotics
Wind River VxWorks: A commercial RTOS used in high-performance
applications
SafeRTOS: A commercial RTOS from Wittenstein
FreeRTOS: An open-source RTOS from Amazon Web Services
RT-Thread: An open-source RTOS
Mbed OS: An RTOS that can be used to develop projects
Types of Operating Systems (OS)

7. Time sharing Operating System:


-Allow multiple user to access the system concurrently
-Allocate specific time slice or quantum to each and every process
-CPU switches between the task – rapidly so that user may all are
running – continuously
-in systems where multiple users require access to the central system
in real-time or near real-time
-How it Works
- Scheduling
- Multiprogramming
- Context Switching
Types of Operating Systems (OS)

7. Time sharing Operating System:

Advantages:
-effective utilization and sharing of resources.
-helps decrease CPU idle and response time
-allows various users to access and interact with their programs at the
same time, and it leads to greater productivity.
-better memory management because it swaps programs into and out
of main memory efficiently.
Disadvantages:
-Data transmission rate is high
-integrity and security of the user programs loaded in memory
-Management of time sharing is more complicated
-more and more users get hooked to the system, it degrades due to
resource contention.
-However, with time, context switches between tasks will incur
overheads, thereby impacting the overall efficiency of the system.
Types of Operating Systems (OS)

7. Time sharing Operating System:

Example:
Examples of time-sharing operating systems include:
UNIX: A time-sharing operating system
Linux: A time-sharing operating system
Windows NT: A time-sharing operating system
Windows 2000 server: A time-sharing operating system
Multics: A time-sharing operating system
TOPS-10 (DEC): A time-sharing operating system
TOPS-20 (DEC): A time-sharing operating system
VMS: A time-sharing operating system
Solaris: A time-sharing operating system
Mac OS X: A time-sharing operating system
Types of Operating Systems (OS)

8. Distributed Operating System:


-Not installed on single machine – divided onto parts – these parts are
loaded into different machine
-A part of the distributed Operating system is installed on each
machine to make their communication possible.
-Such OS are more complex, large & sophisticated than NOS
Types of Operating Systems (OS)

8. Distributed Operating System:


Advantages:
-Offer resource sharing
-This is fault tolerant system
-Scalable – as new nodes can be easily added
-Distributed nature – improves performance
-Parallel processing – increase speed of execution of task

Disadvantages:

-Cost is high
-Managing system is complex as work is distributed
-Security may be less with nodes
-System highly depends on network stability
Function of Operating System

Functions Operating System:

Memory Management
Processor Management
Device Management
File Management
Network Management
Security
Control over system performance
Job accounting
Error detecting aids
Coordination between other software and users
Function of Operating System

Memory Management :
-Management of main memory – main memory is large array of bytes /
words – where each byte has its own address - Main memory directly
accessed by CPU – to execute any program must be in main memory
-Functions
- Keeps tracks of primary memory, i.e., what part of it are in use by
whom, what part are not in use.
- In multiprogramming, the OS decides which process will get
memory when and how much.
- Allocates the memory when a process requests it to do so.
- De-allocates the memory when a process no longer needs it or has
been terminated.
Function of Operating System

Processor Management :
-OS decides which process get processor – also for how much time –
also called as processor scheduling
-Functions
- Keeps tracks of processor and status of process. The program
responsible for this task is known as traffic controller.
- Allocates the processor (CPU) to a process.
- De-allocates processor when a process is no longer required.
Device management:
-OS manages device communication through – device drivers
-Function
- Keeps tracks of all devices. Program responsible for this task is
known as the I/O controller.
- Decides which process gets the device when and for how much
time.
- Allocates the device in the efficient way.
- De-allocates devices.
Function of Operating System

File Management :
-Files are organized into various directories – so access is done easily
-Functions
- Keeps track of information, location, uses, status etc. The collective
facilities are often known as file system.
- Decides who gets the resources.
- Allocates the resources.
- De-allocates the resources.
Security:
-Usage of password – to prevent unauthorized access
Control over System Performance:
-Record delay between request and response from system
Job Accounting:
-Keep track of which process used a resource for how much time
Error Detecting Aids:
-OS provides various techniques to detect error
Coordination between other s/w and user:
- Coordination in various s/w and user – to easy access
System Calls

System call is way for – user program to interact with OS


System calls are predefined functions that the operating system may
directly invoke if a high-level language is used.
Definition 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.
System Calls

How the system call is made


-When 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.
System Calls

Need to system call


-When file is created or deleted
-n/w connection needs – as for sending and receiving data packets
-If we want to read or write a file
-If we want to access hardware devices
-Used to create and manage new process
Types of System call
System Calls

Types of System call – Process Control:


-Used to direct processes – such as create, load, abort, end, execution
of process or termination of process
File Management:
-Used to handle files – such as create files – delete files – open - close –
read – write etc.
Device Management:
-Used to deal with devices – allocate the devices – release the devices
from the processes
Information Maintenance:
-Used to maintain information such as getting system date – set date or
time – get time or date
Communication: Create & delete communication n/w – send /receive
Operating System Structure

OS allow user application – to communicate with h/w


OS is designed carefully – as it should be easy to use & modify
OS Structure:
-Simple structure
-Monolithic Structure
-Layered Structure
-Micro – Kernel Structure
Operating System Structure

Simple structure:
-System do not have – well defined structure
-They are small – simple and limited
-Interface and level of functionality are not well separated
-MS – DOS is the best example
-In this application prog. –access basic i/o routines
-System crash if any one the prog. Fails.
-Advantages:
-Because there are only a few interfaces and levels,
-it is simple to develop.
-Because there are fewer layers between the hardware
and the applications, it offers superior performance.
Operating System Structure

Simple structure:
-Disadvantages:
-OS breaks if any one program fails
-As layers are interconnected – so less data abstraction
-OS operations are accessible to all layer – so overload is more on
system and – it results in system failure
Operating System Structure

Monolithic structure:
-OS is designed in such a way that – it provide all services – such as
memory management – process management – file management –
device management – are placed in single large binary.
-This means all code runs on kernel space
-No separation between user and kernel level process
-Main advantage – system call can be made directly to kernel – without
any overhead of message passing between user and kernel.
-Design is simple
-Also all OS services are provided in single binary (means single
executable file)
Operating System Structure

Monolithic structure:
Advantages:
-Simple to design as all OS services are on
kernel space. - All services are on same
address area – so kernel runs fast – than
other system. – Also utilization of same
address – speed up task – reduce time
allocation of address
Disadvantages:
-Services are interconnected – so any one
fails – entire system fails.
-Not adaptable – so launching new service
is difficult.
Operating System Structure

Layered structure:
-OS is divided into multiple layers layer 0 lowest layer – contains
hardware layer n – contains user interface layer
-Layers are organized hierarchically – so top layer uses the capabilities of
lower level
-Functionality of each layer is separated – abstraction is achieved
-As layered structure is hierarchical – lower layer are debugged before
upper layer – so present layers is only examined
Operating System Structure

Layered structure:
Advantages:
-Work is distributed in layer – where each layer will has its own
responsibility – also abstraction is maintained.
-Debugging is simple – as lower layer are examined first
Disadvantages:
-Performance degrades as layers are increased
-Layer construction requires more careful design as upper layer uses the
capabilities of lower layer
Operating System Structure

Micro - Kernel structure:


-Microkernel is the only software executing at the privileged level.
-The other important functionalities of the OS are removed from the
kernel-mode and run in the user mode.
-These functionalities may be device drivers, application, file servers,
inter process communication, etc.
-The minimum functionalities required in the Microkernel are:
- Memory management mechanisms like address spaces should be
included in the Microkernel. It also contains memory protection
features.
- Processor scheduling mechanisms should contain process and thread
schedulers.
- Inter-process communication manages the servers that run their own
Operating System Structure

Micro - Kernel structure:


Advantages:
-OS is portable across platform
-Secure – reliable – as microkernel is in
isolation [ means OS services run on
different address space – fail in one
service will less effect the other services.
]
Disadvantages:
-Performance is decreased as increased
as inter module communication is more
-System construction is complicated
Process

Process: Definition:
-In an operating system, a process is a running program. Processes go
through different states while executing, and understanding these states
helps the operating system manage processes.
How processes work
A process is the fundamental unit of work that must be implemented in
a system.
A process is created when a computer program is run.
A process is made up of four parts: stack, heap, text, and data.
A process goes from a new state to a ready state after being loaded into
the main memory.
A process waits in the ready state for the processor to execute it.
Process
Process States

Process States:
-Process from its
creation to
termination goes
through various
states
-States :
- New
- Ready
- Running
- Block or wait
- Completion or
Termination
- Suspended
Process States

Process States:
1. New:
-OS picks a program/process into main memory – is called new process.
-It means process is created but not yet ready to run
-For example: When a user double-clicks on an application icon
-How OS work with new state:
- The operating system allocates memory and resources for the
process
- The program code is loaded into memory - Initial data structures
are set up.
-Long term scheduler brought process – in ready queue – so now
process is ready for execution – long term scheduler select good CPU
bound & I/O bound process- also determine how many processes can be
Process States

Process States:
2. Ready:
-In an operating system, the ready state is when a process is ready to
run but is waiting for the CPU to be assigned.
-Processes in the ready state are kept in a queue called the ready
queue.
-Once the process created & loaded into main memory – then it is ready
state
-Process enter in ready state after I/O
-Example:
-Opening multiple tabs in a web browser: When you open several
tabs in a web browser, each tab is considered a separate process. While
you are actively using one tab, the other open tabs are in a "ready
Process States

Process States:
3. Running:
-The "running state" refers to when a process is actively being executed
by the CPU, meaning its instructions are currently being carried out by
the processor; essentially, the process is actively doing work at that
moment.
-In single core – at a time only one process is running
-A process can move from running to waiting state – if it wants to
perform I/O operation. – It means currently word application is running
so suppose if want to read the data from browser and copy & paste on
word then temporarily current process is paused.
Process States

Process States:
4. Block or Wait State:
-In an operating system, a "block" or "wait" state refers to when a
process is temporarily suspended because it needs to wait for a specific
event to occur, like user input, a resource to become available, or an I/O
operation to complete, essentially pausing its execution until the
required condition is met;
-an example would be a program waiting for data to be read from a
hard drive before it can continue processing.
-So if resources are unavailable then – process is transferred to block
state.
-After availability of resources the process gets signal – and process is
transferred from block to ready state.
Process States

Process States:
4. Block or Wait State:
-In an operating system, a "block" or "wait" state refers to when a
process is temporarily suspended because it needs to wait for a specific
event to occur, like user input, a resource to become available, or an I/O
operation to complete, essentially pausing its execution until the
required condition is met;
-an example would be a program waiting for data to be read from a
hard drive before it can continue processing.
-So if resources are unavailable then – process is transferred to block
state.
-After availability of resources the process gets signal – and process is
transferred from block to ready state.
Process States

Process States:
4. Block or Wait State:
-In an operating system, a "block" or "wait" state refers to when a
process is temporarily suspended because it needs to wait for a specific
event to occur, like user input, a resource to become available, or an I/O
operation to complete, essentially pausing its execution until the
required condition is met;
-an example would be a program waiting for data to be read from a
hard drive before it can continue processing.
-So if resources are unavailable then – process is transferred to block
state.
-After availability of resources the process gets signal – and process is
transferred from block to ready state.
Process States

Process States:
5. Termination State:
-In an operating system, the "termination state" refers to the final stage
of a process where it has completely finished executing its instructions
and is no longer active, essentially meaning the process has ended.
- An example would be closing a calculator app on your computer,
where the process is moved to the terminated state once you close the
application.
-Upon termination the process releases – all the resources allocated to
it like memory, CPU time etc.
-OS removes the PCB allocated to a process
-Example : normal exit – error exit – forced termination
Process States

Process States:
6. Suspended Ready State:
-In an operating system, a "suspended ready" state refers to a process
that was previously in a ready state to be executed by the CPU, but has
been temporarily moved to secondary storage (like a hard disk) due to
memory limitation.
-It means that it is currently not actively ready to run but can be
brought back to the ready state when needed; essentially, it's "waiting
on the sidelines" until enough memory becomes available.
-Example – a large application is trying to open – at the same multiple
programs are running – systems main memory is full – so newly open
application – might not having enough space – so now process may get
placed in suspended ready state till space gets available.
Process States

Process States:
7. Suspended wait State:
-A "suspended wait state" in an operating system refers to a process
that is currently waiting for an event to occur, but has been temporarily
moved to secondary storage (like a hard disk) because the main
memory is full.
-So essentially "parking" the process until space becomes available; this
usually happens when a higher priority process needs to be executed
immediately, effectively putting the waiting process on hold.
-Here process moves from main memory to secondary memory as
higher priority processes are arrived.
Process Control Block

Process Control Block:


-Process control block is a data structure – which is used to maintain
the information related to a process
-Also known as – task control block, entry control process table.
-This PCB is very important for process management.
-Structure of PCB:
Process Control Block

Process Control Block:


Process State
- This specifies the process state i.e. new, ready, running, waiting or terminated.
Process Number
- This shows the number of the particular process.
Program Counter
- This contains the address of the next instruction that needs to be executed in the process.
Registers
-This specifies the registers that are used by the process. They may include accumulators,
index registers, stack pointers, general purpose registers etc.
List of Open Files
- These are the different files that are associated with the process
Process Control Block

Process Control Block:


CPU Scheduling Information
-The process priority, pointers to scheduling queues etc. is the CPU scheduling information
that is contained in the PCB.
- This may also include any other scheduling parameters.
Memory Management Information
-The memory management information includes the page tables or the segment tables
depending on the memory system used.
-It also contains the value of the base registers, limit registers etc.
I/O Status Information
- This information includes the list of I/O devices used by the process, the list of files etc.
Process Control Block

Process Control Block:


CPU Scheduling Information
-The process priority, pointers to scheduling queues etc. is the CPU scheduling information
that is contained in the PCB.
- This may also include any other scheduling parameters.
Memory Management Information
-The memory management information includes the page tables or the segment tables
depending on the memory system used.
-It also contains the value of the base registers, limit registers etc.
I/O Status Information
- This information includes the list of I/O devices used by the process, the list of files etc.
Process Control Block

Process Control Block:


Accounting information
- The time limits, account numbers, amount of CPU used, process numbers etc. are all a
part of the PCB accounting information.
Location of the Process Control Block
-The process control block is kept in a memory area that is protected from the normal user
access.
-This is done because it contains important process information. Some of the operating
systems place the PCB at the beginning of the kernel stack for the process as it is a safe
location.
Operation on the Process

Operation on the Process:


Creation
Scheduling
Execution
Deletion / Killing
Creation:
-Once process is created – it will be there in ready queue – so it will be ready for execution
Scheduling:
-Many processes are available in ready queue – Out of all the available processes OS
choose any one process for execution
-So selecting the process which is to be executed next is known as scheduling
Operation on the Process

Operation on the Process:


Execution:
-Once the process is scheduled for the execution, the processor starts
executing it.
- Process may come to the blocked or wait state during the execution
then in that case the processor starts executing the other processes.
Deletion / Killing:
-Once the purpose of the process gets over then the OS will kill the
process.
- The Context of the process (PCB) will be deleted and the process gets
terminated by the Operating system.
Threads in OS

-A thread is a single sequential flow of execution of tasks of a process so


it is also known as thread of execution or thread of control.
- There is a way of thread execution inside the process of any operating
system.
-There are many threads inside a process
-Each thread make use of separate program counter – stack activation
record- control blocks.
-Thread is often referred to as a lightweight process.
-Process – split into many thread
-Example – in browser – open multiple tabs
-In MS word – many thread – formatting text
processing input etc.
Threads in OS

Needs of Threads in OS:


-It takes less time for creation of thread in existing process – than
creation of new process
-Threads can share common data – they don’t use IPC
-Context switching is more faster than process.
-Less time to terminate the thread.
Types of threads
-Kernel Level Thread
-User Level Thread
Threads in OS

Types of threads -User Level Thread


A user-level thread (ULT) is a thread that is managed by an
application or user-level software, rather than the operating system's
kernel.
The OS does not recognize the user-level thread. - User threads can
be easily implemented and it is implemented by the user.
The kernel level thread does not know anything about the user level
thread. - The kernel-level thread manages user-level threads as if they
are single threaded processes
Advantages:
1. The user threads can be easily implemented than the kernel thread.
2. 2. User-level threads can be applied to such types of operating
systems that do not support threads at the kernel-level.
Threads in OS

Types of threads -Kernel Level Thread


4. Context switch time is shorter than the kernel-level threads.
5. It does not require modifications of the operating system.
6. User-level threads representation is very simple. The register, PC,
stack, and mini thread control blocks are stored in the address space of
the user-level process. 7. It is simple to create, switch, and synchronize
threads without the intervention of the process.
Disadvantages of User-level threads
1. User-level threads lack coordination between the thread and the
kernel.
2. If a thread causes a page fault, the entire process is blocked.
KLE SOCITY’S
G I BAGEWADI BCA COLLEGE,NIPANI

THANK YOU.

You might also like