Operating System PDF
Document Details
Uploaded by SpellbindingSunflower
Tags
Summary
This document provides an overview of operating systems, explaining their purpose and functionalities. It covers various aspects of OSes, including user interface design, resource management functions, and the structure of a computer system. Also examining the different types of operating systems.
Full Transcript
OS Unit-I Definition: An Operating System (OS) is an interface between the user and the hardware, facilitating user interaction with the computer system. Functions: It manages various functions, including process management, synchronization, deadlocks, and file management. Purpose: The OS provides a...
OS Unit-I Definition: An Operating System (OS) is an interface between the user and the hardware, facilitating user interaction with the computer system. Functions: It manages various functions, including process management, synchronization, deadlocks, and file management. Purpose: The OS provides a convenient and efficient environment for users to execute programs, acting as an intermediary that allows users to interact with hardware, which operates on machine code. Structure of a Computer System 1. User End (Users and Application Programs) Users: people who are using the computer. Application Programs: Software used by the users to perform specific tasks. Examples : web browsers , games , video player etc. 2. System (Utilities and Operating System) Operating System (OS): The most critical part of system software, managing hardware resources and providing an environment for applications to run. Utilities: These are system-level programs that perform specific tasks to help manage and optimize the computer. 3. Hardware (Machine Language, Micro-programming, CPU, Memory, I/O Devices) Machine Language: The lowest-level programming language that is directly understood by the hardware. Micro-programming: A layer that lies between machine language and hardware. Micro-programs translate higher-level machine instructions into sequences of actions the hardware can execute. CPU (Central Processing Unit): The brain of the computer, responsible for executing instructions from both the system software and applications. Memory: o Primary Memory (RAM): Temporary storage o Secondary Memory: long-term data retention. I/O Devices: Input and output devices that allow users to interact with the computer and the computer to interact with external systems. Examples: keyboard , monitor ,printer , usb flash drives etc. Features of the Operating System: 1. User Interface (UI): Provides a simple, easy-to-use interface for users to interact with the computer’s hardware. A good UI is fast, responsive, and adaptable to user needs. 2. Memory Management: Manages computer memory by allocating and deallocating it for various processes, providing virtual memory, and preventing unauthorized access. 3. Process Management: Manages multiple processes simultaneously, enabling multitasking. It uses scheduling algorithms for fair resource distribution, and allows process communication and synchronization. 4. Device Management: Controls hardware devices, using device drivers to manage communication and enabling plug-and-play for automatic device detection. 5. File Management: Organizes files and folders, offering methods for file storage, retrieval, naming conventions, and permission controls. 6. Security: Protects the system with file encryption, firewalls, antivirus software, and backup features to safeguard against unauthorized access and data loss. 7. Performance: Ensures efficient system operation through fast boot/shutdown, minimal resource usage, and responsive user interactions. Characteristics of Operating Systems: 1. Concurrency: Supports multitasking by handling multiple processes at once. 2. Hardware Abstraction: Provides a consistent interface to hardware devices, simplifying software interaction with hardware. 3. Resource Allocation: Fairly allocates system resources based on demand and current system load. 4. Virtualization: Creates virtual resources (e.g., virtual memory) to enhance efficiency and support multiple processes. 5. Security: Protects against unauthorized access and system failures with encryption, firewalls, antivirus software, and recovery mechanisms. 6. Fault Tolerance: Handles hardware/software failures with error detection and recovery, minimizing downtime. 7. Scalability: Can scale from small devices to large servers while maintaining efficient resource management. 8. Compatibility: Works across a variety of hardware and software, allowing apps to run on different platforms. 9. Customizability: Allows users to modify the system’s features, settings, and UI to fit their needs. 10. Ease of Use: Provides a user-friendly interface, enabling even users with limited technical knowledge to operate the system. Purpose of an Operating System: The operating system (OS) manages all software and hardware operations of a computer or mobile device. Its key purposes include: 1. Booting: Initiates the process of starting up and powering the system. 2. Data Security: Provides features to protect data and programs from cyberattacks. 3. Process Management: Allocates resources to various processes, facilitating synchronization, information sharing, and protection. 4. Loading and Execution: Loads programs and executes them to run on the system. 5. Disk Management: Manages all disk devices, including hard drives and flash drives, and performs tasks like formatting and partitioning. 6. Memory Management: Coordinates applications and allocates memory space to programs. 7. Device Controlling: Regulates access to devices like USBs, CD/DVDs, and other external devices. 8. User Interface (UI): Provides an interface for users to interact with the system, using commands or graphical formats. Top Operating Systems Here's a summarized overview of the top operating systems with their advantages and disadvantages: 1. Microsoft Windows One of the most widely used operating systems globally, known for its versatility and user-friendliness. Advantages: High-level protection with built-in antivirus. Beginner-friendly. Fast and efficient. Disadvantages: Privacy concerns due to data collection. Vulnerable to malware and viruses. 2. macOS A premium operating system developed by Apple for Mac computers, focusing on security and seamless user experience. Advantages: Simple, user-friendly interface. Fastest OS with regular security updates. Pre-installed apps for convenience. Disadvantages: Only available for Mac devices. Fewer applications compared to Windows. Costlier than other OS. 3. Ubuntu A free and open-source operating system, popular among developers for its reliability and performance. Advantages: Free with five years of security updates (LTS version). Fast and developer-friendly. Multilingual support. Disadvantages: Lack of support for popular software like Adobe or Microsoft. 4. Linux Fedora An open-source Linux-based OS, preferred by developers for its cutting-edge features. Advantages: Lightweight and quick. Integrates new technologies quickly. Free with pre-installed applications. Disadvantages: Limited support due to a smaller community. Not beginner-friendly. 5. Linux Mint A user-friendly Linux distribution based on Ubuntu, providing a smooth and elegant interface. Advantages: Safe with multimedia support. Multiple desktop environments available. Pre-installed apps and free software. Disadvantages: Software update approach can be slow. No dedicated device manager. 6. Elementary OS An aesthetically pleasing Linux OS based on Ubuntu, resembling macOS in design. Advantages: Attractive macOS-like interface. Strong privacy features. Simple and user-friendly. Disadvantages: Slow software updates. Limited new program support. 7. Solaris A proprietary OS based on UNIX, known for scalability and cloud-friendly features. Advantages: Backup and restore utilities. Great virus protection. Supports ZFS file system for handling large data. Disadvantages: Limited hardware support. Lacks community support. 8. Solus A Linux-kernel-based OS designed for home computing, offering multiple desktop interfaces. Advantages: Regular updates. Beginner and advanced user-friendly. Customizable features. Disadvantages: Slower software development process. 9. Chrome OS A lightweight, fast OS developed by Google, primarily for Chromebooks, with strong security and reliance on cloud services. Advantages: Supports Android apps. Lightweight, fast, and cheaper than macOS devices. Automatic cloud backups. Disadvantages: Mostly relies on internet-based apps. Limited for advanced users. Privacy concerns due to data collection. 10. CentOS A community-driven Linux distribution derived from the same sources as Red Hat Enterprise Linux, offering a stable and secure environment ideal for servers. Each operating system caters to different user needs, whether it be for personal use, development, or business. Advantages of Operating Systems: 1. User-Friendly Interface: Operating systems provide an easy-to-use interface, allowing users to interact with the hardware and software efficiently. 2. Multitasking: They enable multiple programs to run simultaneously, improving productivity. 3. Security: Most operating systems offer security features such as user authentication and data encryption to protect information. 4. Resource Management: They manage the system’s resources like memory, CPU, and storage efficiently. 5. Hardware Support: Operating systems act as a bridge between software and hardware, ensuring compatibility and functionality. Disadvantages of Operating Systems: 1. Cost: Proprietary OS like Windows or macOS can be expensive. 2. Resource Consumption: Some operating systems require high system resources, which may slow down older devices. 3. Vulnerabilities: Operating systems can be vulnerable to malware and viruses if not properly secured. Objectives of an Operating System 1. Convenience: Provides a user-friendly interface for easy interaction with the computer. 2. Efficiency: Maximizes resource utilization and enhances performance through effective task scheduling and resource management. 3. Ability to Evolve: Adapts to changes in hardware and software, allowing for updates and new features. 4. Management of System Resources: Manages hardware resources (CPU, memory, storage, etc.) to ensure effective and efficient operation among applications and users. Types of Operating Systems (OS) 1. Batch Operating System A Batch Operating System allows multiple jobs to be grouped (batched) and processed together without manual intervention. It was widely used in the 1970s for mainframe computers. Working: Users submit their jobs to the system, and the jobs are collected in a batch. The system then executes each job sequentially, one after the other, in a First- Come-First-Serve (FCFS) manner. After execution, users collect their results. Resident Monitor: A small program called the resident monitor, which resides in the main memory, manages job execution. Advantages: 1. Improved Efficiency: By batching jobs together, the system avoids CPU idle time between jobs, leading to better resource utilization. 2. Automated Job Execution: Jobs are processed without the need for user interaction during execution. Disadvantages: 1. Starvation: If a job has a long execution time, it can prevent other jobs from executing, causing them to starve. 2. No Interactivity: Batch systems do not allow user interaction during job execution, which makes it unsuitable for jobs that require inputs from users. 2. Multiprogramming Operating System A Multiprogramming Operating System allows multiple processes to be loaded into memory and run concurrently by switching between processes when one is waiting for I/O operations. Working: When a process is performing I/O operations, the CPU switches to another process in the queue. This keeps the CPU busy and improves system efficiency. Advantages: 1. Increased Throughput: The CPU is always busy executing one program while another waits for I/O, leading to improved overall performance. 2. Reduced CPU Idle Time: As soon as one process waits for I/O, another process gets CPU time, reducing idle time. Disadvantages: 1. No User Interaction: Like batch systems, multiprogramming OSs do not support user interaction while the program is running. 2. Complex Memory Management: Managing multiple programs in memory simultaneously requires sophisticated memory management techniques. 3. Multiprocessing Operating System A Multiprocessing Operating System supports the use of multiple processors (CPUs) to execute multiple processes simultaneously, enhancing system performance. Working: The system divides tasks among several processors that work in parallel, enabling faster execution of complex tasks. It supports both symmetric multiprocessing (SMP), where all processors share memory and resources, and asymmetric multiprocessing (AMP), where one processor controls the system and others handle specific tasks. Advantages: 1. Increased Reliability: If one processor fails, others can take over the task, ensuring system reliability. 2. Higher Throughput: Multiple processors work on different tasks simultaneously, increasing the amount of work done in the same time frame. Disadvantages: 1. Complex System Design: Managing multiple processors requires sophisticated scheduling and resource allocation techniques. 2. High Cost: Multiprocessing systems are expensive to design, build, and maintain due to their complexity. 4. Multitasking Operating System A Multitasking Operating System allows multiple processes to be executed concurrently by allocating specific time slots to each process. It’s an extension of multiprogramming that supports user interaction. Working: The CPU switches rapidly between processes, giving the impression that all processes are running simultaneously. For example, users can run a web browser, text editor, and music player at the same time. Advantages: 1. Increased Productivity: Users can run multiple applications at once, improving efficiency and productivity. 2. Effective Memory Management: Memory is allocated to multiple processes efficiently, ensuring that all tasks get the resources they need. Disadvantages: 1. High CPU Usage: Multitasking increases CPU workload, leading to higher heat generation and potentially reducing system lifespan. 2. Complex Scheduling: Ensuring fair allocation of CPU time to each process requires sophisticated scheduling algorithms. 5. Network Operating System (NOS) A Network Operating System (NOS) is designed to manage network resources, allowing multiple computers to communicate and share resources such as files, printers, and applications over a network. Working: The NOS acts as a server that manages network traffic and ensures smooth communication between clients and the server. Each client system can access resources shared over the network, which are centrally managed by the server. Advantages: 1. Centralized Resource Sharing: Resources like files and printers can be shared among multiple computers, reducing costs and improving efficiency. 2. Reduced Network Traffic: The server efficiently manages data transmission, minimizing congestion on the network. Disadvantages: 1. Single Point of Failure: If the server fails, the entire network can become inaccessible. 2. Security Concerns: NOS requires constant monitoring for security vulnerabilities, making it crucial to have skilled administrators to manage the system. 6. Real-Time Operating System (RTOS) A Real-Time Operating System (RTOS) is designed for applications that require immediate processing and strict timing constraints. RTOS is used in systems where delays are unacceptable, such as in embedded systems or military applications. Working: Tasks in an RTOS must be completed within a specified time frame, known as a deadline. Tasks are prioritized based on urgency, and the system ensures timely execution. Advantages: 1. Precise Timing: Ensures that critical tasks are completed within defined time limits, making it suitable for mission-critical applications. 2. Efficient Resource Utilization: Maximizes the use of system resources like memory and CPU, ensuring smooth functioning even under tight deadlines. Disadvantages: 1. High Development Cost: Developing real-time systems is complex and costly due to the precise timing requirements. 2. Limited Flexibility: RTOS is designed for specific tasks, making it less flexible compared to general-purpose operating systems. 7. Time-Sharing Operating System A Time-Sharing Operating System allows multiple users to access the system simultaneously by allocating fixed time slots (called time slices) to each user’s program. It is an extension of multiprogramming and supports direct interaction with users. Working: The CPU switches rapidly between tasks, so each user feels like they have dedicated access to the system. The system allocates a short time slice to each user, after which it switches to the next task in the queue. Advantages: 1. Efficient Resource Utilization: The system makes optimal use of CPU time by switching between tasks, reducing idle time. 2. Reduced Response Time: Multiple users can interact with the system simultaneously, providing quick feedback and interaction. Disadvantages: 1. Security Issues: As multiple users share the system, maintaining data security and integrity becomes challenging. 2. Complex Scheduling: Requires advanced scheduling algorithms to ensure fair and efficient CPU time allocation among users. 8. Distributed Operating System A Distributed Operating System runs on multiple machines connected via a network, making them work together as a single system. Parts of the OS run on different computers, and they communicate to share resources and processes. Working: Distributed OSs enable computers to share hardware resources and tasks. Each machine runs a portion of the OS and is responsible for different tasks, and the communication between systems ensures resource sharing. Advantages: 1. Fault Tolerance: If one machine fails, the others can continue functioning, making the system more reliable. 2. Resource Sharing: Users can access resources available on other machines, leading to efficient utilization of resources. Disadvantages: 1. Complex Design: Managing communication and synchronization between different machines requires complex protocols and algorithms. 2. Latency Issues: Data transfer between machines may introduce delays, affecting system performance. Memory Management Functions in OS: 1. Memory Allocation: o OS allocates memory to processes, ensuring efficient use of available physical memory. 2. Memory Deallocation: o OS frees up memory once a process completes, allowing it to be reused by other processes. 3. Paging: o Divides memory into fixed-size pages and maps them to physical memory, reducing fragmentation. 4. Segmentation: o Divides memory into logical segments like functions or data, allowing flexible memory management. 5. Swapping: o Moves inactive processes to secondary storage (swap space) to free up memory for active processes. Processor Management Functions in OS: 1. Process Scheduling: o The OS schedules processes for execution using algorithms like First- Come-First-Serve (FCFS), Shortest Job Next (SJN), or Round Robin to maximize CPU utilization. 2. Process Creation and Termination: o OS handles the creation of new processes, assigns resources, and terminates processes when execution completes. 3. Context Switching: o The OS switches the CPU from one process to another, saving the state of the current process and loading the state of the next one. 4. Synchronization: o Manages coordination between multiple processes, ensuring they do not interfere with each other when accessing shared resources. 5. Deadlock Handling: o The OS detects, prevents, or resolves deadlocks where processes are stuck waiting for each other to release resources. Device Management Functions in OS: 1. Device Allocation: o The OS allocates and assigns devices to processes when needed. It ensures efficient usage of available devices like printers, disk drives, etc. 2. Device Monitoring and Control: o Monitors the status of all connected devices and ensures that they are working properly. The OS communicates with device drivers to manage I/O operations. 3. Device Drivers: o The OS uses device drivers, which are specialized software, to communicate with and control hardware devices. 4. Buffering and Spooling: o The OS uses techniques like buffering (storing data temporarily) and spooling (managing data flow for slow devices like printers) to handle data transfers efficiently. 5. Error Handling: o Detects and handles errors in device operations, such as input/output failures, and recovers from these errors when possible. Information Management Functions in OS: 1. File Management: o The OS manages files and directories, including creating, deleting, reading, and writing files. It organizes files in a hierarchical structure for easy access. 2. Access Control: o Implements security measures to control access to files and data. This includes permissions and user authentication to ensure that only authorized users can access or modify information. 3. Data Organization: o Organizes data efficiently for storage and retrieval. This includes using structures like tables, indexes, and databases to optimize performance. 4. Data Backup and Recovery: o Provides mechanisms for backing up data to prevent loss due to hardware failures or other issues. It also includes recovery processes to restore data in case of corruption or accidental deletion. 5. Data Sharing and Communication: o Facilitates data sharing among users and processes. The OS manages communication protocols to ensure data can be exchanged efficiently and securely.