IT Elective Operating Systems PDF
Document Details
Uploaded by Deleted User
Tags
Summary
This document discusses IT Elective Operating Systems. It includes topics like computer components, operating systems, and their functionalities. It also covers the history and different types of operating systems including single-user and multi-user systems.
Full Transcript
**IT ELECTIVE OPERATING SYSTEMS** **PPT \#1** COMPONENTS OF A COMPUTER SYSTEM - **Hardware:** Basic computing resources (CPU, memory, I/O devices). - **Operating System (OS):** Controls and coordinates hardware usage. - **Application Programs:** Software that uses system resources to...
**IT ELECTIVE OPERATING SYSTEMS** **PPT \#1** COMPONENTS OF A COMPUTER SYSTEM - **Hardware:** Basic computing resources (CPU, memory, I/O devices). - **Operating System (OS):** Controls and coordinates hardware usage. - **Application Programs:** Software that uses system resources to solve user problems (e.g., word processors, games). - **Users:** Individuals, machines, or other computers interacting with the system. - **SMALL COMPONENTS** - Process Management - Main Memory Management - File Management - I/O System Management - Secondary Memory Management - Networking - Protection System - Command-Interpreter System OPERATING SYSTEM - A sophisticated program running on the CPU with a main function called during boot. - Acts as an interface between users and computer hardware. - Hides hardware complexity from users. - Manages the overall operation of the computer system including hardware, security, and interfaces for both system and applications. KERNEL - in charge of the overall operation of the computer system. - Remains in memory and controls overall system operations. - Known as the "nucleus" of the OS. STARTING THE OS - **Booting:** Starting up a computer by loading the kernel. - **Bootstrap Program:** Code in ROM *[(firmware)]* that loads the OS from storage. - **BIOS (Basic Input/Output System):** runs at startup to load the OS. FUNCTIONS OF AN OPERATING SYSTEM - **Manages and Interacts with Computer Hardware:** - Controls CPU and RAM - Provides an interface for storage devices - manages I/O devices - *device drivers* = software programs that allow the hardware device to be used by the OS and by application software - **Provides and Manages System Security:** - Implements user authentication, protects data and software - **Single-user OS** - minimal security and user has full authority - **Multi-user OS** - login and password capability - protection of user's data stored on the server's central hard disk drives - protection and security for software programs - **Provides System Interface:** - **System Interface/Shell**: the interface between the user and the computer - User interaction through Command Line Interface (CLI) such as LINUX, DOS, UNIX or Graphical User Interface (GUI). - **Provides Interfaces for Application Software:** - Designed for specific CPU types and allows software compatibility. - Application software is developed for an operating system. OPERATING SYSTEM OBJECTIVES - **Convenience:** Makes the computer more convenient to use. - **Efficiency:** Allows computer system resources to be used in an efficient manner. - **Ability to Evolve:** Permit effective development, testing, and introduction of new system functions without interfering with service. SYSTEM DESIGN GOALS - **User goals**: convenient to use, easy to learn, reliable, safe, and fast. - **System goals**: easy to design, implement, and maintain, flexible, reliable, error-free, and efficient. TYPES OF OPERATING SYSTEMS - **Single-User/Single Tasking OS:** one user works at the OS and perform one task at a time - E.g., MS-DOS. - **Single-User/Multi-Tasking OS:** Most common form of OS used by PC and laptop and performs many tasks at once. - E.g., Windows, macOS, Linux. - **Multi-User/Multi-Tasking OS:** Many users connect to one computer and has a unique session. - E.g., UNIX, Linux. - **Real-Time Operating Systems (RTOS):** very fast small OS that is built into a device and quickly respond to user input. - E.g., Real-time Linux. HISTORY OF OPERATING SYSTEMS - Began in the 1940s with hardware like **ENIAC**. - Programs were loaded into memory manually using **switches, punched cards, or paper tapes.** - **Multiprogramming** means sharing of resources between more than one processes. - **Time-sharing systems** developed in the 1970s wherein multiple users have terminals (not computers) connected to the main computer and execute tasks on the main computer. - **Distributed** **systems** are similar to networks as they no longer need to exchange information explicitly. TODAY\'S OPERATING SYSTEMS - Multiple processors - **Load balancing:** Dynamically allocating tasks to the various processors. - **Scaling:** Breaking tasks into several subtasks equal to the number of processors available. - **The Network (Internet):** single network-wide operating system **PPT \#2** OPERATING SYSTEM (OS) - An OS is a program that manages computer resources and provides a user interface between users and hardware. KEY SERVICES PROVIDED BY AN OS - **Process**: program in execution, and the OS manages processes by allocating CPU time, memory, and I/O devices. - - - **First-Come, First-Served (FCFS)** - **Shortest Job First (SJF)** - **Round Robin (RR)** - - **Memory Management**: Ensures each process has access to the memory it needs to execute. - - - - - **File Management**: Organizes and stores data on disks. - - **File System Structures** - **Hierarchical**: Example: UNIX file system (e.g., /home/user/Documents). - **Flat**: Example: MS-DOS file system, where all files are in the same directory. - **Access Control**: Restricts access based on user permissions. OPERATING SYSTEM ARCHITECTURES - **Monolithic**: entire operating system is contained in a single executable file - - - **Microkernel**: Moves as much from the kernel into user space, using message passing. - - - **Hybrid**: Combination of monolithic and microkernel architectures. - VIRTUAL MACHINES - Treat hardware and the OS kernel as a unified hardware interface. - Types of Virtual Machines: - - SYSTEM CALLS - Interface between user-level programs and the kernel. - Examples: open(), close(), read(), write(), fork(), exec(). - Types of System Calls: - - - - - PPT \#3 PROCESS MANAGEMENT RESPONSIBILITIES OF THE OPERATING SYSTEM - **Process Creation and Deletion**: The OS manages the lifecycle of processes from creation to termination. - **Process Suspension and Resumption**: The OS can suspend processes (e.g., for resource management) and resume them as needed. - **Mechanisms for Synchronization and Communication**: The OS provides tools for processes to synchronize actions and communicate with each other. - **Resource Allocation and Scheduling**: The OS allocates CPU and memory resources to processes and schedules their execution. MULTIPROGRAMMING - **Definition**: Multiprogramming (or multitasking) allows multiple processes to share CPU and other resources. - **Objective**: To maximize CPU utilization by running multiple programs simultaneously. DIFFERENCE BETWEEN PROGRAM AND PROCESS **Program** **Process** -------------------------------------------------------------------------- ---------------------------------------------------------------------------------- A program is a set of instructions designed to complete a specific task. A process is an instance of an executing program. A program is a passive entity residing in secondary memory. A process is an active entity created during execution, loaded into main memory. A program exists until it is deleted. A process has a limited lifespan and terminates after completion. A program is static. A process is dynamic. A program requires memory space for instructions only. A process requires CPU, memory, and I/O resources. A program has no control block. A process has a Process Control Block (PCB). A program consists of code and data. A process requires additional management information. A program does not change itself. Multiple processes can execute a single program, with varying data. PROCESS STATES - **Created/New**: The initial state after creation, awaiting admission to the ready state. - **Ready**: Loaded into memory, waiting for CPU allocation. - **Running**: Actively executing on the CPU. - **Waiting**: Awaiting resource availability or I/O operations. - **Terminated**: Process has completed execution or has been killed. PROCESS CONTROL BLOCK (PCB) - **Definition**: a data structure in the operating system kernel containing the information needed to manage a particular process and called as \"the manifestation of a process in an operating system\" - **Location**: must be kept in an area of memory protected from normal user access or at the beginning of the kernel stack of the process. - **Attributes of PCB**: - Current state of the process - Process ID (PID) - Pointers to parent and child processes - Process priority - Memory allocation pointers - Register save area - I/O information (devices allocated, opened files) CONTEXT SWITCHING - **Definition**: The act of reassigning a CPU from one task to another one. It occurs when the kernel transfers control of the CPU from an executing process to another that is ready to run. - **When Context Switching Occurs**: - When a process exits. - When a process uses its time slice. - When a process requires unavailable resources. - When a higher priority process is ready to run. RESOURCE ALLOCATION AND SCHEDULING CONCEPTS - **Resource Types**: - **Pre-emptible Resources**: Can take resources away, and give them back later (e.g., CPU). - **Non-Preemptible Resources**: Once given resource, cannot be reused until voluntarily given up (e.g., disk blocks). - **Deadlock** -- two or more processes wait indefinitely for resources held by each other. - **Starvation** -- one or more processes never gets a share of the resource. SCHEDULING - **Definition**: The method of determining which process runs next from the ready queue. It also refers to the way processes are assigned to run on the available CPUs. - **Scheduler -** module that moves jobs or processes from queue to queue. - **Types of Scheduling**: - **Preemptive**: Scheduler can interrupt a job and force a context switch - **Non-Preemptive**: Scheduler waits for the running job to explicitly (voluntarily) block/terminate. CPU SCHEDULING CRITERIA - **CPU Utilization**: Keep CPU busy. - **Throughput**: Number of processes completed per time unit. - **Turnaround Time**: Time from submission to completion. - **Waiting Time**: Time spent waiting in the ready queue. - **Response Time**: Time from submission until the first response. - **Fairness**: Equal CPU time for all processes. LEVELS OF SCHEDULING - **Short-term Scheduling**: Decides which of the ready processes will execute next (dispatcher). - **Medium-term Scheduling**: Swaps processes in and out of memory. - **Long-term Scheduling**: Determines which processes enter the ready queue.