0% found this document useful (0 votes)
2 views38 pages

Module-1

This document provides an overview of operating systems, detailing their functions, types, and architectures. It covers key roles such as resource management, process and memory management, and security, along with various operating system types like batch, time-sharing, and real-time systems. Additionally, it discusses system calls and the differences between monolithic, layered, and microkernel architectures.

Uploaded by

dgkbusiness1503
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)
2 views38 pages

Module-1

This document provides an overview of operating systems, detailing their functions, types, and architectures. It covers key roles such as resource management, process and memory management, and security, along with various operating system types like batch, time-sharing, and real-time systems. Additionally, it discusses system calls and the differences between monolithic, layered, and microkernel architectures.

Uploaded by

dgkbusiness1503
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

O PERATING S YSTEMS

Module 1

MODULE 1

Introduction

1
Contents

CONTENTS
• What is Operating System?
• What operating systems do
• Computer System Organization
• Operating System Services
• Architecture (Monolithic, Layered, Microkernel)
• Operating system operations
– Process Management, Memory Management, Storage Management, I/O Systems,
Protection & Security,
• Types of Operating Systems
– Batch O.S., Multi programmed O.S., Time Sharing O.S., Distributed O.S., Real Time O.S.,
Open source O.S.
• System calls & Overview on Types of System calls.

2
What is Operating System?

WHAT IS OPERATING SYSTEM?


• A program that acts as an intermediary between a user of a computer
and the computer hardware.
• Operating system goals:
– Execute user programs and make solving user problems easier
– Make the computer system convenient to use
– Use the computer hardware in an efficient manner

3
What is Operating System?

WHAT IS OPERATING SYSTEM?


• OS is a resource allocator
– Manages all resources
– Decides between conflicting requests for efficient and fair resource use
• OS is a control program
– Controls execution of programs to prevent errors and improper use of
the computer
• “The one program running at all times on the computer” is the kernel.
• Everything else is either a system program or an application program.

4
What Operating Systems Do

WHAT OPERATING SYSTEMS DO

• Key Roles:
– Acts as an intermediary between users and hardware.
– Manages resources like CPU, memory, storage, and I/O devices.
– Provides a user interface (CLI or GUI).
• Functions:
– Process and memory management
– File and storage management
– Device and I/O control
– Security and protection
– Networking and communication
5
What Operating Systems Do

WHAT OPERATING SYSTEMS DO

• Controls the hardware and coordinates its use among the various
application programs for the various users.
• Provides means for proper use of resources in the operation
of computer system.
• OS is like government; it simply provides an environment within which
other programs can do useful work.

6
Computer-System Operations

COMPUTER-SYSTEM OPERATIONS

• I/O devices and the CPU can execute concurrently


• Each device controller is in charge of a particular device type
• Each device controller has a local buffer
• CPU moves data from/to main memory to/from local buffers
• I/O is from the device to local buffer of controller
• Device controller informs CPU that it has finished its operation by
causing an interrupt

7
Computer System Structure

COMPUTER SYSTEM STRUCTURE


• Computer system can be divided into four components:
▪ Hardware – provides basic computing resources
• CPU, memory, I/O devices
▪ Operating system
• Controls and coordinates use of hardware among various applications and users
▪ Application programs – define the ways in which the system resources are
used to solve the computing problems of the users
• Word processors, compilers, web browsers, database systems, video games
▪ Users
People, machines, other computers

8
Four Components of a Computer System

FOUR COMPONENTS OF A COMPUTER


SYSTEM

9
Computer System Organization

COMPUTER SYSTEM ORGANIZATION


• Computer-system operation
– One or more CPUs, device controllers connect through common bus providing
access to shared memory
– Concurrent execution of CPUs and devices competing for memory cycles

10
Process Management

PROCESS MANAGEMENT

• A process is a program in execution. It is a unit of work within the


system. Program is a passive entity process is an active entity.
• Process needs resources to accomplish its task
– CPU, memory, I/O, files
– Initialization data
• Process termination requires reclaim of any reusable resources
• Single-threaded process has one program counter specifying location of
next instruction to execute
– Process executes instructions sequentially, one at a time, until completion

11
Process Management

PROCESS MANAGEMENT

• Multi-threaded process has one program counter per thread

• Typically, system has many processes, some user, some operating


system running concurrently on one or more CPUs
– Concurrency by multiplexing the CPUs among the processes / threads

12
Process Management Activities

PROCESS MANAGEMENT ACTIVITIES

• The operating system is responsible for the following activities in


connection with process management:
– Creating and deleting both user and system processes
– Suspending and resuming processes
– Providing mechanisms for process synchronization
– Providing mechanisms for process communication
– Providing mechanisms for deadlock handling

13
Memory Management

MEMORY MANAGEMENT

• To execute a program all (or part) of the instructions must be in memory


• All (or part) of the data that is needed by the program must be in memory.
• Memory management determines what is in memory and when to
optimize CPU utilization and computer response to users
• Memory management activities
– Keeping track of which parts of memory are currently being used and by whom
– Deciding which processes (or parts thereof) and data to move into and out of
memory
– Allocating and deallocating memory space as needed

14
Storage Management

STORAGE MANAGEMENT
• Storage Management refers to the way an operating
system manages various data storage devices and the
data stored on them.
• It includes managing both primary (RAM) and secondary
storage (hard drives, SSDs).
• File-System management
– Files usually organized into directories
– OS activities include
• Creating and deleting files and directories
• Primitives to manipulate files and directories
• Mapping files onto secondary storage 15
I/O System

I/O SYSTEM
• One purpose of OS is to hide unique behaviours and complexities of
underlying hardware devices from the user.
• I/O subsystem responsible for
– Memory management of I/O including buffering (storing data temporarily while
it is being transferred), caching (storing parts of data in faster storage for
performance), spooling (the overlapping of output of one job with input of other
jobs)
– General device-driver interface
– Drivers for specific hardware devices

16
Protection and Security

PROTECTION AND SECURITY


• Protection – any mechanism for controlling access of processes or users
to resources defined by the OS.
• Security – defence of the system against internal and external attacks
including denial-of-service, worms, viruses, identity theft, theft of service.
• Systems generally first distinguish among users, to determine who can do what
– User identities (user IDs, security IDs) include name and associated number, one
per user
– User ID then associated with all files, processes of that user to determine access control
– Group identifier (group ID) allows set of users to be defined and controls managed,
then
also associated with each process, file
– Privilege escalation allows user to change to effective ID with more rights
17
Types of Operating Systems

TYPES OF OPERATING SYSTEMS


• Batch O.S.
• Multi programmed O.S.
• Time Sharing O.S.
• Distributed O.S.
• Virtualization
• Real Time Embedded Systems
• Open source O.S.

18
Batch Operating System

BATCH OPERATING SYSTEM

• Batch OS executes batches of jobs without user interaction. Jobs


are grouped and processed sequentially
• Key Features: No direct user interaction during execution; Jobs
submitted via punch cards or scripts; Uses job scheduling to
optimize CPU usage
• Advantages: Efficient for large repetitive tasks; Reduces idle CPU
time
• Disadvantages: No real-time feedback; Debugging is difficult
• Examples: IBM OS/360, early UNIX systems
19
Multi programmed Operating System

MULTI PROGRAMMED OPERATING SYSTEM


• It allows multiple programs to reside in memory and share CPU
time. The OS switches between jobs to maximize CPU utilization.
• Key Features: Multiple jobs in memory; CPU switches to another
job when one waits for I/O; Requires memory management and
CPU scheduling
• Advantages: Better resource utilization; Increased throughput
Requires sophisticated
• Disadvantages: Complex scheduling;
memory management
• Examples: UNIX, Windows NT

20
Time Sharing Operating System

TIME SHARING OPERATING SYSTEM


• It extends multiprogramming by allowing multiple users to
interact with the system simultaneously. Each user gets a time
slice of the CPU.
• Key Features: Interactive user sessions; Uses time quantum for
CPU allocation; Supports multiple terminals
• Advantages: Fast response time; Efficient for multi-
user environments
• Disadvantages: Requires complex scheduling; Security and
data integrity concerns
• Examples: MULTICS, UNIX, Windows Server
21
Distributed Operating System

DISTRIBUTED OPERATING SYSTEM


• It manages a group of independent computers and makes them
appear as a single system to users.
• Key Features: Resource sharing across networked systems;
Transparency in access and location; Fault tolerance and scalability
• Advantages: High reliability and performance; Load balancing
across nodes
• Disadvantages: Complex synchronization and communication;
Security challenges
• Examples: Amoeba, Plan 9, Microsoft Azure OS

22
Real-Time Operating System

REAL-TIME OPERATING SYSTEM


• It is designed for systems that require immediate response to external
events. Common in embedded systems.
• Key Features: Deterministic response time; Priority-based scheduling;
Minimal latency
• Types:
– Hard Real-Time: Missing deadlines leads to failure
– Soft Real-Time: Occasional deadline misses are tolerable
• Advantages: Predictable behaviour; Optimized for specific hardware
• Disadvantages: Limited flexibility; Complex development
• Examples: VxWorks, RTEMS, FreeRTOS

23
Open Source Operating System

OPEN SOURCE OPERATING SYSTEM


• OS whose source code is freely available for modification and
redistribution.
• Key Features: Community-driven development; Transparent
architecture; Customizable and extensible
• Advantages: Cost-effective; High security through peer review
• Disadvantages: May lack professional support; Compatibility
issues with proprietary software
• Examples: Linux, FreeBSD, ReactOS
24
System calls

SYSTEM CALLS
• A system call is a programmatic way for a user-level process
to request services from the operating system's kernel.
• It acts as an interface between user applications and the
OS, allowing access to hardware and system resources.
• It triggers a switch from user mode to kernel mode
for privileged operations.
• They are used for accessing hardware resources,
file operations, process control, communication, etc.
25
Types of System calls

TYPES OF SYSTEM CALLS


• Process control
It is responsible for process management.
– create process, terminate process
– end, abort
– load, execute, fork
– get process attributes, set process attributes
– wait for time
– wait event, signal event
– allocate and free memory
– Dump memory if error
– Debugger for determining bugs, single step execution
– Locks for managing access to shared data between processes
26
Types of System calls

TYPES OF SYSTEM CALLS


• File management
It is responsible for file manipulation.
– create file, delete file
– open, close file
– read, write, reposition
– get and set file attributes
• Device management
It is responsible for device manipulation.
– request device, release device
– read, write, reposition
– get device attributes, set device attributes
– logically attach or detach devices
27
Types of System calls

TYPES OF SYSTEM CALLS


• Information maintenance
It is responsible for information being shared between processes.
– get time or date, set time or date
– get system data, set system data
– get and set process, file, or device attributes
• Communications
It is responsible for IPC.
– create, delete communication connection, pipe()
– send, receive messages if message passing model to host name or process name
• From client to server
– Shared-memory model create and gain access to memory regions
– transfer status information
– attach and detach remote devices
28
Types of System calls

TYPES OF SYSTEM CALLS


• Protection
– Control access to resources
– Get and set permissions
– Allow and deny user access

29
ARCHITECTURE (MONOLITHIC, LAYERED, MICROKERNEL)

1. Monolithic Architecture
A Monolithic Operating System is one in which all operating system services run
together in a single large kernel. Every component has direct access to every other
component.
Components:-
• Process Management
• Memory Management
• File System
• Device Drivers
• I/O Management
• Networking
All these components execute in kernel mode.
Advantages:-

• Very fast because all services communicate directly.


• High performance.
• Efficient execution with fewer context switches.
• Easier implementation for smaller systems.

Disadvantages:-

• Large kernel size.


• Difficult to maintain and debug.
• A bug in one module can crash the entire system.
• Poor security because all components share kernel privileges.

Examples:-
• Linux
• UNIX
• MS-DOS
2. Layered Architecture

In a Layered Operating System, the operating system is divided into multiple layers, where
each layer performs a specific function and communicates only with its adjacent layers.
Each upper layer uses the services of the lower layer.
• Typical Layers
• User Applications
• User Interface
• File System
• Process Management
• Memory Management
• Hardware
Advantages
• Easy to design and understand.
• Easier debugging and testing.
• Better security because communication is controlled.
• Easier maintenance and updates.
Disadvantages
• Slower due to communication through multiple layers.
• Careful layer design is required.
• Some operations may require passing through several layers, increasing overhead.
Examples
• THE Operating System (by Edsger Dijkstra)
• Parts of modern operating systems use layered concepts.
3. Microkernel Architecture

A Microkernel keeps only the essential functions inside the kernel. Other services run as separate user-space
processes (servers).

Kernel Contains
• Process Scheduling
• Interprocess Communication (IPC)
• Basic Memory Management
User Space Contains
• File System
• Device Drivers
• Network Services
• GUI
Advantages
• Very reliable.
• Better security.
• Easier to extend and maintain.
• Failure of one service usually does not crash the whole system.
• Portable to different hardware.
Disadvantages
• Slower than monolithic kernels because communication between services uses IPC.
• More context switches.
• Slightly lower performance.
Examples
• MINIX
• QNX
• Mach
• L4

You might also like