[go: up one dir, main page]

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

IOS (CS3451) - Full Notes

The document provides a comprehensive overview of operating systems, covering their elements, organization, functions, and evolution. It details process management, memory management, storage management, and the concept of virtual machines, along with mobile operating systems like iOS and Android. Key topics include process scheduling, synchronization, memory allocation strategies, disk scheduling algorithms, and the structure of file systems.

Uploaded by

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

IOS (CS3451) - Full Notes

The document provides a comprehensive overview of operating systems, covering their elements, organization, functions, and evolution. It details process management, memory management, storage management, and the concept of virtual machines, along with mobile operating systems like iOS and Android. Key topics include process scheduling, synchronization, memory allocation strategies, disk scheduling algorithms, and the structure of file systems.

Uploaded by

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

UNIT I – INTRODUCTION TO OPERATING SYSTEMS

1. Computer System: Elements and Organization

Basic Elements:

 Hardware: CPU, memory, I/O devices.


 Software: Operating system and application programs.
 Users: People or machines interacting with the computer.
 Data: Raw information processed by the system.

Computer System Organization:

1. CPU (Central Processing Unit) – Executes instructions.


2. Memory (RAM) – Stores data and instructions for CPU.
3. I/O Devices – Input: Keyboard, mouse; Output: Monitor, printer.
4. Storage Devices – Hard disks, SSDs for long-term storage.
5. System Bus – Transfers data between CPU, memory, and I/O.

2. Operating System Overview

Definition:

An Operating System (OS) is a system software that acts as an intermediary between the user and the
hardware, managing resources and providing services to programs.

3. Objectives and Functions of Operating System

Objectives:

 Convenience: Make the computer easier to use.


 Efficiency: Use hardware resources effectively.
 Ability to evolve: Should allow development and testing of new systems.

Functions:

1. Process Management
2. Memory Management
3. File System Management
4. Device Management
5. Security and Protection
6. User Interface

4. Evolution of Operating Systems

Generation Features

First (1940s–50s) No OS, programs entered via punch cards.

Second Batch processing systems (e.g., IBM 7090).

Third Multiprogramming, time-sharing (UNIX).

Fourth Personal computers, GUI-based OS (e.g., Windows).

Fifth Distributed, mobile, cloud, real-time OS.

5. Operating System Structures

Types:

 Monolithic – All OS components in one layer (e.g., MS-DOS).


 Layered – Hierarchical layers (e.g., THE OS).
 Microkernel – Minimal core functionality; other services in user space.
 Modular – Loadable kernel modules (e.g., Linux).
 Hybrid – Combination (e.g., Windows NT).

6. Operating System Services

Services Provided:

 Program Execution
 I/O Operations
 File System Manipulation
 Communication
 Error Detection
 Resource Allocation
 Security and Protection

7. User Operating System Interface


Types of Interfaces:

 Command-Line Interface (CLI) – e.g., Linux shell.


 Graphical User Interface (GUI) – e.g., Windows.
 Touch User Interface – e.g., Android, iOS.

8. System Calls

Definition:

System calls are the programming interface to the services provided by the OS.

Categories:

 Process Control – fork(), exit()


 File Management – open(), read(), write()
 Device Management – ioctl(), read()
 Information Maintenance – getpid(), alarm()
 Communication – pipe(), send(), recv()

9. System Programs

Purpose:

Provide a convenient environment for program development and execution.

Types:

 File manipulation
 Status information
 Programming language support
 Program loading and execution
 Communication

10. OS Design and Implementation

Design Goals:

 User goals – Easy to use, reliable, secure.


 System goals – Efficient, flexible, robust.

Implementation:
 Language: OS can be written in C, C++, Assembly.
 Kernel vs User mode: Kernel handles core services; user space is for applications.

11. OS Structuring Methods

Techniques:

 Monolithic Structure
 Layered Approach
 Microkernel Architecture
 Modular Approach
 Client-Server Model
 Virtual Machines

UNIT II – PROCESS MANAGEMENT

1. Processes

Process Concept:

 A process is a program in execution.


 It includes: Program code, program counter (PC), stack, data section, and heap.

Process States:

 New
 Ready
 Running
 Waiting
 Terminated

Process Control Block (PCB):

Contains:

 Process state
 Program counter
 CPU registers
 Memory management info
 I/O status info

2. Process Scheduling

Objective:

Decide which process runs next using a scheduling algorithm.

Scheduling Queues:

 Job queue: All processes in the system.


 Ready queue: In-memory processes ready to execute.
 Device queue: Waiting for I/O devices.

Schedulers:

 Long-term: Selects processes from the job pool.


 Short-term (CPU scheduler): Picks from ready queue.
 Medium-term: Swaps processes in/out of memory.

3. Operations on Processes

 Creation: Using fork() in Unix.


 Termination: exit() system call.
 Parent-child relationship: May share resources.

4. Inter-Process Communication (IPC)

Purpose:

Processes need to exchange data.

Methods:

 Shared Memory
 Message Passing

Communication Types:

 Direct / Indirect
 Synchronous / Asynchronous
5. CPU Scheduling

Scheduling Criteria:

 CPU Utilization
 Throughput
 Turnaround Time
 Waiting Time
 Response Time

Scheduling Algorithms:

Algorithm Description Type

FCFS (First Come First Serve) Non-preemptive, simple queue Non-preemptive

SJF (Shortest Job First) Chooses job with shortest burst Preemptive & Non-preemptive

RR (Round Robin) Time-slice-based Preemptive

Priority Scheduling Based on priority value Both

Multilevel Queue Multiple queues for different types Both

6. Threads

Definition:

A thread is a lightweight process sharing code and resources.

Benefits:

 Faster context switch


 Efficient communication

Multithread Models:

 Many-to-One
 One-to-One
 Many-to-Many

Threading Issues:

 Thread cancellation
 Signal handling
 Thread pools

7. Process Synchronization

Critical Section Problem:

 Section of code where shared resources are accessed.


 Must ensure Mutual Exclusion.

Conditions:

 Mutual Exclusion
 Progress
 Bounded Waiting

8. Synchronization Tools

Hardware Support:

 Test-and-set
 Compare-and-swap

Semaphores:

 Integer variable with atomic operations:


o wait() or P()
o signal() or V()
 Types: Counting, Binary (mutex)

Mutex Locks:

 Only one thread can hold the lock.


 Simple form of binary semaphore.

9. Classical Problems of Synchronization

1. Producer-Consumer Problem
2. Reader-Writer Problem
3. Dining Philosophers Problem
10. Monitors

 High-level synchronization construct.


 Encapsulates shared data, procedures, and synchronization.

11. Deadlock

Definition:

A situation where a set of processes are blocked, each waiting for a resource held by others.

Necessary Conditions:

1. Mutual Exclusion
2. Hold and Wait
3. No Preemption
4. Circular Wait

12. Handling Deadlocks

Methods:

1. Prevention
o Deny one of the necessary conditions.
2. Avoidance
o Ensure safe state (e.g., Banker’s Algorithm).
3. Detection and Recovery
o Detect cycles in resource allocation.
o Recover by killing processes or preempting resources.
4. Ignore the Problem
o Called the Ostrich Algorithm (used in many OSs).

Let me know if you'd like:

 A diagram set
 A PDF printable version
 A comparison table for algorithms
 Solved problems on CPU scheduling or deadlocks
✅ UNIT III – MEMORY MANAGEMENT

1. Main Memory

 Main memory (RAM) is a volatile storage area.


 OS manages memory allocation and deallocation.

2. Swapping

 Process of moving a process to/from disk (swap space).


 Used when RAM is full.

3. Contiguous Memory Allocation

 Each process occupies a single contiguous block of memory.

Allocation Strategies:

 First Fit: First free block that fits.


 Best Fit: Smallest block that fits.
 Worst Fit: Largest block.

Problem:

 Fragmentation: Internal and External.

4. Paging

 Physical memory is divided into frames, logical memory into pages.


 Avoids external fragmentation.

Page Table: Maps logical pages to physical frames.

5. Structure of Page Table

 Single-level page table


 Multi-level page tables
 Inverted page tables
6. Segmentation

 Divides program into segments (code, stack, data).


 Each segment has base and limit.
 Visible to the programmer.

7. Segmentation with Paging

 Combines benefits of both.


 Each segment is divided into pages.

8. Virtual Memory

 Execution of processes that may not be completely in memory.


 Enables larger address spaces.

9. Demand Paging

 Pages are loaded into memory only when required.


 Page Fault occurs if page is not in memory.

10. Copy-on-Write (COW)

 Parent and child processes share memory pages.


 If one writes, a copy is made.

11. Page Replacement Algorithms

Algorithm Description

FIFO Oldest page replaced

LRU Least recently used page

Optimal Replaces page not needed for longest time


Algorithm Description

Clock Circular list with use bit

12. Allocation of Frames

 Equal allocation
 Proportional allocation
 Priority-based allocation

13. Thrashing

 High page fault rate causes excessive swapping.


 Solution: Working Set Model, increase memory.

✅ UNIT IV – STORAGE MANAGEMENT

1. Mass Storage System

 Secondary storage (Hard disks, SSDs).


 Non-volatile.

2. Disk Structure

 Disk consists of platters, tracks, sectors.


 Addressing: CHS (Cylinder-Head-Sector) or LBA.

3. Disk Scheduling Algorithms

Algorithm Description

FCFS Simple, no reordering


Algorithm Description

SSTF Shortest Seek Time First

SCAN Elevator algorithm

C-SCAN Circular SCAN

LOOK & C-LOOK Like SCAN but doesn’t go to end

4. File-System Interface

File Concepts:

 Logical storage unit.


 Attributes: name, type, size, permissions.

Access Methods:

 Sequential
 Direct (random)
 Indexed

5. Directory Structure

 Organizes files.

Types:

 Single-level
 Two-level
 Tree-structured
 Acyclic graph
 General graph

6. Directory Organization

 Provides mapping between file names and file blocks.

7. File System Mounting


 Makes a file system available to the OS.

8. File Sharing and Protection

 Access control lists (ACLs)


 User/group/other permissions

9. File System Implementation

File System Structure:

 Boot control block


 Volume control block
 Directory structure
 File control blocks

Directory Implementation:

 Linear list
 Hash table

Allocation Methods:

Method Description

Contiguous Simple, fast, suffers fragmentation

Linked Pointers in each block

Indexed Uses index block (e.g., UNIX i-nodes)

Free Space Management:

 Bit vector
 Linked list
 Grouping
 Counting
10. I/O Systems

I/O Hardware:

 Controllers, buses, ports, devices

Application I/O Interface:

 APIs to access devices (read, write)

Kernel I/O Subsystem:

 I/O scheduling
 Buffering
 Caching
 Spooling

✅ UNIT V – VIRTUAL MACHINES & MOBILE OS

1. Virtual Machines (VM)

Definition:

Software emulation of a physical computer.

History:

 Originated in 1960s with IBM mainframes.

Benefits:

 Isolation
 Resource sharing
 Flexibility
 Testing environments

Features:

 Run multiple OSes on one machine.


 VM snapshot, cloning, migration.
Building Blocks:

 Hypervisor (VMM):
o Type 1 (bare metal)
o Type 2 (hosted)

Types of Virtual Machines:

 System VMs – Full OS virtualization (e.g., VMware, VirtualBox)


 Process VMs – For a single process (e.g., JVM)

Virtualization and OS Components:

 Requires hardware-assisted support.


 Virtual memory and CPU virtualization are key.

2. Mobile Operating Systems

iOS:

 Developed by Apple.
 Based on Darwin (UNIX).
 Secure and sandboxed.

Android:

 Open-source OS by Google.
 Based on Linux kernel.
 Uses Java/Kotlin with ART (Android Runtime).

You might also like