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

Operating System and Security

A computer system consists of hardware, an operating system, application programs, and users, working together to process data. The operating system serves as an interface between users and hardware, managing resources and providing essential services. Understanding the elements and organization of a computer system is crucial for designing efficient and secure operating systems.
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)
5 views157 pages

Operating System and Security

A computer system consists of hardware, an operating system, application programs, and users, working together to process data. The operating system serves as an interface between users and hardware, managing resources and providing essential services. Understanding the elements and organization of a computer system is crucial for designing efficient and secure operating systems.
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

1.

Introduction to Computer System

A computer system is an integrated set of


hardware, software, and users that work
together to process data and produce
information.

An Operating System (OS) acts as an


interface between the user and the hardware,
managing system resources efficiently.
ELEMENT…..
2. Elements of a Computer System

A computer system consists of four


main elements:

1. Hardware
2. Operating System
3. Application Programs
4. Users
2.1 Hardware

Hardware refers to the physical


components of the computer system.

Main Hardware Components:

● Central Processing Unit (CPU)


● Main Memory (RAM) Functions:
● Secondary Storage
● Executes instructions
● Input Devices
● Stores data and programs
● Output Devices
● Performs input/output operations
2.2 Operating System (OS)

The Operating System is a system software that controls the execution


of programs and acts as an intermediary between users and hardware.

Functions of OS:

● Process management
● Memory management
● File system management
● Device management
● Security and protection

Examples: Windows, Linux, macOS, UNIX


2.3 Application Programs

Application programs use system resources


to solve user-specific problems.

Examples:

● Word processors
● Web browsers
● Database systems
● Media players
2.4 Users

Users interact with the computer system


through:

● Commands
● GUI
● Application programs

Users may be:

● End users
● Programmers
● System administrators
ORGANIZATION…..
3. Organization of a Computer System
● The organization of a computer system explains
how
hardware and software

components interact.
3.1 Basic Computer System Organization

User

Application Programs

Operating System

Hardware (CPU, Memory, I/O Devices)


3.2 Central Processing Unit (CPU)
The CPU is the brain of the computer.

Components of CPU:

1. Arithmetic Logic Unit (ALU)

o Performs arithmetic and logical operations

2. Control Unit (CU)

o Directs and coordinates all operations

3. Registers

o High-speed storage inside CPU


3.3 Memory Organization

Types of Memory:
1. Main Memory (Primary Memory) 2. Secondary Memory
· RAM · Hard disk, SSD
· Volatile · Non-volatile
· Stores currently running · Stores data permanently
programs
3.4 Input / Output Devices
Input Devices:

· Keyboard

· Mouse

· Scanner

Output Devices:

· Monitor

· Printer

· Speakers
ARCHITECTURE…..
4. Computer System Architecture
4.1 Von Neumann Architecture

It consists of:

· CPU (Operation)

· Memory

· Input/Output devices

Key Feature:

· Program and data stored in the same memory


4.2 Stored Program Concept

· Instructions are stored in memory

· CPU fetches, decodes, and executes


instructions
5. Operating System as a Resource Manager

The OS manages:

· CPU time

· Memory space

· I/O devices

· Files and storage

Goal: Efficient, fair, and secure utilization of resources


6. Interrupts in Computer System

An interrupt is a signal sent to the CPU


to indicate an event.

Types of Interrupts:

1. Hardware Interrupts

2. Software Interrupts

3. Timer Interrupts
Interrupt Handling Steps:

1. Save current process state

2. Execute interrupt service routine

3. Resume previous process


6. Interrupts in Computer System

Interrupt Handling Steps:

1. Save current process state

2. Execute interrupt service routine

3. Resume previous process


6. Interrupts in Computer System

Interrupt Handling Steps:

1. Save current process state

2. Execute interrupt service routine

3. Resume previous process


7. System Calls

–System calls provide an interface between user programs and OS.

Categories of System Calls:

· Process control

· File management

· Device management

· Communication
8. Bootstrap Program

· Loaded when the system starts

· Initializes system components

· Loads the operating system into memory


9. Modes of Operation
User Mode Kernel Mode

· Limited access · Full access

· Used by application programs · Used by OS

This ensures system security and stability.


10. Conclusion
A computer system is composed of hardware, software, and users working
together.
The operating system plays a vital role in managing hardware resources and
providing an interface for applications and users.
Understanding the elements and organization of a computer system is
essential for designing efficient and secure operating systems.
1. Introduction to Operating System
An Operating System (OS) is a system software that manages computer
hardware and software resources and provides services to application
programs.
It acts as an interface between the user and the computer hardware.
Definition:
An Operating System is a program that controls the execution of user
programs, manages system resources, and provides a convenient environment
for program execution.
OVERVIEW…..
2. Operating System as an Interface
User

Application Programs

Operating System

Hardware (CPU, Memory, I/O Devices)

The OS hides hardware complexity and ensures efficient and secure system
operation.
OBJECTIVE…..
3. Objectives of an Operating System

The main objectives of an operating system are:

1. Convenience
2. Efficiency
3. Ability to Evolve
3.1 Convenience

● Makes the computer system easy to use


● Provides a user-friendly environment
● Eliminates the need for users to interact directly with hardware

Examples:

● Graphical User Interface (GUI)


● Command Line Interface (CLI)
3.2 Efficiency

● Ensures maximum utilization of system resources


● Minimizes response time and waiting time
● Improves system throughput

Resources managed:

● CPU
● Memory
● Storage
● I/O devices
3.3 Ability to Evolve

● Allows system to adapt to new hardware and user requirements


● Supports system upgrades and new features
● Enables addition of new system calls and services
4. Goals of an Operating System

● Execute user programs correctly


● Make system resources available efficiently
● Provide security and protection
● Prevent system errors and misuse
FUNCTIONS…..
5. Functions of an Operating System

The operating system performs several important functions to manage


computer resources.
5.1 Process Management

A process is a program in execution.

Functions:

● Creation and deletion of processes


● Scheduling of processes
● Synchronization between processes
● Inter-process communication
● Deadlock handling
5.2 Memory Management

Memory management handles the allocation and


deallocation of memory.

Functions:

● Keeps track of memory usage


● Allocates memory to processes
● Deallocates memory after execution
● Supports virtual memory
5.3 File System Management

The file system manages storage and retrieval of data.

Functions:

● Creation and deletion of files


● Directory management
● File access permissions
● File backup and recovery
5.4 I/O Device Management

The OS manages communication between hardware devices and


applications.

Functions:

● Device allocation and deallocation


● Buffering, caching, and spooling
● Device drivers management
● Error handling
5.5 Secondary Storage Management

Secondary storage provides permanent storage.

Functions:

● Free space management


● Storage allocation
● Disk scheduling
● Disk protection
5.6 Protection and Security

Protection ensures that resources are used only by authorized users.

Functions:

● Authentication (login, passwords)


● Authorization (access control)
● Data encryption
● Malware protection
5.7 Networking

The OS supports communication between systems.

Functions:

● Data transmission
● Network resource sharing
● Communication protocols
● Distributed system support
5.8 User Interface

Provides a way for users to interact with the system.

Types:

● Command Line Interface (CLI)


● Graphical User Interface (GUI)
6. Operating System Services

Operating systems provide services to users and programs.

Major Services:

● Program execution
● I/O operations
● File system manipulation
● Communication
● Error detection
● Resource allocation
● Accounting
7. System Calls and OS Functions

System calls act as an interface between user programs and OS services.

Types of System Calls:

● Process control
● File manipulation
● Device manipulation
● Communication
8. Conclusion
An operating system is an essential system software that manages
hardware resources and provides services to application programs.
The main objectives of an operating system are convenience,
efficiency, and the ability to evolve.
By performing functions such as process management, memory
management, file system management, and security, the operating
system ensures reliable, efficient, and secure operation of the computer
system.
Evolution of Operating Systems &
Operating System Structures
EVOLUTION…..
1. Introduction

Evolution of Operating Systems:

The evolution of operating systems describes how operating


systems have developed over time to meet the increasing demands
of users, hardware improvements, and application complexity.

Each generation of OS introduced new techniques to improve


performance, resource utilization, and user interaction.
2. Early Computer Systems (No Operating System)

Characteristics:

· No operating system

· Programs loaded manually using switches or punch cards

· One program executed at a time

Limitations:

· Wastage of CPU time

· High human effort

· No scheduling or protection
3. Simple Batch Operating Systems
Description:

· Introduced in the 1950s

· Jobs collected and executed in batches

· Resident monitor controlled execution

Features:

· Job sequencing

· Automatic job execution

· Input/output handled automatically


3. Simple Batch Operating Systems

Advantages:
· Reduced manual intervention
· Improved CPU utilization
Disadvantages:
· No interaction with users
· Long turnaround time
4. Multiprogramming Operating Systems
Description:

· Multiple programs loaded into memory simultaneously

· CPU switches between jobs

Key Concepts:

· Memory partitioning

· CPU scheduling

· Context switching
4. Multiprogramming Operating Systems

Advantages:

· Improved CPU utilization

· Reduced idle time


5. Time-Sharing Operating Systems

Description:

· Extension of multiprogramming

· CPU time shared among users

· Supports interactive computing


5. Time-Sharing Operating Systems

Features:

· Time slice (quantum)

· Fast response time

· Multiple users supported

Examples:

· UNIX

· Linux
6. Real-Time Operating Systems (RTOS)

Description:

· Used in time-critical systems

· Response time is guaranteed


6. Real-Time Operating Systems (RTOS)

Types:

1. Hard Real-Time Systems

2. Soft Real-Time Systems

Applications:

· Medical systems

· Industrial control

· Embedded systems
7. Distributed Operating Systems
Description:

· Multiple computers connected by a network

· Appears as a single system to users

Features:

· Resource sharing

· Load balancing

· Fault tolerance
8. Multiprocessor Operating Systems
Description:

· Supports multiple CPUs

· Parallel processing

Advantages:

· Increased throughput

· High reliability
9. Modern Operating Systems
Characteristics:

· GUI-based

· Multitasking and multiuser

· Support for virtualization and cloud computing

· Enhanced security

Examples:

· Windows, · Linux

· macOS, · Android
10. Introduction to OS Structures

Operating System Structures

An Operating System Structure defines how different components


of the OS are organized and interact with each other.
A good structure improves :
performance,
reliability, and
maintainability.
11. Simple Structure

Description:

· No clear separation between components

· Large monolithic system

Example:

· MS-DOS
11. Simple Structure…

Advantages:

· Fast execution

Disadvantages:

· Difficult to maintain

· Poor security
12. Monolithic Structure

Description:

· Entire OS runs in kernel mode

· All services integrated into one large program

Features:

· System calls handled within kernel

· Direct communication between components


12. Monolithic Structure…

Advantages:

· High performance

Disadvantages:

· Difficult debugging

· Poor modularity
13. Layered Structure…
Description:

· OS divided into layers

· Each layer uses services of lower layers

User Interface
Application Layer

OS Services

Kernel

Hardware
13. Layered Structure…

Advantages:

· Easy debugging

· Better security

Disadvantages:

· Performance overhead
14. Microkernel Structure

Description:

· Minimal kernel functionality

· Other services run in user space

Kernel Handles:

· Process scheduling

· Memory management

· Inter-process communication
14. Microkernel Structure…

Advantages:

· High reliability

· Easy extensibility

Disadvantages:

· Communication overhead
15. Modular Structure
Description:

· OS divided into loadable modules

· Modules can be added or removed dynamically

Example:

· Linux

Advantages:

· Flexibility

· Good performance
16. Hybrid Structure

Description:

· Combination of monolithic and microkernel approaches

Examples:

· Windows

· macOS

Advantages:

· Balanced performance and security


17. Virtual Machine Structure

Description:

· OS creates virtual machines

· Each VM runs its own OS

Advantages:

· Isolation

· Security

Efficient resource usage


18. Comparison of OS Structures

Structure Performance Security Maintainability


Monolithic High Low Low
Layered Medium High High
Microkernel Medium Very High Very High
Modular High High High
Hybrid High High Medium
19. Summary / Conclusion
The evolution of operating systems reflects continuous improvements in
efficiency, usability, and reliability.
From simple batch systems to modern distributed and real-time
systems, operating systems have adapted to changing computing
needs.
Different operating system structures such as monolithic, layered,
microkernel, and hybrid designs provide various trade-offs between
performance, security, and maintainability.
Operating System Services & User–Operating
System Interface
OS SERVICES…..
1. Introduction

An Operating System (OS) provides an environment in which


programs are executed efficiently and conveniently.

To achieve this, the OS offers a set of services to users and


application programs and provides a user interface for interaction
with the system.
2. Operating System Services

Operating system services are activities provided by the OS to support


program execution and system management.
2.1 User-Oriented Services

These services are provided for the convenience of users.

-Program Execution

-Input / Output Operations

-File System Manipulation

-Communication

-Error Detection
2.1.1 Program Execution

· Loads a program into memory

· Executes the program

· Handles normal and abnormal termination

Example: Running a C program or application software


2.1.2 Input / Output Operations

· Manages input and output devices

· Provides uniform I/O interface

· Handles buffering and spooling

Example: Reading from keyboard, writing to printer


2.1.3 File System Manipulation

· Create, delete, read, write files

· Directory creation and deletion

· Access permissions

Example: File open, close, rename operations


2.1.4 Communication

· Allows processes to exchange information

· Supports inter-process communication (IPC)

Methods:

· Shared memory

· Message passing
2.1.5 Error Detection

· Detects hardware and software errors

· Takes corrective actions

· Prevents system crashes


2.2 System-Oriented Services

These services ensure efficient system operation.

-Resource Allocation

-Accounting

-Protection and Security


2.2.1 Resource Allocation

· Allocates CPU, memory, storage, and I/O devices

· Ensures fair usage among processes


2.2.2 Accounting

· Tracks resource usage

· Used for billing and performance analysis


2.2.3 Protection and Security

· Controls access to system resources

· Prevents unauthorized usage

Mechanisms:

· Authentication

· Authorization

· Encryption
3. Operating System Services – Summary Table
Service Purpose

Program Execution Execute user programs

I/O Operations Manage input/output

File System Manage files & directories

Communication Process interaction

Error Detection Handle system errors

Resource Allocation Manage system resources

Accounting Track resource usage

Protection & Security Ensure safe access


OS INTERFACE…..
4. User–Operating System Interface

The User–OS Interface allows users to interact with the operating


system.
5. Types of User–Operating System Interfaces

Command Line Interface (CLI)

Graphical User Interface (GUI)

Touch-Based Interface
5.1 Command Line Interface (CLI)

Description:

· User interacts through text commands

· Commands are typed using keyboard

Examples:

· UNIX shell

· Linux terminal

· MS-DOS
5.1 Command Line Interface (CLI)...

Advantages:

· Fast execution

· Low memory usage

· Powerful for advanced users

Disadvantages:

· Difficult for beginners

· Requires command knowledge


5.2 Graphical User Interface (GUI)

Description:

· Uses graphical elements such as icons, menus, and windows

· User interacts using mouse, keyboard, or touch

Examples:

· Windows

· macOS

· Linux (GNOME, KDE)


5.2 Graphical User Interface (GUI)...

Advantages:

· User-friendly

· Easy to learn

· Visually intuitive

Disadvantages:

· Requires more memory

· Slower than CLI


5.3 Touch-Based Interface

Description:

· Uses touch input

· Common in mobile and embedded systems

Examples:

· Android, · iOS

Advantages:

· Easy interaction

· Suitable for handheld devices


6. System Calls and User Interface

· System calls provide the interface between user programs


and OS services

· User interfaces internally use system calls to request


services

Example:

· File open → system call → kernel operation


7. User Interface vs Operating System Services

Aspect OS Services User Interface

Purpose Provide system functionality User interaction

Level Internal OS operations User-level interaction

Examples File handling, memory mgmt CLI, GUI


8. Importance of OS Services and UI

· Improves user productivity

· Simplifies system usage

· Enhances system security

· Enables efficient resource management


9. Diagram: OS Services & Interface (Exam-Oriented)

User

User Interface (CLI / GUI)

System Calls

Operating System Services

Hardware
10. Conclusion
Operating system services provide essential functionalities required for
program execution, resource management, and system security.

The user–operating system interface enables users to interact


effectively with the system through command-line, graphical, or
touch-based interfaces.

Together, OS services and user interfaces ensure a convenient, efficient,


and secure computing environment.
System Calls and System
Programs
SYSTEM CALL…..
1. Introduction

An Operating System (OS) provides


services to users and application programs.

These services are accessed through


system calls, while system programs
provide a convenient environment for
program development and execution.
2. System Calls

2.1 Definition

A system call is a mechanism that allows a user program to request


services from the operating system kernel.

System calls act as an interface between user mode and kernel mode.

2.2 Need for System Calls

· User programs cannot directly access hardware

· System calls ensure security and protection

· Enable controlled access to OS resources


2.3 Working of a System Call

Steps:
User Program
1. User program invokes a system
↓ (System Call) call

2. Control switches to kernel mode

Operating System Kernel 3. OS performs requested operation

↓ 4. Control returns to user program

Hardware
3. Types of System Calls

System calls are classified into five major categories.


3.1 Process Control
3.2 File Management
3.3 Device Management
3.4 Information Maintenance
3.5 Communication
3.1 Process Control

Used to control execution of processes.

Functions:

· Create process

· Terminate process

· Load and execute program

· Wait and signal events

Examples:

· fork(), · exec()

· exit(), · wait()
3.2 File Management

Used to manage files and directories.

Functions:

· Create and delete files

· Open and close files

· Read and write operations

Examples:

· open(), · read()

· write(), · close()
3.3 Device Management

Used to manage I/O devices.

Functions:

· Request and release devices

· Read/write devices

· Get/set device attributes


3.4 Information Maintenance

Used to maintain system information.

Functions:

· Get system time and date

· Get process attributes

· Set system data


3.5 Communication

Used for inter-process communication.

Functions:

· Create communication connections

· Send and receive messages

· Shared memory operations


4. System Call Example (File Read)

1. Application calls read()

2. Control transfers to kernel

3. OS checks permissions

4. Data read from disk

5. Control returns to user program


SYSTEM PROGRAM…..
5. System Programs

5.1 Definition

System programs provide a convenient environment for program


development, execution, and system maintenance.

They run in user mode and use system calls internally.


5.2 Functions of System Programs

· File manipulation

· Program execution

· System status monitoring

· Communication

· User interface support


6. Categories of System Programs
6.1 File Management Programs

· Create, delete, copy, rename files

· Manage directories

Examples:

· ls

· cp

· rm

· mkdir
6.2 Status Information Programs

· Display system information


· Monitor performance

Examples:

· ps
· top
· date
6.3 File Modification Programs

· Edit file contents

· Search and filter text

Examples:

· vi

· nano

· grep
6.4 Programming Language Support

· Compilers

· Interpreters

· Debuggers

Examples:

· gcc

· javac

· python
6.5 Program Loading and Execution

· Load programs into memory

· Execute programs

Examples:

· loaders

· linkers
6.6 Communication Programs

· Support communication between users and systems

Examples:

· email

· ftp

· ssh
6.7 User Interface Programs

· Provide CLI or GUI environment

Examples:

· Shell

· Desktop environment
Relationship Between System Calls and System Programs

Aspect System Calls System Program


Level Kernel level User level
Purpose Provide OS Provide user
services utilities
Execution mode Kernel mode User mode
Examples read(), write() ls, ps, gcc
Diagram: System Calls & System Programs
User

System Programs

System Calls

Operating System Kernel

Hardware
Advantages

System Calls

· Secure access to hardware

· Controlled OS interaction

System Programs

· Simplify user tasks

Improve productivity
10. Conclusion
System calls form the interface between user programs and the operating
system, enabling secure and controlled access to system resources.
System programs provide a convenient environment for users to interact
with the system and perform tasks such as file management, program
execution, and communication. Together, they play a crucial role in the
efficient functioning of an operating system.
Design and Implementation – Structuring
Methods
SYSTEM CALL…..
1. Introduction

The design and implementation of an operating system determine


how efficiently, securely, and reliably it functions.
Structuring methods define how the components of an operating
system are organized, interconnected, and implemented.

A good OS structure:

· Simplifies design and maintenance

· Improves reliability and security

· Enhances performance and scalability


2. Need for OS Structuring Methods

· Operating systems are large and complex

· Easier debugging and testing

· Improved modularity

· Better protection and security

· Easier extension and maintenance


3. Design Issues in Operating Systems

While designing an OS, the following issues must be considered:

· Performance

· Reliability

· Security

· Portability

· Flexibility

· Maintainability
4. Implementation of Operating Systems

Operating systems can be implemented using:

· Assembly language (for low-level operations)

· High-level languages like C, C++

Modern OS kernels are mostly written in C, with small portions in


assembly.
SYSTEM CALL…..
5. Operating System Structuring Methods

The major structuring methods are:

1. Simple Structure

2. Monolithic Structure

3. Layered Structure

4. Microkernel Structure

5. Modular Structure

6. Hybrid Structure
5.1 Simple Structure

Description:

· No clear separation of OS components

· Entire OS is a single program

Example:

· MS-DOS
5.1 Simple Structure

Advantages:

· Simple to design

· Fast execution

Disadvantages:

· Difficult to maintain

· Poor security

· No modularity
5.3 Layered Structure

Description:

· OS divided into several layers

· Each layer uses services of the lower layer

User Interface

Application Programs

Operating System Services

Kernel

Hardware
5.3 Layered Structure

Advantages:

· Clear modularity

· Easy debugging and testing

· Improved security

Disadvantages:

· Performance overhead

· Difficult layer definition


5.4 Microkernel Structure

Description:

· Kernel contains only essential services

· Other services run in user space

Kernel Handles:

· Process scheduling

· Memory management

· Inter-process communication (IPC)

Examples: · Mach, · MINIX


5.4 Microkernel Structure

Advantages:

· High reliability

· Better fault tolerance

· Easy extensibility

Disadvantages:

· IPC overhead

· Slight performance reduction


5.5 Modular Structure

Description:

· OS divided into modules

· Modules can be dynamically loaded and unloaded

Example:

· Linux
5.5 Modular Structure

Advantages:

· Flexible design

· Easy extension

· Good performance

Disadvantages:

· Complex dependency management


5.6 Hybrid Structure

Description:

· Combination of monolithic and microkernel approaches

· Balances performance and modularity

Examples:

· Windows

· macOS
5.6 Hybrid Structure

Advantages:

· High performance

· Improved security

· Better scalability

Disadvantages:

· Complex design

· Large code base


6. Comparison of Structuring Methods

Structure Performance Security Maintainability

Simple High Low Low

Monolithic Very High Low Low

Layered Medium High High

Microkernel Medium Very High Very High

Modular High High High

Hybrid High High Medium


7. Design vs Implementation

Aspect Design Implementation

Focus Architecture Coding

Goal Structure & efficiency Functionality

Outcome OS structure Working OS


8. Advantages of Good OS Design

· Easy maintenance

· High reliability

· Improved security

· Better performance

· Easy scalability
9. Summary / Conclusion
Design and implementation are critical aspects of an operating system.
Structuring methods such as simple, monolithic, layered, microkernel,
modular, and hybrid designs provide different trade-offs between
performance, security, and maintainability. Choosing an appropriate
structuring method helps in building a robust, efficient, and scalable
operating system.
–THANK YOU–

You might also like