Operating System Concepts and Principles PDF
Document Details
Uploaded by UseableArtePovera
DDU, School of Computing
Tags
Summary
This document provides an overview of operating systems, exploring different types, functions, and design principles, like caching, virtualization, and support for concurrency. It also discusses important design issues of operating systems like speed, performance, memory management, security, and file systems.
Full Transcript
Operating system Outline What is an Operating System? Operating System Functions Operating System variants What is an Operating System? A program that acts as an intermediary between a user of a computer and the computer hardware. Operating system goals: – Manage comput...
Operating system Outline What is an Operating System? Operating System Functions Operating System variants What is an Operating System? A program that acts as an intermediary between a user of a computer and the computer hardware. Operating system goals: – Manage computer system resources. – Make the computer system convenient to use. Operating System Functions An operating system’s main functions are: – Multiprogramming, multiprocessor – Computer resource management – Runs software utilities and programs – Schedule jobs – Provide tools to configure the operating system and hardware – Administers user actions and accounts – Enforce security measure Operating System Functions… Schedule processes & multiplex CPU Provide mechanisms for IPC and synchronization Manage main memory Manage Input/Output devices Provide convenient persistent storage (files) Maintain system integrity, handle failures Enforce security policies (e.g., access control) Give users and processes an interface Operating System variants Batch system ▪ A batch operating system is a type of operating system that executes batches of jobs without manual intervention. ▪ Users submit jobs (tasks such as computations or data processing) to the system, which are queued and processed in batches. ▪ Example Workflow: 1. Users submit their jobs (programs) to a queue. 2.The operating system schedules these jobs based on priority or arrival order. 3.Jobs are executed in sequence or parallel (if the system supports it). 4.The system outputs the results after processing each job Multiprogramming operating system It is an operating system designed to run multiple programs (processes) simultaneously by sharing system resources like CPU, memory, and I/O devices. This improves system efficiency and resource utilization by keeping the CPU busy when a program is waiting for I/O operations or other tasks. Multitasking operating system It is the ability of an operating system to manage and execute multiple tasks (programs, processes, or threads) at the same time. It uses times slice, so it also known as time-sharing operating system The operating system achieves this by rapidly switching between tasks, giving the appearance that they are running simultaneously. This is especially important in modern computing, where users run multiple applications concurrently, like web browsers, word processors, and media players. Multiprocessor operating system It is designed to manage and coordinate multiple CPUs (central processing units) working together in a multiprocessor system. The key role of such an operating system is to efficiently allocate tasks, balance the load across processors, and ensure synchronized access to shared resources like memory and I/O devices. CHAPTER - TWO Design Principles Outline Basic design principles The design issues of OS Application programming interface Interrupts and the role of interrupts Dispatching and context switching Basic Design Principles ⚫There is no specific way to design an operating system as it is a highly creative task. ⚫The three important design principles in operating systems are: ▪ caching, ▪ virtualization, and ▪ support for concurrency. Basic Design Principles… Caching is a key design principle in operating systems that involves storing frequently accessed data in a fast-access memory location. The goal is to reduce the time it takes to retrieve data, improving performance and efficiency. Key Concepts: Cache Memory: A small, high-speed storage layer that stores copies of frequently accessed data from main memory. Benefits: Improved Speed: Reduces the time it takes to retrieve data by storing it in a faster, accessible location. Resource Optimization: Helps reduce the load on main memory or servers, improving overall system performance. virtualization the operating system (OS) design principles focus on creating an abstraction layer that allows multiple operating systems or applications to run on a single physical machine. Support for concurrency It refers to the system's ability to manage and execute multiple processes or threads simultaneously. Concurrency is critical for multitasking and efficient use of system resources, particularly in environments with multiple users or tasks. The design issues of OS ▪ Speed and Performance ▪ Memory Management ▪ File System Performance ▪ Concurrency and Parallelism ▪ Security Application programming interface An Application Programming Interface (API) is a set of rules and protocols that allows different software applications to communicate with each other. APIs define the methods and data formats that applications can use to request and exchange information. Here are some key points about. Interrupts and the role of interrupts Interrupts are signals sent to the processor that temporarily halt its current activities, allowing it to respond to events that require immediate attention. They play a crucial role in managing how a computer handles various tasks and ensures efficient processing. Here’s a detailed overview of interrupts and their roles: Interrupts and the role of interrupts Role of Interrupts 1. Efficient CPU Usage: Interrupts allow the CPU to perform other tasks instead of waiting for I/O operations to complete. When an interrupt occurs, the CPU can temporarily halt its current process and handle the interrupt. 2. Real-Time Processing: Interrupts enable real-time responses to events, making them essential for time-sensitive applications, such as audio processing, robotics, and embedded systems. 3. Multitasking: In operating systems, interrupts facilitate multitasking by allowing the CPU to switch between different processes or threads, giving the illusion of simultaneous execution. Interrupts and the role of interrupts 4. Resource Management: Interrupts help manage resources effectively. For example, when an I/O device is ready, it can signal the CPU through an interrupt to read or write data, optimizing resource utilization. 5. Error Handling: Software interrupts (traps) are used for error handling and debugging. When an application encounters an issue, it can generate a software interrupt to notify the operating system. Dispatching and context switching Dispatching refers to the process of selecting a ready process from the ready queue and assigning it to the CPU for execution. the time taken to switch from one process to another. This includes the time it takes to save the state of the current process and load the state of the next process. Context switching is the process of storing the state (context) of a running process so that it can be resumed later and loading the state of the next process to run on the CPU. This is crucial for multitasking.