Operating System Introduction - MIT School of Computing
Document Details

Uploaded by EasierNephrite5305
MIT Schwarzman College of Computing
Tags
Summary
This document from MIT School of Computing provides an introductory overview of operating systems, covering topics like evolution, types, process and thread management, along with memory and storage. The document also explains OS services and the different components of an operating system, which is useful for understanding the fundamental principles of computer science.
Full Transcript
MIT School of Computing Department of Computer Science & Engineering 23CSE2010 - Operating System Class - S.Y. (SEM-IV) Course Credits: 3 CA Marks: 50 End Sem...
MIT School of Computing Department of Computer Science & Engineering 23CSE2010 - Operating System Class - S.Y. (SEM-IV) Course Credits: 3 CA Marks: 50 End Sem Marks: 50 AY 2024-2025 SEM-IV MIT School of Computing Department of Computer Science & Engineering Unit-I INTRODUCTION TO OPERATING SYSTEMS Introduction to Operating Systems: Evolution of Operating System, OS Definition, Operating System Overview – Objectives and Functions, Types of operating systems (Batch OS, Multi-programming OS, Time-sharing OS, Real-time OS), Functions, OS Structure(Monolithic, Microkernel, Layered, Client-Server), OS services (system calls, interrupt handling), System Programs, Kernel and user space, OS Generation and System Boot. Process Management: Process definition, the process concept – system programmer’s view of processes – operating system’s views of processes, States, Process Control Block (PCB), Process Creation and Termination (fork, exec, process hierarchy, exit, wait), Context switching, Types of schedulers (long-term, short-term, medium-term), Scheduling algorithms- Preemptive vs. Non-Preemptive Scheduling (FCFS, SJF, RR, Priority Scheduling) Case study: CPU scheduling algorithms MIT School of Computing Department of Computer Science & Engineering Unit-II PROCESS & THREAD MANAGEMENT Process Management: Process definition, The process concept – system programmer’s view of processes – operating system’s views of processes, States, Process Control Block (PCB), Process Creation and Termination (fork, exec, process hierarchy, exit, wait), Context switching, Types of schedulers (long-term, short-term, medium-term), Scheduling algorithms- Preemptive vs. Non-Preemptive Scheduling (FCFS, SJF, RR, Priority Scheduling, Multilevel Queue Scheduling, Multi-Level Feedback Queue (MLFQ), Completely Fair Scheduler (CFS), Lottery Scheduling), Thread Management: Threads Concepts, Thread Models, Multithreading Models, Thread Issues, Thread Scheduling. MIT School of Computing Department of Computer Science & Engineering Unit-III PROCESS SYNCHRONIZATION AND DEADLOCKS Process Synchronization: Cooperating processes and Race Conditions, The critical-section problem, Peterson’s solution, Semaphores, Classic problems of synchronization(Producer- Consumer Problem, Dining-Philosophers Problem, Readers and Writers Problem, Sleeping Barber Problem), Inter process Communication Overview of IPC, Examples of IPC Systems, Communication in Client Server Systems Deadlock: System Model, Deadlock characterization, Deadlock and Starvation, Methods for Handling Deadlocks, Resource Allocation Graphs, Deadlock Prevention, Deadlock Avoidance, Deadlock Detection, Recovery From Deadlock. MIT School of Computing Department of Computer Science & Engineering Unit-IV MEMORY & STORAGE MANAGEMENT Memory Management: Logical vs. physical address space, Contiguous Memory Allocation, Allocation Methods, Fragmentation, Compaction, Cache Memory, Paging, Demand paging, Segmentation, Virtual memory in modern OS, Page Replacement Algorithms(FIFO, LRU, Second Chance, OPT),Thrashing and techniques to avoid it. Storage Management: File-System Structure, Access Methods, Disk Structure, Disk Scheduling, Free-Space Management, Swap space management. MIT School of Computing Department of Computer Science & Engineering Unit-V Advance Operating System Distributed Operating Systems: System Architectures, RTOS & Scheduling (Rate-monotonic scheduling, Earliest Deadline First), Virtualization and Operating- System Components, Linux System — Design Principles, Process Management, Scheduling, Mobile OS — Android. MIT School of Computing Department of Computer Science & Engineering Unit-I INTRODUCTION TO OPERATING SYSTEMS Introduction to Operating Systems: Evolution of Operating System, OS Definition, Operating System Overview – Objectives and Functions, Types of operating systems (Batch OS, Multi-programming OS, Time-sharing OS, Real-time OS), Functions, OS Structure(Monolithic, Microkernel, Layered, Client-Server), OS services (system calls, interrupt handling), System Programs, Kernel and user space, OS Generation and System Boot. Process Management: Process definition, the process concept – system programmer’s view of processes – operating system’s views of processes, States, Process Control Block (PCB), Process Creation and Termination (fork, exec, process hierarchy, exit, wait), Context switching, Types of schedulers (long-term, short-term, medium-term), Scheduling algorithms- Preemptive vs. Non-Preemptive Scheduling (FCFS, SJF, RR, Priority Scheduling) Case study: CPU scheduling algorithms What is an Operating System? Use r Operating System Machin What is an Operating System? With hardware Characteristics of OS OS MIT School of Computing Department of Computer Science & Engineering Evolution of Operating First SystemGeneration Computers (1940-1950) The first computers used vacuum tubes(a sealed glass tube containing a near-vacuum which allows the free passage of electric current.) for circuitry and magnetic drums for memory. They were often enormous and taking up entire room. First generation computers relied on machine language. There were nothing such as OS. Was Using Serial Processing. They were very expensive to operate and in addition to using a great deal of electricity, generated a lot of heat, which was often the cause of malfunctions(defect or breakdown). The UNIVAC and ENIAC computers are examples of first-generation computing devices. MIT School of Computing Department of Computer Science & Engineering Advantages : It was only electronic device No OS was present Disadvantages : Too bulky i.e large in size Vacuum tubes burn frequently They were producing heat Maintenance problems MIT School of Computing Department of Computer Science & Engineering Evolution of Operating Second Generation Computers (1950-1960) System Transistors replaced vacuum tubes Used Batch System / Created base for multitasking. High-level programming languages were also being developed at this time, such as early versions of COBOL and FORTRAN. Batch Processing: Jobs were submitted in batches, and an operator loaded them into the computer sequentially. Job Control Language (JCL): Introduced to manage jobs. No Interactive Processing: Programs were executed without user interaction. Examples: IBM 701, IBM 7090. MIT School of Computing Department of Computer Science & Engineering Evolution of Operating Second Generation Computers (1950-1960) System IBM 1620 Advantages : Size reduced considerably Faster than previous generation Disadvantages : They over heated quickly Maintenance problems MIT School of Computing Department of Computer Science & Engineering Evolution of Operating Third Generation Computers (1960-1979) System Multiprogramming: Multiple programs could run simultaneously, improving CPU utilization. Time-Sharing: Allowed multiple users to share computing resources interactively. Introduction of System Software: Operating systems like UNIX and OS/360 emerged. Features: File systems, device drivers, and memory management. MIT School of Computing Department of Computer Science & Engineering Evolution of Operating Fourth Generation Computers (1980-1990) System Graphical User Interfaces (GUI): Made systems more user-friendly (e.g., Windows and macOS). Distributed Systems: Introduced to connect multiple computers for resource sharing. Networking Capabilities: Supported protocols for communication over LAN Examples: MS-DOS, Windows 1.0, 2.0 MIT School of Computing Department of Computer Science & Engineering Evolution of Operating Fifth Generation Computers (2000-Present) System Mobile and Embedded Systems: Operating systems optimized for mobile devices and IoT (e.g., Android, iOS). Virtualization and Cloud Computing: Virtual machines and cloud-based services became widespread. Security and Scalability: Focus on data security and scalable architectures. Examples: Linux, Windows 10, Android, iOS. MIT School of Computing Department of Computer Science & Engineering Evolution of Operating Summary System MIT School of Computing Department of Computer Science & Engineering Overview of Operating Systems MIT School of Computing Department of Computer Science & Engineering Overview of Operating Systems Divided into four components- 1] Hardware: Physical part of machine which provide basic computing resources. Eg: CPU, Memory, I/O Devices etc. 2]Operating System: It controls & co-ordinates use of hardware among various application & user. It assign different jobs to the hardware part while running a program. MIT School of Computing Department of Computer Science & Engineering Overview of Operating Systems 3]Application Program: It defines the ways in which the system resources are used to solve the computing problems of the users. -Application are readymade packages ready to use. -They utilize the hardware as well as software resources and fulfills user requirement. Eg: web browser, database system, video games etc. 4]User: Users are people, machines, other computers. MIT School of Computing Advantages of Operating System Department of Computer Science & Engineering PL D 22 Drawbacks DisadvantagesMIT of of School of Computing Operating Operating System Department of Computer Science & Engineering System PL D 23 MIT School of Computing Department of Computer Science & Engineering ervices of OS PL D 24 MIT School of Computing Department of Computer Science & Engineering Services of OS PL D 25 MIT School of Computing Department of Computer Science & Engineering Services of OS File Management: The operating system is responsible for organizing and managing the file system, including the creation, deletion, and manipulation of files and directories. Device Management: The operating system manages input/output devices such as printers, keyboards, mice, and displays. It provides the necessary drivers and interfaces to enable communication between the devices and the computer. PL Networking: The operating system provides networking capabilities such as D establishing and managing network connections, handling network protocols, and sharing resources such as printers and files over a network. User Interface: The operating system provides a user interface that enables users to interact with the computer system. This can be a Graphical User Interface (GUI), a Command-Line Interface (CLI), or a combination of both. Backup and Recovery: The operating system provides mechanisms for backing up data and recovering it in case of system failures, errors, or disasters. Virtualization: The operating system provides virtualization capabilities that allow multiple operating systems or applications to run on a single physical machine. This can enable efficient use of resources and flexibility in managing 26 workloads. MIT School of Computing Department of Computer Science & Engineering Services of OS File Management: The operating system is responsible for organizing and managing the file system, including the creation, deletion, and manipulation of files and directories. Device Management: The operating system manages input/output devices such as printers, keyboards, mice, and displays. It provides the necessary drivers and interfaces to enable communication between the devices and the computer. PL Networking: The operating system provides networking capabilities such as D establishing and managing network connections, handling network protocols, and sharing resources such as printers and files over a network. User Interface: The operating system provides a user interface that enables users to interact with the computer system. This can be a Graphical User Interface (GUI), a Command-Line Interface (CLI), or a combination of both. Backup and Recovery: The operating system provides mechanisms for backing up data and recovering it in case of system failures, errors, or disasters. Virtualization: The operating system provides virtualization capabilities that allow multiple operating systems or applications to run on a single physical machine. This can enable efficient use of resources and flexibility in managing 27 workloads. MIT School of Computing Department of Computer Science & Engineering Goals of OS PL D 28 Types of Operating Systems Batch Operating System Sequencing Multiprogramming Operating System No ideal Time for CPU Time-sharing Operating System Multitasking Distributed Operating System Coordination Network Operating System Connectivity Real-time Operating System Timeliness Multiprocessing Operating System Parallelism Embedded Operating Systems Specialization MIT School of Computing Department of Computer Science & Engineering Types of Operating Systems 1.Batch Operating System 2.Multiprogramming System 3.Time-sharing Operating System: PL 4.Distributed Operating System: D 5.Network Operating System: 6.Real-time Operating System: 7.Multiprocessing Operating System: 8.Embedded Operating Systems: 30 MIT School of Computing Department of Computer Science & Engineering 1.Batch Operating System PL D 31 MIT School of Computing Department of Computer Science & Engineering 1.Batch Operating System A system that allows multiple users to use it, without direct communication between them. It achieves this by keeping all users in separate ‘batches’, meaning they can’t interact with each PL D other directly. This makes it ideal for applications where users need to work on separate parts of a project, without getting in the way of each other. Examples of Batch Operating Systems: Payroll Systems, Bank Statements, etc. 32 MIT School of Computing Department of Computer Science & Engineering 1.Batch Operating System Advantages of Batch Operating System 1. Multiple users can share the batch systems. 2. The idle time for the batch system is very less. 3. It is easy to manage large work repeatedly in batch systems. PL D Disadvantages of Batch Operating System 1. The operators should be well known with batch systems. 2. Batch systems are hard to debug. 3. The other jobs have to wait for an unknown time if any job fails. 4. It has a high turnaround time. 5. Failure of one job impacts the execution of other jobs 33 2. Multiprogramming Operating System 2. Multiprogramming Operating System Multiprogramming is an advanced version of batch processing. It keeps the CPU busy by running multiple programs at the same time. Each program requires two types of system time: CPU time: Time spent executing instructions I/O time: Time spent on input/output operations. When one program waits for I/O, the CPU switches to another program. This improves the overall efficiency of the system. Eg: Windows, Linux, MacOS 2. Multiprogramming Operating System Advantages of Multiprogramming OS The CPU is always busy as there's always a program to run. Response time is faster. Resources like memory, I/O devices, and processing power are used better since multiple programs run at once. More tasks can be completed in less time, improving system efficiency. The processor keeps working by switching to other tasks when one program waits for I/O. It can handle both short and long tasks at the same time, making the system more productive. 2. Multiprogramming Operating System Disadvantages of Multiprogramming OS : There is no direct interaction between users and the computer. Managing multiple programs increases system complexity. It needs more memory since many programs run simultaneously. Switching between programs adds overhead, which can slow down performance. Deadlocks may occur when processes wait for each other to MIT School of Computing Department of Computer Science & Engineering 3. Time-sharing Operating System: PL D 38 MIT School of Computing Department of Computer Science & Engineering 3. Time-sharing Operating System: Each task is given some time to execute so that all the tasks work smoothly. Each user gets the time of the CPU as they use a single system. These systems are also known as Multitasking PL Systems. D The task can be from a single user or different users also. The time that each task gets to execute is called quantum. After this time interval is over OS switches over to the next task. Examples of Time-Sharing OS UNIX, Linux, IBM VM/CMS, Windows NT server, Windows 2000 server 39 MIT School of Computing Department of Computer Science & Engineering 3. Time-sharing Operating System: Advantages of Time-Sharing OS 1. Each task gets an equal opportunity. 2. CPU idle time can be reduced. 3. Resource Sharing between multiple users. PL 4. Time-sharing allows users to work concurrently. D Its reduce waiting time. Disadvantages of Time-Sharing OS 1. It has difficulty with consistency. 2. A security and integrity problem with user programs and data. 3. High Overhead because need for scheduling, context switching. 40 MIT School of Computing Department of Computer Science & Engineering 4. Distributed Operating System: Key Characteristics of Centralized Systems 1. Single Point of Control 2. Scalability Issues 3. Single Point of Failure PL D 4. No Fault Tolerance 5. No Coordination and Communication 6. No Resource Sharing 7. Performance degrade with increased load. 41 MIT School of Computing Department of Computer Science & Engineering 4. Distributed Operating System: A distributed system is a collection of independent computers that appear to the users of the system as a single coherent system. These computers or nodes work together, communicate over a network, and coordinate their activities to achieve a PL common goal by sharing resources,D data, and tasks. The autonomous computers will communicate among each system by sharing resources and files and performing the tasks assigned to them. Distributed Operating Systems are of two types: Client- Server Systems and Peer-to-Peer Systems. Examples of distributed operating systems Solaris, Micros, DYNIX, Ubuntu, Linux 42 MIT School of Computing Department of Computer Science & Engineering 4. Distributed Operating System: PL D 43 MIT School of Computing Department of Computer Science & Engineering 4. Distributed Operating System: Advantages of Distributed OS 1. Failure of one will not affect the other network communication, as all systems are independent of each other. 2. Load on host computer reduces. PL 3. Since resources are being shared, Dcomputation is highly fast and durable. Disadvantages of Distributed OS 1. Failure of the main network will stop the entire communication. 2. To establish distributed systems the language is used not well- defined yet. 3. These types of systems are not readily available as they are very expensive. 44 MIT School of Computing Department of Computer Science & Engineering 4. Time-sharing Operating System: PL D 45 MIT School of Computing Department of Computer Science & Engineering 4. Time-sharing Operating System: Each task is given some time to execute so that all the tasks work smoothly. Each user gets the time of the CPU as they use a single system. These systems are also known as Multitasking PL Systems. D The task can be from a single user or different users also. The time that each task gets to execute is called quantum. After this time interval is over OS switches over to the next task. Examples of Time-Sharing OS UNIX, Linux, IBM VM/CMS, Windows NT server, Windows 2000 server 46 MIT School of Computing Department of Computer Science & Engineering 4. Time-sharing Operating System: Advantages of Time-Sharing OS 1. Each task gets an equal opportunity. 2. CPU idle time can be reduced. 3. Resource Sharing between multiple users. PL 4. Time-sharing allows users to work concurrently. D Its reduce waiting time. Disadvantages of Time-Sharing OS 1. It has difficulty with consistency. 2. A security problem with user programs and data. 3. High Overhead because need for scheduling, context switching. 47 MIT School of Computing Department of Computer Science & Engineering 5. Multiprocessing Operating System: PL D 48 MIT School of Computing Department of Computer Science & Engineering 5. Multiprocessing Operating System: Type s PL D 49 MIT School of Computing Department of Computer Science & Engineering 5. Multiprocessing Operating System: Key Features PL D 50 MIT School of Computing Department of Computer Science & Engineering 6. Network Operating System: PL D 51 MIT School of Computing Department of Computer Science & Engineering 6. Advantages of Network Operating System 1. Centralized management – 2. Resource sharing – PL 3. Scalability- D 4. Security – 5. Remote access – 52 MIT School of Computing Department of Computer Science & Engineering 6. Disadvantages of Network Operating System 1. Complexity – 2. Cost - 3. Security – PL 4. Compatibility – D 5. Maintenance – 53 MIT School of Computing Department of Computer Science & Engineering 7. Embedded Operating Systems PL D 54 MIT School of Computing Department of Computer Science & Engineering 7. Embedded Operating Systems 1. Combination Of Software & Hardware 2. Real-time Operating System PL 3. To Perform Specified Tasks D 4. Reactive operation 5. Popular example are eCos, mbed OS, VxWorks, µC/OS-II, FreeRTOS 55 MIT School of Computing Department of Computer Science & Engineering 7. Advantages of Embedded Operating Systems 1. Cost: 2. Sizes: 3. Effectiveness: PL 4. Real-time operation: D 5. Improved product quality. 6. low power operation 7. Portable due to the small size 56 MIT School of Computing Department of Computer Science & Engineering 7. Disadvantages of Embedded Operating Systems 1. Limited resources: 2. Limited flexibility- Less adaptable 3. The difficulty of programming PL 4. Absence of standardisation: D 5. Hardware dependence: 57 8. Realtime Operating System A Real-Time Operating System (RTOS) is designed to process and respond to a large number of events within strict time constraints, ensuring tasks are executed predictably and within deadlines. It is commonly used in applications like industrial control, telephone switching, flight control, real-time simulations, embedded systems, robotics, automotive systems, and medical devices, where timing and reliability are critical. 8. Realtime Operating System 8. Realtime Operating System 8. Realtime Operating System A Real-Time Operating System (RTOS) is designed to process and respond to a large number of events within strict time constraints, ensuring tasks are executed predictably and within deadlines. It is commonly used in applications like industrial control, telephone switching, flight control, real-time simulations, embedded systems, robotics, automotive systems, and medical devices, where timing and reliability are critical. Key Characteristics of RTOS 1.Deterministic Behavior: 1. Guarantees predictable response times for tasks and interrupts. 2.Task Scheduling: 1. Efficiently schedules tasks based on priority or deadlines. 3.Minimal Latency: 1. Interrupts and task switching occur with very low delay. 4.Reliability: 1. Provides stable and consistent performance over time. 5.Concurrency: 1. Supports multitasking with mechanisms to avoid race conditions and deadlocks. MIT School of Computing Department of Computer Science & Engineering Computer-System Structure PL D Simple Monolithic Layered Microkernel Structure Structure Structure Structure 62 MIT School of Computing Department of Computer Science & Engineering 1. Simple Structure PL D 63 MIT School of Computing Department of Computer Science & Engineering 1. Simple Structure Used very beginning and old Structure Not having well designed structure EX- MS-DOS At Bottom🡪BIOS DD i.e HW DD access🡪hw PLResident system program🡪 DD & HW D At Top Application Pragram🡪 Residencial system program & Access HW. Interface & levels of functionality are not separated. Used 8088🡪 not support dual mode or not having protection to hw. 64 MIT School of Computing Department of Computer Science & Engineering 1. Simple Structure Not well design and structured. At bottom is ROM BIOS device driver is nothing but the Hardware layer. PL At top is application program D is nothing but the user interface. Application program directly access hardware. Ex- MS-DOS 65 MIT School of Computing Department of Computer Science & Engineering Advantages of Simple Structure: 1.Simple to develop 2.Better application performance Disadvantages of Simple Structure: PL D 1.Less Secure 2.Low Degree of Abstraction 3.Not well design and structured. 66 MIT School of Computing Department of Computer Science & Engineering 2. Monolithic Structure PL D 67 MIT School of Computing Department of Computer Science & Engineering 2. Monolithic Structure Followed by Unix OS 1st 🡪User 2nd 🡪 Shell, system call, compiler, interpreter, PL system Library. D 3rd 🡪 System call interface to kernel. 5th 🡪 above HW & below functionality. Everything packed in one level hence called monolithic structure. 5th 🡪 HW 68 MIT School of Computing Department of Computer Science & Engineering 2. Monolithic Structure This operating system works in the kernel space in the monolithic system. The monolithic kernel is quite fast as the services such as memory management, file management, PL process scheduling D etc. A set of primitives or system calls implement all operating system services such as process management, concurrency, and memory management. Example Linux, BSDs, Solaris, DOS, OpenVMS 69 MIT School of Computing Department of Computer Science & Engineering Advantages of Monolithic Kernel Faster execution due to direct access to all the services. Simple and easy to implement PL D structure. Fewer lines of codes need to be written for a monolithic kernel. In memory massively quicker 70 MIT School of Computing Department of Computer Science & Engineering Disadvantages of Monolithic Kernel If one component fails, the entire system crashes Slower development speed – PL D Debugging is complex and difficult It’s difficult to add new functionalities 71 Kernel is a computer program that is a core or heart of an operating system. Kernel Kernel is a computer program that is a core or heart of an operating system. MIT School of Computing Department of Computer Science & Engineering 3. Layered Structure PL D 74 MIT School of Computing Department of Computer Science & Engineering 3. Layered Structure Divide into Nor of layers. i.e layer 0🡪 HW…layer N 🡪 user PL interface. D Broken down functionality into separate layer. Easy to implements and design. Ex- Windows NT OS 75 MIT School of Computing Department of Computer Science & Engineering Layered Structure Layered Structure is a type of system structure in which the different services of the operating system are split into various PL layers. Where each layer has Da specific well-defined task to perform. It was created to improve the pre-existing structures like the Monolithic structure ( UNIX ) and the Simple structure ( MS-DOS ). Example – Windows NT operating system 76 MIT School of Computing Department of Computer Science & Engineering 3. Layered Structure PL D 77 MIT School of Computing Department of Computer Science & Engineering Advantages of Layered Structure Modularity: Easy debugging: Easy update: PL No direct access to hardware: D Well design and define structure 78 MIT School of Computing Department of Computer Science & Engineering Disadvantages of Layered Structure Complex and careful implementation: Slower in execution: PL D Communication:(between adjacent layer) 79 Dual Mode Operations in Operating System The operating system employs dual-mode operations to safeguard itself against unauthorized access. This protection is achieved by categorizing certain system instructions as privileged instructions, which, if misused, could be harmful. These instructions are restricted to execution in kernel mode by the hardware. For instance, the command to switch to user mode is a privileged instruction. Other examples include managing I/O operations, controlling timers, and handling interrupts. To maintain the reliable functioning of the operating system, it is essential to distinguish between machine-level code execution and user-defined code. Most modern computer systems provide hardware support to differentiate between the two execution modes: user mode and kernel mode. When the computer system executes on behalf of a user application, the system is in user mode. However, when a user application requests a service from the operating system via a system call, it must transition from user to kernel mode to fulfill the request. As we can say, this architectural enhancement is useful for many other aspects of system operation. At system boot time, the hardware starts in kernel mode. The operating system is then loaded and starts user applications in user mode. Whenever a trap or interrupt occurs, the hardware switches from user mode to kernel mode, changing the mode bit's state to 0. Thus, whenever the operating system gains control of the computer, it is in kernel mode. The system always switches to user modeby setting the mode bit to 1 before passing control to a user program. MIT School of Computing Department of Computer Science & Engineering 4. Microkernel Structure (Ex- Mac OS X) PL D 83 MIT School of Computing Department of Computer Science & Engineering 4. Microkernel Structure (Ex- Mac OS X) In monolithic kernel all functionalities packed into kernel make structure big. Micro 🡪 Small structure PL D Two separate mode User mode🡪 essential function. Kernel mode 🡪 Non-essential function.(Core functionalities) Main function:- provide communication bet client and services.🡪 Massage passing 84 MIT School of Computing Department of Computer Science & Engineering Advantages of Microkernel Structure It allows the operating system to be portable between platforms. Micro-Kernels are smaller, they can be PL successfully tested.D Failure of one component does not effect the working of micro kernel. It is simple to maintain. Easier to add new functionalities. 85 MIT School of Computing Department of Computer Science & Engineering Disadvantages of Microkernel Structure Complex to design🡪 Modular Structure If Kernel fails then then all system collapse Microkernel system is costly. PL D 86 OS services (system calls, interrupt handling) SYSTEM CALL: A system call is a way for a user program to interface with the operating system. The program requests several services, and the OS responds by invoking a series of system calls to satisfy the request. A system call can be written in assembly language or a high-level language like C or Pascal. System calls are predefined functions that the operating system may directly invoke if a high-level language is used. MIT School of Computing Department of Computer Science & Engineering Types of System Calls 1.Process Control 2.File Management 3.Device Management 4.Information Maintenance 5.Communication PL D 88 Update MIT School of Computing Department of Computer Science & Engineering Process Control Process control is the system call that is used to direct the processes. Some process control examples include creating, load, abort, end, execute, process, terminate the process, etc. File Management File management is a system call that is used to handle the files. Some file management examples include creating files, delete files, open, close, read, write, etc. Device Management PL Device management is a system call that is used to deal with devices. Some examples of device D management include read, device, write, get device attributes, release device, etc. Information Maintenance Information maintenance is a system call that is used to maintain information. There are some examples of information maintenance, including getting system data, set time or date, get time or date, set system data, etc. Communication Communication is a system call that is used for communication. There are some examples of communication, including create, delete communication connections, send, receive messages, etc. 90 Interrupt in OS An interrupt is a signal emitted by hardware or software when a process or an event needs immediate attention. It alerts the processor to a high-priority process requiring interruption of the current working process. In I/O devices, one of the bus control lines is dedicated for this purpose and is called the Interrupt Service Routine (ISR). Interrupts ! How it works ? Interrupt in OS Types file operations, File not found, keyboard process Divide by zero input power failure, control memory error Interrupt in OS Types Interrupts in an operating system are signals sent to the processor to indicate an event that requires immediate attention. They temporarily halt the current process, save its state, and execute a designated Interrupt Service Routine (ISR). Interrupts are classified into the following types: 1. Hardware Interrupts Generated by external hardware devices to signal an event that requires processor attention. Maskable Interrupts: Can be delayed or ignored by setting appropriate flags (e.g., keyboard input). Non-Maskable Interrupts (NMI): Cannot be ignored and are typically used for high-priority tasks (e.g., hardware failures). 2. Software Interrupts Triggered by software using special instructions in the program (e.g., system calls). System Calls: Allow user programs to request services from the operating system. Programmed Interrupts: Generated explicitly by the execution of software instructions. 3. Exceptions Caused by errors or special conditions during program execution. Divide by Zero Exception: Occurs when a program attempts to divide by zero. Invalid Opcode Exception: Triggered by attempting to execute an illegal or unknown instruction. Page Fault Exception: Occurs when a program accesses a memory page that is not currently in RAM. 4. Timer Interrupts Generated by the system's timer hardware to allow the operating system to manage time-critical tasks, such as process scheduling. 5. I/O Interrupts Triggered by input/output devices to signal the completion of an operation or request attention for data transfer. 6. Spurious Interrupts Caused by electrical noise or other anomalies in hardware, typically unintended and not linked to specific devices or tasks. SystemMIT Boot School of Computing BootingDepartment is the process that occurs of Computer when Science & a computer is powered on. Engineering During this process, a mechanism within the system loads the operating system from secondary storage into the main memory (RAM), enabling the computer to become operational. MIT School of Computing Department of Computer Science & Engineering System Boot Types Cold or Hard Booting Cold booting, also known as a hard boot, refers to the process of powering on a computer that is completely switched off. During this procedure, the system performs a full power-on self-test (POST) to initialize hardware devices and loads the operating system from secondary storage into random-access memory (RAM). This ensures a complete system startup from scratch. Soft or Warm Booting Warm booting, also called a soft boot or restart, involves rebooting a computer without fully powering it down. This process is typically initiated through an operating system restart command or a specific key combination. Unlike cold booting, warm booting skips some hardware initialization steps, as the hardware components remain powered and were previously initialized. Both cold and warm booting are essential for computer operation. Cold booting ensures a complete system initialization, while warm booting provides a faster restart option by bypassing the full startup sequence. MIT School of Computing Department of Computer Science & Engineering System Boot What is Power-On Self-Test (POST) Booting? The Power-On Self-Test (POST) is the initial diagnostic process performed during a computer's booting cycle. Each time the system is powered on, POST checks the presence and functionality of critical hardware components, such as the CPU, memory, storage devices, and peripherals. This routine ensures that the hardware is operational and ready for use. If any issues are detected, POST generates error messages or beep codes to indicate the problem. Once POST completes successfully, the system proceeds to load the operating system and necessary software for normal operation. OS Gets Load