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

OS Unit-I

Introduction to Operating System

Uploaded by

vilasghonge77
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)
10 views

OS Unit-I

Introduction to Operating System

Uploaded by

vilasghonge77
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/ 86

Operating System

(SE21233)
Teaching Scheme
 Lectures : 02 Hrs./week
 Credits : 03

Examination Scheme
 Continuous Internal Evaluation(CIE):20
 Skills & Competency Exam(SCE):20
 End-Sem (Paper):40
 PR/OR/TW : 20
Operating Systems
Unit-1
Syllabus
Introduction, operating system operations, process
management, memory management, storage management,
protection and security, distributed systems. OPERATING
SYSTEMS STRUCTURES: Operating system services and
systems calls, system programs, operating system structure,
operating systems generations.
Reference Books
1. Silberschatz A & Galvin , Operating system concepts, JOHN WILEY & SONS. INC

2. William Stallings, “Operating Systems”, Pearson Education

3. Dhananjay M. Dhamdhere, “Operating Systems”, McGraw-Hill, 2009

4. Charles Crowley, “OPERATING SYSTEMS”, TMH


What is an operating system?
• An operating system (OS) is a collection of system programs that together
control the operation of a computer system.

Collection of
System programs

System program
System program
Controls
System program
System program

Operating Computer
System System
What does an operating system
do?
• The operating system includes programs that controls computer
systems:

1. initialize the hardware of the computer


system

2. provide basic routines for device control

3. provide for the management, scheduling


and interaction of tasks
C
o
n
t
r
o
Operating l Computer
System s System
4. Maintain system integrity and handle
errors
1. Initialize the hardware of the computer system
Initializing the hardware of a computer system typically involves several
steps. Here's an overview of the process:

 Power On Self Test (POST)


When you power on the computer, the BIOS/UEFI firmware
performs a POST to check the basic functionality of the hardware
components, such as the CPU, RAM, and storage devices.
 BIOS/UEFI (Unified Extensible Firmware Interface) Initialization
The BIOS/UEFI initializes the motherboard's hardware components,
including the CPU, memory, and peripheral interfaces . It also
configures system settings based on the stored configuration (CMOS
settings).
 Hardware Detection and Initialization
The BIOS/UEFI scans for connected hardware devices, such as hard
drives, SSDs, optical drives, USB devices, and network
interfaces. It initializes these devices and prepares them for use.
 Loading the Bootloader
After hardware initialization, the BIOS/UEFI searches for a bootable
device (e.g., hard drive, SSD, USB drive).It loads the bootloader from
the selected boot device into memory and transfers control to it.

 Operating System Boot


The bootloader loads the operating system kernel into memory and
hands over control to it .
The operating system continues the hardware initialization process,
loading drivers for all detected hardware components.
 Provide basic routines for device control
Device control in an operating system (OS) involves writing routines to manage
hardware devices, typically through device drivers. Device drivers are specific
types of software that allow the OS to communicate with hardware peripherals.

 Provide for the management, scheduling and interaction of


tasks
Managing, scheduling, and interacting with tasks in an operating system
involves several core concepts and routines.

1. Task Management
Task management involves creating, managing, and terminating processes and
threads.

2. Task Scheduling
Task scheduling involves determining which process or thread runs at a given
time. This is typically handled by the operating system's scheduler.

3. Inter-Process Communication (IPC)


IPC mechanisms allow processes to communicate and synchronize their
actions. Common IPC methods include pipes, message queues, shared
memory, and semaphores.
Maintain system integrity and handle errors
 Maintaining System Integrity:
This refers to keeping the OS in a consistent and functional state. Here are
some key practices:
Security Updates:
Disk Management:
File Permissions:
System Monitoring:

 Error Handling:
Errors are inevitable, but a robust OS should handle them gracefully to
minimize disruption.
Error Detection:
Error Reporting:
Graceful Termination:
User Notification:
Operating Systems: tasks

2. Producing output to the monitor

5. Provide environment and services to program


executions.
3. Keeping track of files and
directories on the disk
Application

Operating
Systems

4. Controlling peripheral devices


such as printers

1. Recognizing input from the keyboard &


mouse
Operating System
Definition in different aspects

1. Acts as an intermediary between a user and the


computer hardware.

2. It acts as a resource manager

3. Allow the program to communicate with one another


1. Acts as an intermediary between a user and the computer
hardware.

Operating
System
2. It acts as a resource manager for programs and users

Application
Resources programs
3. Allow the program to communicate with one another

Process-1
Process-2

IPC

Kernel
Operating System Objectives

OS
Objectives

Convenience  Makes a computer more convenient to be used.

 OS allows the computer system resources to


Efficiency
be used in an efficient manner.

Ability to evolve  An operating system is constructed in such a


way as to permit the effective
development of new system functions
OS Management Functions

OS

CPU Management IO Management

Memory Management User Management

Process Management Secondary Storage Management


CPU management : CPU management refers to the strategies and techniques
used to optimize the allocation and utilization of a computer's Central Processing
Unit (CPU) resources. It involves effectively managing the workload and tasks
assigned to the CPU to ensure optimal performance, responsiveness, and energy
efficiency.

Memory Management : Memory management is the process of allocating,


freeing, and reorganizing computer memory to optimize its use. It involves
efficiently managing the computer's Random Access Memory (RAM) to ensure
that programs and processes have the necessary memory resources to run
smoothly.

Process Management : Process management is a fundamental function of an


operating system (OS) that oversees the execution of various programs or
applications concurrently. It involves managing the lifecycle of processes,
allocating system resources, and ensuring efficient utilization of the CPU.
IO Management : I/O management is a crucial component of an
operating system that handles the communication between the CPU and
peripheral devices. It ensures efficient and reliable data transfer between
the system and its external environment.

User Management : User management is the process of creating,


modifying, and deleting user accounts within an operating system. It
involves managing user identities, assigning permissions, and controlling
access to system resources.

Secondary Storage Management : Secondary storage management is a critical


function of an operating system that handles the organization, allocation, and
access of data on secondary storage devices like hard drives, SSDs, and external
storage.
p1.exe

1. Start

2. prompt user for input 10


elements

3. Input 10 numbers from keyboard

4. Sort elements in ascending order

5. Print sorted elements on printer

6. write output into a file

7. Terminate
1. Start  Memory management

P1.exe

 Operating System module does memory allocation for the program and
data
2. prompt user for input 10
 Output device
elements management

Enter elements to be
sorted
-
 I/P device
3. Input 10 numbers from keyboard
management
 OS controls the keyboard to manage
Enter elements to be sorted
1 2 3 4 5 6 7 8 9 10 input for the application
 CPU
4. Sort elements in ascending
order
management

for ( i = 0; i < 10; i++)


{ for ( j = 0; j < 10; j++)
{
if ( a[i] > a[j] ) {

temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}

 Operating System assigns processor to the program and processor executes each
instructions.
5. Print sorted elements on printer  Device
management

P1.exe
6. write output into a  File
file management

P1.exe

Output.txt
Operating Systems
Architecture
OS kernel designs

1. Monolithic Kernel.
2. Microkernel.

20
What is Kernel
 The kernel is the core component of an operating system. It acts as a bridge
between the hardware and the software applications running on a computer.
Think of it as the brain of the computer, managing all the essential functions that
keep your system running smoothly.

Key Responsibilities of the Kernel:


• Hardware Management : Controls and coordinates the use of hardware
resources like the CPU, memory, storage devices, and peripherals.
• Process Management : Manages the execution of multiple programs
simultaneously, allocating CPU time and memory efficiently.
• Memory Management : Allocates and deallocates memory to processes,
preventing conflicts and optimizing memory usage.
• File System Management : Organizes and manages files and directories on
storage devices.
• Device Management : Handles communication between the operating system
and hardware devices.
• Inter-process Communication (IPC): Facilitates communication and data
exchange between different processes.
• Network Communication: Manages network connections and data transfer.
• Security: Protects the system from unauthorized access and malicious
activities.
How the Kernel Works:
1. Boot-up: When you start your computer, the kernel is loaded into memory
after the bootloader.
2. Initialization: The kernel initializes hardware components and sets up
essential data structures.
3. Process Management: The kernel creates processes, assigns them
resources, and schedules their execution.
4. System Calls: Applications interact with the kernel through system calls to
request services.
5. Resource Allocation: The kernel allocates and deallocates hardware
resources as needed.
6. Error Handling: The kernel handles errors and exceptions that occur during
system operation.
OS Kernel based upon size

• Operating Systems can be broadly classified into two categories:

• Monolithic Kernel OS.


• Microkernel OS.

23
Monolithic Kernel

24
What is Monolithic Kernel ?

 The kernel internally contains many components:

OS Kernel
Components

Memory Device
Manager Drivers

Scheduler File
System

25
Monolithic Kernel

User Mode

Applications and Utilities


Kernel Mode

Services

26
Monolithic Structure of Operating System

 The monolithic operating system is a very basic operating system in


which file management, memory management, device management,
and process management are directly controlled within the kernel.

 The kernel can access all the resources present in the system. In
monolithic systems, each component of the operating system is
contained within the kernel. Operating systems that use monolithic
architecture were first time used in the 1970s.

 The monolithic operating system is also known as the monolithic kernel.


This is an old operating system used to perform small tasks like batch
processing and time-sharing tasks in banks. The monolithic kernel acts
as a virtual machine that controls all hardware parts.

 A monolithic kernel is an operating system architecture where the entire


operating system is working in kernel space.
Advantages of Monolithic Kernel

Here are the following advantages of a monolithic kernel, such as:

 The execution of the monolithic kernel is quite fast as the services such as
memory management, file management, process scheduling, etc., are
implemented under the same address space.
 A process runs completely in single address space in the monolithic kernel.

Disadvantages Monolithic Kernel

 If any service fails in the monolithic kernel, it leads to the failure of the entire
system.
 The entire operating system needs to be modified by the user to add any new
service.

Here are some examples of monolithic operating systems:


 Linux: The most widely used open-source OS for desktops, servers, and
embedded systems.
 Microsoft Windows: The dominant desktop and laptop operating system.
• Example OS implements monolithic kernels include:

• Linux
• MS-Windows XP
• Free BSD

31
Microkernel

32
Microkernel in Operating Systems
 A microkernel is a type of operating system kernel that is designed to
provide only the most basic services required for an operating system to
function, such as memory management and process scheduling.

 Other services, such as device drivers and file systems, are


implemented as user-level processes that communicate with the
microkernel via message passing. This design allows the operating
system to be more modular and flexible than traditional monolithic
kernels, which implement all operating system services in kernel space.

 The main advantage of a microkernel architecture is that it provides a


more secure and stable operating system. Since only the most essential
services run in kernel space, the attack surface of the operating system
is reduced, making it more difficult for an attacker to exploit
vulnerabilities.

 Additionally, if a user-level process crashes, it will not affect the stability


of the entire system, since the microkernel is responsible only for
managing processes and memory.
 Another advantage of a microkernel architecture is that it makes the
operating system more modular and flexible. Since services are
implemented as user-level processes, it is easier to add, remove, or
replace services without affecting other parts of the system. This
makes it easier to customize the operating system to meet specific
requirements.

 One major disadvantage is that message passing between user-


level processes can be slower than direct system calls in a
monolithic kernel. This can affect the performance of the operating
system, especially in high-performance applications. Additionally, the
modular design of a microkernel can lead to increased complexity,
which can make it more difficult to develop and maintain the
operating system.
 Examples of Microkernel Operating System
1. QNX: This commercially successful microkernel OS is known for its reliability
and security. It's widely used in embedded systems, particularly in the
automotive industry, due to its real-time capabilities. (Developed by
BlackBerry)
2. Mach: While not a standalone OS itself, Mach is a microkernel that forms the
foundation for Apple's operating systems, including macOS, iOS, iPadOS,
and others. It provides core functionality like memory management and
inter-process communication.
3. Minix : Originally designed for educational purposes, Minix is a simple
microkernel-based OS that has been influential in operating system
research.
Microkernel model of an Operating System

User programs
Shell Utilities (browsers, games, word
processing)

API
Memory Processor
User File system
management Scheduling
mode

Kernel
Microkernel
mode

Devices CPU Memory


(disks, keyboards)
Shell: A command-line interpreter that allows users to interact with the operating
system. It translates user commands into system calls.

Microkernel: A minimalist kernel that provides only essential services, such as


process management, memory management, and inter-process communication
(IPC). Most other OS functionalities are implemented as user-level processes.
Differences between Microkernel and Monolithic Kernel :
S.
No. Parameters Microkernel Monolithic kernel

In microkernel, user In monolithic kernel, both


1. Address Space services and kernel user services and kernel
services are kept in services are kept in the
separate address space. same address space.

2. Design and OS is complex to OS is easy to design and


Implementation design. implement.

3. Size Microkernel are smaller Monolithic kernel is larger


in size. than microkernel.

4. Functionality Easier to add new Difficult to add new


functionalities. functionalities.

To design a
5. Coding microkernel, more code Less
to
code when compared
microkernel
is required.

Failure of one Failure of one component in


6. Failure component does not a monolithic kernel leads to
effect the working of the failure of the entire
micro kernel. system.

7. Processing Speed Execution speed is low. Execution speed is high.

8. Extend It is easy to extend It is not easy to extend


Microkernel. monolithic kernel.
S. No. Parameters Microkernel Monolithic kernel
10. Debugging Debugging is simple. Debugging is difficult.

11. Maintain It is simple to maintain. Extra time and resources are


needed for maintenance.

Message forwarding and Message passing and context


12. Message passing and context switching are switching are not required
Context switching required by the while the kernel is working.
microkernel.

The kernel only offers The Kernel contains all of the


13. Services IPC and low-level device operating system’s services.
management services.

14. Example Example : Mac OS X. Example : Microsoft Windows


95.
Operating System Generations
 Operating systems have evolved significantly since their inception. We can
categorize these advancements into distinct generations, each characterized by
the underlying hardware and the functionalities they introduced. Here's a
breakdown of the four main generations of operating systems:

 First Generation (1945-1955): Vacuum Tubes and Batch Processing

Hardware: Relied on bulky and power-hungry vacuum tubes for processing and
magnetic drums for storage.
Functionality: Batch processing was the dominant mode. Users submitted jobs
on punch cards, and the computer executed them sequentially, one after another.
No direct user interaction was possible during program execution.
Second Generation (1955-1965): Transistors and Batch
Systems
 Hardware: The invention of transistors replaced vacuum tubes, making
computers smaller, faster, and more reliable.

 Functionality: Batch processing remained prevalent, but operating


systems like IBM OS/360 and CDC 6600's SCOPE introduced
multiprogramming. This allowed the execution of multiple programs
concurrently, improving efficiency. However, users still couldn't directly
interact with the computer while programs were running.

Transistors in a computer
Third Generation (1965-1980): Integrated Circuits and
Multiprogramming

Hardware: The development of integrated circuits (ICs) miniaturized computers


even further, leading to the rise of minicomputers.

Functionality: Multiprogramming became more sophisticated, with features like


time-sharing allowing multiple users to interact with the same computer system
concurrently. This generation also saw the introduction of virtual memory, enabling
the computer to use hard disk space as an extension of RAM. Operating systems
like IBM System/360 and DEC PDP-11 were prominent during this era.

Integrated circuits
Fourth Generation (1980-Present): Personal Computers
Hardware: The invention of the microprocessor led to the development of
personal computers (PCs).

Functionality: The focus shifted towards user-friendliness. Graphical user


interfaces (GUIs) with icons, menus, and windows became the norm, making
computers more accessible to everyday users. Operating systems like Microsoft
Windows, Apple macOS, and various flavors of Linux continue to evolve in this
generation, offering features like multitasking, networking, and internet
connectivity.

Personal computer
These generations represent a significant advancement in operating systems,
making computers more powerful, efficient, and user-friendly.
Functional classes of
OS
1. Single-user systems
2. Batch processing
3. Multiprogramming
4. Multitasking systems
5. Time-sharing systems
6. Real-time systems
7. Network Operating Systems
8. Distributed systems
1. Single-user single tasking systems
Single-user operating system (OS): This is a type of operating system
designed for use by one person at a time. There are two main categories:

Single-user single-tasking OS: This type only allows one user to complete
one task at a time.
Examples : Early operating systems like MS-DOS are examples.

Single-user multitasking OS: This allows a single user to run multiple


programs concurrently, but they can only interact with one program at a time.

Examples : Modern operating systems like Windows and macOS fall into this
category.

Here are some key points about single-user systems:


Simpler and more efficient: They are generally less complex than multi-user
systems, making them easier to use and manage.
Limited functionality: They may have limitations on multitasking and security
features compared to multi-user systems.
Common uses: Single-user systems are often found in embedded devices,
point-of-sale systems, and personal computers.
Memory management (Single-user single tasking systems) :
• Simple Memory management scheme because only the OS and one process
reside in memory at any particular time.

Resident OS

Memory
Program-1
CPU scheduling (Single-user single tasking systems) :
• No need for CPU scheduling because only one process at a time and it gets
the processor.

Resident OS

Memory
Program-1
2. Batch processing systems

 A batch is a sequence of user jobs formed for processing by the operating


system.

Job-1 Job-2 Job-N

Computer System
 A computer operator formed a batch by arranging a few user jobs in a
sequence and inserting special marker cards to indicate the start and end
of the batch.

End of job Start of job

Job-N Job-2 Job-1

Sequentially arranged jobs

Computer System
Batch Processing: working
1. Operator initiates processing of a batch.
2. Batching OS kernel selects first jobs and assigns for
execution.
3. Automatically all jobs processed one by one sequentially.
4. Continue till last job.

Job-N Job-2 Job-1

Sequentially arranged jobs

Computer System

 Thus the operator had to intervene only at the start and end of a
batch.
 Turnaround Time
Turnaround time is the total time it takes for a process to
complete its execution from the moment it enters the system
until it finishes. It encompasses both the time the process spends
actively using the CPU and the time it spends waiting in the ready
queue or for I/O operations.

Components of Turnaround Time


Burst time: The actual time the process spends executing on the
CPU.

Waiting time: The time a process spends in the ready queue


waiting for its turn to use the CPU.

I/O wait time: The time a process spends waiting for I/O
operations to complete.

Turnaround Time = Burst Time + Waiting Time + I/O Wait Time


Importance of Turnaround Time
Performance evaluation: It helps assess the efficiency of different
CPU scheduling algorithms.
System responsiveness: Lower turnaround times indicate a more
responsive system.
Resource utilization: It can be used to optimize resource allocation.

Factors Affecting Turnaround Time


CPU scheduling algorithm:
Different algorithms (e.g., FCFS, SJF, Priority, Round Robin) have
varying impacts on turnaround time .

Process characteristics: Burst time, I/O requirements, and memory


usage influence turnaround time.

System load: The number of processes competing for CPU and I/O
resources affects overall performance.
Batch processing system: Turnaround
time
Multiprogramming
Multiprogramming is a fundamental concept in operating systems that allows
multiple programs to be executed concurrently on a single processor system. This
is achieved by rapidly switching the CPU between different programs.

How It Works
Multiple Programs in Memory: Several programs reside in the main memory
simultaneously.

Time-Sharing: The operating system allocates CPU time to each program in turn.

Context Switching: When a program needs to perform I/O operations, the OS


saves its state (registers, program counter) and switches to another program.

I/O Overlap: While one program is waiting for I/O, the CPU can execute another
program, improving efficiency.
Benefits of Multiprogramming
Increased CPU Utilization: By keeping the CPU busy with different programs, idle
time is minimized.

Improved Throughput: More work can be accomplished in a given time period.

Enhanced Resource Sharing: Multiple programs can share system resources like
memory and peripherals.

Challenges
Memory Management: Efficiently allocating and managing memory for multiple
programs is crucial.

Scheduling: Deciding which program to run and for how long requires careful
scheduling algorithms.

Protection: Preventing programs from interfering with each other is essential.


Core Components of Multiprogramming
Process: A program in execution is called a process.

Process Control Block (PCB): Contains information about a process,


including its state, registers, memory allocation, and more.

Scheduler: Responsible for selecting which process to run next.


Memory Management: Handles allocation and deallocation of
memory to processes.
Multitasking systems
 A multitasking system is a computer system capable of executing
multiple tasks or processes concurrently. It creates the illusion of
simultaneous execution by rapidly switching between different tasks,
allocating small time slices to each. This is achieved through a
technique known as time-sharing.

 Key Components and Concepts:


Time-sharing: The operating system divides the CPU's time into short intervals
(time slices) and assigns these slices to different tasks.

Process Management: Each task is represented as a process, and the operating


system manages these processes, including creation, scheduling, and
termination.

Memory Management: The system allocates memory to each process, ensuring


they don't interfere with each other.

I/O Management: Handles input and output operations efficiently, allowing tasks
to wait for I/O without halting the system.
Types of Multitasking:
• Preemptive multitasking: The operating system decides when to switch
between tasks, regardless of their current state.
• Cooperative multitasking: Tasks voluntarily yield control of the CPU to allow
other tasks to run.

Advantages of Multitasking:
Improved productivity: Users can work on multiple tasks simultaneously.
Efficient resource utilization: The CPU is kept busy by switching between tasks.
Better user experience: Provides a smooth and responsive system.

Challenges:
Performance: Maintaining responsiveness for all tasks can be challenging.
Memory management: Efficiently allocating memory to multiple processes is
crucial.
Scheduling: Determining which task to run next can be complex.

31
Examples of Multitasking Operating Systems:
Windows: Widely used in personal computers, offering both single-user and
multi-user multitasking.

macOS: Primarily used on Apple computers, known for its user-friendly interface
and efficient multitasking.

Linux: Versatile operating system supporting both single-user and multi-user


multitasking.

32
Single user multitasking systems
• Single-user multitasking systems include most modern PCs that support
windowing.

• In such systems it is common that one user is interacting with the system
but that the user may have several tasks started simultaneously.
A single user multitasking system allows a single user to perform
multiple tasks simultaneously on a computer. This is achieved by the
operating system rapidly switching between different tasks, giving
the user the illusion that they are happening at the same time.

How it works:
Time-sharing: The operating system divides the CPU's time into
small time slices, allocating these slices to different tasks.

Process Management: Each task is represented as a process, and


the system efficiently manages these processes, including creation,
scheduling, and termination.

Memory Management: The system allocates memory to each


process, ensuring isolation and protection of data.

32
Examples:

Microsoft Windows: One of the most widely used single-user


multitasking operating systems.

macOS: Another popular single-user multitasking OS, primarily used on


Apple computers.

Linux: While Linux is primarily known as a multi-user OS, it can also


function as a single-user multitasking system on personal computers.
Multiple interactive users multitasking systems
• Such systems handle multiple interactive users
concurrently.

• These systems are called timesharing OS.

User-1

User-2

User-3

User-4
A multiple interactive users multitasking system, often referred to as a multi-
user operating system, allows multiple users to simultaneously access and utilize
a single computer system. This is achieved through a process known as time-
sharing, where the operating system rapidly switches between different users'
tasks, giving each user the illusion of exclusive access to the system.

Key Components and Concepts:


Time-sharing: The operating system divides the CPU's time into small time slices,
allocating these slices to different users.

Process Management: Each user's task is represented as a process, and the


system efficiently manages these processes, including creation, scheduling, and
termination.

Memory Management: The system allocates memory to each user's process,


ensuring isolation and protection of data.

File System: A robust file system manages file storage and access, allowing
multiple users to share files and maintain their own data.

32
User Interface: Provides a way for users to interact with the system, typically
through a graphical user interface (GUI) or command-line interface (CLI).

Security: Implements mechanisms to protect user data and system resources,


including authentication, authorization, and access control.

Examples of Multi-User Operating Systems:


Linux: Widely used in servers, desktops, and embedded systems, known for its
stability and security.

Unix: The foundation for many modern operating systems, offering powerful
features for multitasking and multi-user environments.

Windows Server: Primarily used in enterprise environments, providing robust tools


for managing users, networks, and applications.

macOS Server: Designed for Apple environments, offering integration with other
Apple devices and services.

32
Advantages of Multi-User Systems:

• Resource Sharing: Efficient utilization of hardware resources, such


as CPUs, memory, and storage.
• Cost-Effective: Reduces the need for multiple computers by allowing
multiple users to share a single system.
• Centralized Management: Easier administration and maintenance of
user accounts, software, and security.
• Collaboration: Facilitates collaboration and sharing of information
among users.

Challenges and Considerations:


• Performance: Maintaining responsiveness for all users can be
challenging, especially under heavy load.
• Security: Protecting user data and system resources requires careful
implementation of security measures.
• Complexity: Managing multiple users and their tasks can be
complex, requiring efficient system design.
5. Time-sharing systems
• A time sharing system has multiple interactive programs in the memory of the
computer at any time.

• The technique is referred to as time sharing, because processor time is


shared among multiple users.

User-1

User-2

User-3

User-4
Time-sharing is a crucial concept in operating systems (OS) that allows multiple
users to share a single computer system concurrently. It's a technique where the
CPU's time is divided into small intervals or time slices, and these slices are
allocated to different processes.

How Time-Sharing Works


Process Creation: Multiple processes are created and loaded into the system's
memory.
Time Slicing: The CPU's time is divided into small time intervals or quanta.
Process Switching: The OS rapidly switches between different processes,
allocating a time slice to each.
Illusion of Simultaneity: While the CPU is actually working on one process at a
time, the frequent switching creates the illusion of multiple processes running
simultaneously.

Key Components
CPU Scheduling: The OS determines which process will run next and for how
long using scheduling algorithms like FCFS, SJF, Priority, Round Robin, etc.
Memory Management: Efficiently allocates memory to different processes,
preventing conflicts.
Input/Output (I/O) Handling: Manages I/O operations for multiple processes,
ensuring smooth execution.
Advantages of Time-Sharing
Improved resource utilization: Maximizes CPU usage by keeping it busy with
different tasks.
Enhanced responsiveness: Provides quick response times for interactive users.
Cost-effective: Allows multiple users to share a single system, reducing hardware
costs.
Facilitates collaboration: Enables multiple users to work on a shared project
simultaneously.

Examples of Time-Sharing Systems


Mainframe computers: Early pioneers in time-sharing technology.
Modern operating systems: Most modern OSes, including Windows, macOS, and
Linux, support time-sharing.
Real-time system
A real-time system is a computer system that processes data and events as they
occur, within strict time constraints. Unlike traditional computer systems that
prioritize throughput and efficiency, real-time systems prioritize timely responses
to events.

Key Characteristics
Time-bounded: Tasks have specific deadlines that must be met.
Predictable: System behavior must be highly predictable.
Responsive: The system must respond to events within specified time constraints.
Reliable: System failures can have catastrophic consequences.

Types of Real-Time Systems


Hard Real-Time Systems: Require absolute deadlines. Missing a deadline can lead
to system failure. Examples: flight control systems, medical equipment.

Soft Real-Time Systems: Tolerate occasional missed deadlines. Performance


degradation is acceptable, but not system failure. Examples: multimedia systems,
industrial control systems.
Components of a Real-Time System
Real-Time Operating System (RTOS): Handles scheduling, resource
management, and inter-process communication.
Hardware: High-performance processors, specialized input/output devices,
and reliable hardware components.
Real-Time Applications: Software that interacts with the environment and
meets real-time constraints.

Applications of Real-Time Systems


Industrial Automation: Control of manufacturing processes.
Aerospace and Defense: Flight control, missile guidance, radar systems.
Medical Equipment: Patient monitoring, surgical robots, drug infusion
pumps.
Telecommunications: Network switches, routers, real-time communication
protocols.
Automotive: Engine control, anti-lock braking systems, advanced driver
assistance systems.
Network Operating System (NOS)

A Network Operating System (NOS) is specialized software that


manages and controls network resources, enabling communication
and collaboration between devices connected to a network.
Unlike traditional operating systems that handle resources for a single
device, an NOS extends its functionalities across the entire network.

Key Functions of a NOS


• Resource Sharing: Allows multiple users to access shared resources
like printers, files, and applications.
• File and Print Services: Manages file storage, sharing, and printing
tasks across the network.
• Network Security: Implements security measures to protect network
resources and data.
• Network Management: Monitors network performance, diagnoses
issues, and configures network settings.
• User Management: Creates, manages, and maintains user accounts
and permissions.
Types of Network Operating Systems

• Client-Server NOS: Centralized architecture where a server manages


network resources and clients access them.
• Peer-to-Peer NOS: Decentralized architecture where all computers
have equal capabilities and can share resources directly.

Examples of Network Operating Systems

• Microsoft Windows Server: A popular client-server NOS offering


various features for network management and resource sharing.
• Linux: Versatile OS that can be used as a client-server or peer-to-peer
NOS, providing flexibility and open-source benefits.
• Novell NetWare: Historically significant NOS known for its file and print
services.
• UNIX: Powerful and stable OS often used as a foundation for network
operating systems.
Distributed Operating System
A distributed operating system (DOS) is a software system that manages
and coordinates multiple independent computers, making them appear
as a single system to the user.
Key Characteristics
• Multiple Computers: The system consists of multiple computers,
often referred to as nodes, connected through a network.
• Resource Sharing: Resources like CPU, memory, disk storage, and
printers can be shared across the network.
• Transparency: Users perceive the system as a single entity, even
though it's composed of multiple computers.
• Fault Tolerance: The system can continue to operate even if some
nodes fail.
How it Works
• Communication: Nodes communicate with each other using network
protocols.
• Process Management: Processes can be created, executed, and
managed across multiple nodes.
• File System: A distributed file system allows files to be accessed from
any node.
• Synchronization: Ensures data consistency across multiple nodes.
Advantages
• Scalability: The system can be easily expanded by adding more nodes.
• Reliability: If one node fails, the system can continue to operate.
• Performance: Tasks can be distributed across multiple nodes for improved
performance.
• Cost-effectiveness: Can utilize existing hardware and software resources.

Examples of Distributed Operating Systems


• Hadoop: While primarily known for big data processing, Hadoop has
distributed computing capabilities.
• Cloud Computing Platforms: Platforms like Amazon EC2, Google Compute
Engine, and Microsoft Azure exhibit characteristics of distributed operating
systems.

Common Use Cases


• High-performance computing: Distributing large computational tasks
across multiple nodes.
• Real-time systems: Ensuring high availability and fault tolerance.
• Distributed databases: Managing large datasets across multiple locations.
• Cloud computing: Providing scalable and on-demand computing resources.
Operating Systems
System Calls
System Calls
What is a System Call?
A system call is essentially a request made by a program to the
operating system (OS) to perform a specific task. It's like a bridge
between user-level applications and the kernel (the core of the
OS).

Why are they needed?


Protection: User programs are not allowed to directly access
hardware or perform privileged operations. System calls provide a
controlled way to interact with these resources.

Efficiency: The OS can optimize system calls for performance


and resource management.

Abstraction: System calls provide a high-level interface, hiding


the complexities of underlying hardware.
How do System Calls work?
User program makes a request: The program uses a library function or
assembly instruction to initiate a system call.
Mode switch: The CPU switches from user mode to kernel mode,
granting privileged access.
Kernel handles the request: The OS kernel takes over and performs
the requested operation.
Return value: The kernel returns a result or error code to the program.

Types of System Calls


System calls can be categorized based on their functions:
Process management: Creating, terminating, suspending, resuming
processes.
File management: Creating, deleting, opening, closing, reading, writing
files.
Device management: Input/output operations on devices.
Information maintenance: Getting system information, setting system
parameters.
Communication: Interprocess communication (IPC) mechanisms.
Examples of System Calls
open(): Opens a file.
read(): Reads data from a file or device.
write(): Writes data to a file or device.
fork(): Creates a child process.
exit(): Terminates a process.

System Call Interface


Different operating systems have their own system call interfaces.
Some common examples include:
Unix-like systems: System calls are accessed through library
functions like open, read, write, etc.
Windows: Uses Windows API functions.
Programmer’s view of system calls

fopen;

Compiler fread;

fclose;

• During compilation of a program, compiler replaces resource associated


statements by calls on library functions.
• The library functions actually implemented to use resources.
• During execution, the user program calls a library function and the library
function actually uses the resource through a kernel service.
Thank You!

You might also like