7H

OS Combine

School Information

  • Institution: School of Computer Sciences and Engineering

  • Department: Computer Science and Engineering

  • Semester: 5th

  • Subject Name: Operating System

  • Subject Code: 17YCT502

  • Faculty: Dr. M. Juned

Unit-1: Operating Systems Overview

What is an Operating System?

  • Definition: An Operating System (OS) is a system software that acts as an intermediary/interface between users and computer hardware.

  • Components of a Computer System:

    • Hardware

    • Software (includes Application Software and System Software/OS)

Goals of Operating Systems

  • Execute user programs to solve user problems

  • Make the computer system convenient to use

  • Efficient utilization of computer hardware

Architecture of Operating Systems

  • Modern operating systems are complex and provide many services, supporting various hardware and software.

  • Architectural Types:

    • Monolithic Architecture

    • Layered Architecture

    • Microkernel Architecture

Monolithic Architecture

  • All components are contained within a single kernel.

  • Pros: Efficient communication among components

  • Cons: Hard to detect subtle errors

Layered Architecture

  • Groups similar function components into layers.

  • Each layer communicates only with adjacent layers.

  • Challenges: Can lead to decreased system throughput.

Microkernel Architecture

  • Minimal services provided to keep the kernel small and scalable.

  • Pros: Highly modular and portable.

  • Cons: Can affect system performance due to increased intermodule communication.

Main Functions of Operating Systems

Memory Management

  • Definition: Management of Primary Memory or Main Memory

  • Activities:

    • Tracking memory usage

    • Allocating and deallocating memory for processes

Processor Management

  • Definition: Management of process scheduling in a multiprogramming environment.

  • Activities:

    • Tracking processor status

    • Allocating processor to processes

Device Management

  • Definition: Manages device communication via drivers.

  • Activities:

    • Tracking devices

    • Allocating devices efficiently

File Management

  • Organizes files in directories; manages file access and resources.

Other Functions

  • Security, Control over system performance, and Coordination between software and users

Evolution of Operating Systems

  1. First Generation (1940s - Early 1950s)

    • No OS; programming in machine language

  2. Second Generation (1955 - 1965)

    • Introduction of GMOS, a single-stream batch processing OS

  3. Third Generation (1965 - 1980)

    • Development of multiprogramming

  4. Fourth Generation (1980-Present)

    • Rise of PCs and graphical OS like Windows/Mac OS, including more sophisticated features

Unit-1 Module-2: Types of Operating Systems

1. Batch Operating System

  • Does not directly interact with users; processes jobs in batches.

  • Advantages:

    • Efficient processing for similar jobs

  • Disadvantages:

    • Debugging can be difficult; jobs may wait indefinitely if one fails.

2. Time-Sharing Operating Systems

  • Allows multiple users to access the system simultaneously by splitting CPU time among processes.

  • Advantages:

    • Efficient CPU utilization and less idle time

3. Distributed Operating Systems

  • Coordinating multiple interconnected computers for resource sharing and remote access.

  • Advantages:

    • Fault tolerance and scalability

4. Network Operating System

  • Manages data, users, and security across a network of machines.

  • Advantages:

    • Centralized management and remote access capabilities

5. Real-Time Operating System

  • Responds to input within specific time constraints.

  • Divided into Hard (strict timing) and Soft (less strict timing)

6. Embedded Operating System

  • Built directly into devices (e.g., medical equipment, cars).

7. Multiprogramming Operating System

  • Executes multiple jobs at once by managing job scheduling.

Virtual Machines

  • Simulates a physical computer environment, allowing multiple OS instances on single hardware.

Unit-2 Module-1: Processes

Definition

  • A process is a program in execution and represents a unit of work.

  • Sections of a Process: Stack, Heap, Text, Data

Process Control Block (PCB)

  • Contains information necessary for process management including state, number, and resources being used

Scheduler Types

  • Long-term Scheduler: Chooses which process to bring to the ready state.

  • Short-term Scheduler: Selects which process from the ready queue to execute.

  • Medium-term Scheduler: Swaps processes in and out of memory, optimizing multiprogramming.

Unit-2 Module-2: CPU Scheduling

Criteria for CPU Scheduling

  1. CPU Utilization

  2. Throughput

  3. Turnaround Time

  4. Waiting Time

  5. Response Time

Scheduling Algorithms

  • First-Come, First-Serve (FCFS): Processes scheduled in order of arrival.

  • Shortest Job Next (SJN): Prioritizes tasks with the shortest execution times.

  • Priority Scheduling: Based on process priority; potential starvation risk.

  • Round Robin: Each process gets a fixed time to execute, promotes fairness.

  • Multilevel Feedback Queue: Processes can move between queues as needed.

Unit-3 Module-1: Interprocess Communication

Definition

  • Mechanism that allows processes to communicate and synchronize their actions.

Concepts

  • Race Condition: Occurs when processes access shared data concurrently.

  • Critical Section: Code section where shared resources are accessed, requiring synchronization.

Techniques for Synchronization

  • Mutexes, Semaphores, Monitors, and Condition Variables.

Unit-4: Memory Management

Techniques

  • Contiguous Allocation: Each process requires a contiguous memory allocation.

  • Paging: Divides memory into fixed-size pages to avoid fragmentation.

  • Segmentation: Divides memory into segments based on logical divisions of programs.

Fragmentation Types

  1. Internal Fragmentation: Memory allocated but not used within a block.

  2. External Fragmentation: Free memory is available but not contiguous.

Unit-5: I/O Management

Definition

  • Process of managing input and output devices and operations.

Disk Scheduling Algorithms

  • FCFS: Serves requests in order of arrival.

  • SSTF: Shortest seek time first.

  • SCAN: Moves in one direction satisfying requests and returns.

  • C-SCAN: Similar to SCAN but jumps to the opposite end once it reaches one end.

  • LOOK: Stops moving when no more requests exist in the current direction.

Cache Memory

  • Temporary data storage to speed up data access.

  • Advantages: Faster than main memory, reduces access times.

  • Disadvantages: Expensive and limited capacity.

Files

  • A named collection of related information stored on secondary storage.

  • Attributes: Name, Identifier, Type, Location, Size, Protection.

  • Operations: Creating, Writing, Reading, Repositioning, Deleting, and Protection.

Directory Structures

  1. Single-level: All files in one directory.

  2. Two-level: Each user has a directory.

  3. Tree-structured: Hierarchical structure for better organization.

Security Overview

Computer Security

  • Protecting systems from unauthorized access and maintaining confidentiality and integrity of data.

Types of Security Threats

  • Malware, Phishing, Spoofing, Eavesdropping, Social Engineering.

Prevention Measures

  • Regular updates, using secure networks, strong passwords, and user education.