final os
Operating System Notes
Unit 1: Introduction to Operating Systems
Definition
An Operating System (OS) is an interface between the user and computer hardware, managing system resources and hardware components.
Functions of an OS include:
File management
Memory management
Process management
Input/Output handling
Controlling peripheral devices
Features of an OS
Acts as an interface for applications and hardware.
Integrated set of specialized programs managing overall operations and resources.
Responsible for executing all other associated programs and system software.
Objectives of Operating Systems
Extended Machine: Provides a simple, abstract view of hardware, concealing details of physical devices.
Resource Manager: Tracks resource usage, accounts for requests, and optimizes resource allocation.
History of Operating Systems
Generations of Operating Systems
Generations are tied to technological advancements in computer architecture.
First Generation (1945-1955): Mechanical relays, vacuum tubes; no real OS.
Second Generation (1955-1965): Introduction of transistors; batch systems emerge.
Third Generation (1965-1980): Integrated circuits and multiprogramming.
Fourth Generation (1980-Present): Personal computers and user-friendly interfaces.
Unit 2: Operating System Structure
Kernel
Core component of an OS managing resources and operations; acts as an interface between applications and hardware.
Types of Kernels:
Monolithic: Entire OS runs in kernel mode; prone to failures affecting the whole system.
Microkernel: Manages minimal services, with user services in separate address space, enhancing reliability.
Exokernel: Allocates physical resources and allows user space OS.
Nanokernel: Small code with minimal functions, supporting hardware abstractions.
Client-Server Model
Distinguishes between client processes requesting services and server processes providing those services.
Communicates via message passing, enhancing flexibility and scalability.
Unit 3: Process Management
Process Definition
A process is a program in execution, containing various sections: stack, heap, text, data.
Process states: running, blocked, ready; transitions depend on CPU availability and resource requests.
Process Control Block (PCB)
Contains crucial process information such as state, process number, program counter, CPU scheduling information, I/O status, etc.
Manages the execution state of individual processes.
Cooperating Processes
Processes that they can affect each other by sharing data, implying they need synchronized communication.
Unit 4: Deadlocks
Definition
A deadlock occurs when processes are unable to proceed because each one holds a resource and waits for another.
Conditions for Deadlock
Mutual Exclusion: At least one resource must be held in a non-shareable manner.
Hold and Wait: Processes holding resources are waiting for more resources.
No Preemption: Resources cannot be forcibly taken from a process holding them.
Circular Wait: Processes form a circular chain, each waiting for a resource held by the next.
Handling Deadlocks
Deadlock Prevention: Eliminates one of the four necessary conditions.
Deadlock Avoidance: Uses strategies like the Banker’s algorithm to ensure a safe state.
Deadlock Detection and Recovery: Identifying deadlocks and removing them through process termination or resource preemption.
Unit 5: Memory Management
Definition
Manages computer memory allocation/deallocation to ensure effective utilization of RAM, managing process execution efficiently.
Memory Hierarchy
Registers
Cache
Main Memory
Magnetic Disks
Magnetic Tapes
Paging vs. Segmentation
Paging: Breaks memory into fixed-size pages, allowing non-contiguous allocation, solves external fragmentation.
Segmentation: Involves dividing memory into variable-length segments, susceptible to external fragmentation but provides logical view.
Virtual Memory
A storage mechanism allowing more data to be stored compared to physical memory via paging and segmentation, enhancing memory utilization.
Unit 6: I/O Device Management
I/O Devices
Divided into block devices (e.g., disks) and character devices (e.g., printers).
Unit 7: File System Management
File Concept
Defined as a collection of data stored on secondary storage with attributes such as name, identifier, type, location, and protection details.
File Operations
Create, Write, Read, Reposition, Delete, Truncate.
Directory Structure
Organizes files within systems for effective searching, managing access, and providing user hierarchies, such as single-level, two-level, or hierarchical.
Unit 8: Security Management
Definition
Refers to the protection of system resources and data from unauthorized access and malicious activities.
User Authentication and Program Threats
Authentication through passwords or biometric means; threats include viruses, worms, malware, and logic bombs.
Unit 9: Distributed Operating Systems
Definition
OS that runs across several machines, providing services to manage shared resources effectively.
Advantages and Disadvantages
Advantages: Scalability, reliability, performance, ease of data sharing.
Disadvantages: Complexity in management, latency issues, data loss potential.
Communication in Distributed Systems
Mechanisms such as shared memory and message passing facilitate interprocess communication while ensuring synchronization.
Overall, understanding the principles and functionalities of Operating Systems is crucial for developing efficient software and ensuring optimal utilization of hardware resources.