Full Transcript

Operating System By Mr. Nitin Y. Suryawanshi Unit-1 What is operating system ? Overview objectives and functions of OS Types of operating system, The evolution of operating system, Operating system structure OS operations...

Operating System By Mr. Nitin Y. Suryawanshi Unit-1 What is operating system ? Overview objectives and functions of OS Types of operating system, The evolution of operating system, Operating system structure OS operations – System services, – Systems calls, – System programs, – System structure, – System boot, Virtual machines system design and implementation. Mr. Nitin Y. Suryawanshi What is Operating System ? Operating System can be defined as an interface between user and the hardware. It provides an environment to the user so that, the user can perform its task in convenient and efficient way. It is responsible for the execution of all the processes, Resource Allocation, CPU management, File Management and many other tasks. Mr. Nitin Y. Suryawanshi Objectives of Operating Systems An operating system (OS) plays a crucial role in managing computer resources and ensuring efficient interaction between software and hardware. Let’s delve into the key objectives of an operating system: Efficiency: – The operating system enhances production efficiency by handling system tasks such as resource allocation and conflict resolution between different programs and users. – By streamlining these processes, it saves user time and results in more efficient overall performance. Hardware Abstraction: – The OS conceals intricate hardware details from users. It acts as an intermediary, allowing users to fully utilize computer hardware without dealing with complexities. – Through effective communication between user programs and hardware, the OS simplifies interactions. Convenience: – Without an operating system, users would have to directly manage hardware, making computer usage inconvenient. – Operating systems provide pre-configured utility packages, allowing users to focus on tasks without the burden of system setup. operating systems make computers user-friendly, abstract hardware complexities, and optimize resource utilization. They serve as the bridge between users and the underlying hardware, facilitating seamless interactions and efficient computing Mr. Nitin Y. Suryawanshi Functions of OS An operating system (OS) serves as a critical bridge between users and computer hardware. It manages resources, facilitates efficient execution of programs, and ensures smooth interactions. Let’s explore the key functions of an operating system : Memory Management: Process Management:  The OS handles primary memory (main memory) management.  Creates, schedules, and terminates processes.  It allocates and deallocates memory for processes.  Manages process synchronization and communication.  Keeps track of memory usage by different programs.  Ensures efficient use of CPU and memory.  Distributes memory efficiently during multiprocessing. Processor Management (CPU Scheduling): Security and Access Control:  Manages the execution of processes on the CPU.  Selects which process gets CPU time and when.  Protects system resources from unauthorized access.  Enforces user authentication and authorization.  Algorithms like First Come First Serve (FCFS), Shortest Job  Implements access control lists (ACLs) and permissions. First (SJF), and Round-Robin Scheduling are used.  Ensures proper utilization of the CPU. Error Handling and Recovery: Device Management:  Controls input and output devices (e.g., keyboard, mouse,  Detects and handles errors (e.g., hardware failures, software crashes). printer).  Provides mechanisms for system recovery.  Logs error messages for troubleshooting.  Handles device requests from processes.  Ensures fair access to devices.  Manages device drivers and interrupts x Mr. Nitin Y. Suryawanshi Types of Operating system Mr. Nitin Y. Suryawanshi Types of Operating system Batch Operating System: Time-Sharing Operating System: Jobs with similar needs are grouped for processing. Allocates CPU time to multiple users interactively. No direct interaction with the computer by the user. Users can access the system through terminals. Examples include payroll systems and bank statement processing. Distributed Operating System: Connects multiple autonomous computers through a network. Multi-Programming Operating System: Shares computational tasks among several machines. Multiple programs are kept in memory simultaneously. Increases system throughput and reduces response time. Network Operating System: Runs on a server and manages network resources. Multi-Processing Operating System: Provides services to computers connected to a network. Utilizes more than one CPU for executing processes. Enhances system throughput and provides fault tolerance. Real-Time Operating System: Designed to process data as it comes in, typically in real-time. Multi-Tasking Operating System: Used in environments that require immediate processing. Executes multiple tasks or processes simultaneously. Switches rapidly between tasks to give the appearance of Each type of operating system is designed to cater to specific concurrency. requirements, ensuring that computing resources are used efficiently and effectively. Mr. Nitin Y. Suryawanshi The Evolution of Operating System First Generation (1945-1955) It is the beginning of the development of electronic computing systems which are substitutes for mechanical computing systems. Because of the drawbacks in mechanical computing systems like, the speed of humans to calculate is limited and humans can easily make mistakes. In this generation there is no operating system, so the computer system is given instructions which must be done directly. Example − Devices used is Plug Boards. Mr. Nitin Y. Suryawanshi Mr. Nitin Y. Suryawanshi The Evolution of Operating System Second Generation (1955-1965) The Batch processing system was introduced in the second generation, where a job or a task that can be done in a series, and then executed sequentially. In this generation, the computer system is not equipped with an operating system, but several operating system functions exist like FMS and IBSYS. FMS (Field Management Service) FMS was an early operating system developed by IBM in the 1960s for their 709 and 7090 series of mainframe computers. IBSYS was a more advanced operating system compared to FMS and was intended to improve the efficiency of the IBM 7090 and 7094 computers. Mr. Nitin Y. Suryawanshi The Evolution of Operating System Third Generation (1965-1980) The development of the operating system was developed to serve multiple users at once in the third generation. Here the interactive users can communicate through an online terminal to a computer, so the operating system becomes multi-user and multiprogramming. Example − Devices used is Multiprogramming. Mr. Nitin Y. Suryawanshi List of operating systems from the third generation of computers (1965- 1980): IBM System/360 and OS/360 – IBM System/360 – OS/360 MULTICS (Multiplexed Information and Computing Service) UNIX CP/CMS (Control Program/Cambridge Monitor System) TOPS-10 and TOPS-20 RT-11 RSX-11 MVS (Multiple Virtual Storage) Mr. Nitin Y. Suryawanshi The Evolution of Operating System Fourth Generation (1980-Now) In this generation the operating system is used for computer networks where users are aware of the existence of computers that are connected to one another. At this generation users are also comforted with a Graphical User Interface (GUI), which is an extremely comfortable graphical computer interface, and the era of distributed computing has also begun. With the occurrence of new wearable devices like Smart Watches, Smart Glasses, dnd others, the demand for conventional operating systems has also increased. Mr. Nitin Y. Suryawanshi List of the most influential and widely-used operating systems from the fourth generation (1980 to present): Personal Computer Operating Systems: Embedded Operating Systems MS-DOS VxWorks Windows (notable versions include Windows 95, Windows XP, QNX Windows 7, Windows 10) Mac OS (notable versions include System 1, Mac OS 9, macOS X, Real-Time Operating Systems (RTOS) macOS Big Sur) RTLinux Linux (notable distributions include Debian, Red Hat, Ubuntu, FreeRTOS Fedora) Networking and Internet Operating Systems Server and Enterprise Operating Systems Cisco IOS Windows Server (notable versions include Windows Juniper Junos Server 2003, Windows Server 2008, Windows Server Cloud and Virtualization Operating 2012, Windows Server 2019) Systems Linux (notable distributions include Red Hat Enterprise VMware ESXi Linux, SUSE Linux Enterprise Server, Ubuntu Server) Microsoft Hyper-V UNIX (notable versions include AIX, HP-UX, Solaris) Kubernetes Mobile Operating Systems: iOS Android Mr. Nitin Y. Suryawanshi Operating System Structure A design known as an operating system enables user application programs to communicate with the hardware of the machine. Given its complex design, ease of use, and modification, the operating system should be constructed with utmost care. A straightforward way to achieve this is to develop an operating system. Each part must contain unique inputs, outputs, and functionalities. Simple/Monolithic Structure Micro-Kernel Structure Hybrid-Kernel Structure Exo-Kernel Structure Layered Structure Modular Structure Virtual Machines Mr. Nitin Y. Suryawanshi Simple/Monolithic structure Such operating systems do not have well-defined structures and are small, simple, and limited. The interfaces and levels of functionality are not well separated. MS-DOS is an example of such an operating system. In MS-DOS, application programs are able to access the basic I/O routines. These types of operating systems cause the entire system to crash if one of the user programs fails. Advantages of Simple/Monolithic Structure: It delivers better application performance because of the few interfaces between the application program and the hardware. It is easy for kernel developers to develop such an operating system. Disadvantages of Simple/Monolithic Structure: The structure is very complicated, as no clear boundaries exist between modules. It does not enforce data hiding in the operating system. Mr. Nitin Y. Suryawanshi Mr. Nitin Y. Suryawanshi Micro-kernel Structure This structure designs the operating system by removing all non-essential components from the kernel and implementing them as system and user programs. This results in a smaller kernel called the micro-kernel. Advantages of this structure are that all new services need to be added to user space and does not require the kernel to be modified. Thus it is more secure and reliable as if a service fails, then rest of the operating system remains untouched. Mac OS is an example of this type of OS. Advantages of Micro-kernel Structure: It makes the operating system portable to various platforms. As microkernels are small so these can be tested effectively. Disadvantages of Micro-kernel Structure: Increased level of inter module communication degrades system performance. Mr. Nitin Y. Suryawanshi Hybrid-Kernel Structure Hybrid-kernel structure is nothing but just a combination of both monolithic-kernel structure and micro- kernel structure. Basically, it combines properties of both monolithic and micro-kernel and make a more advance and helpful approach. It implement speed and design of monolithic and modularity and stability of micro-kernel structure. Advantages of Hybrid-Kernel Structure:  It offers good performance as it implements the advantages of both structure in it.  It supports a wide range of hardware and applications.  It provides better isolation and security by implementing micro-kernel approach.  It enhances overall system reliability by separating critical functions into micro-kernel for debugging and maintenance. Disadvantages of Hybrid-Kernel Structure:  It increases overall complexity of system by implementing both structure (monolithic and micro) and making the system difficult to understand.  The layer of communication between micro-kernel and other component increases time complexity and decreases performance compared to monolithic kernel. Mr. Nitin Y. Suryawanshi Mr. Nitin Y. Suryawanshi Exo-Kernel Structure Exokernel is an operating system developed at MIT to provide application-level management of hardware resources. By separating resource management from protection, the exokernel architecture aims to enable application-specific customization. Due to its limited operability, exokernel size typically tends to be minimal. The OS will always have an impact on the functionality, performance, and scope of the apps that are developed on it because it sits in between the software and the hardware. The exokernel operating system makes an attempt to address this problem by rejecting the notion that an operating system must provide abstractions upon which to base applications. The objective is to limit developers use of abstractions as little as possible while still giving them freedom. Advantages of Exo-kernel: Support for improved application control. Separates management from security. It improves the performance of the application. A more efficient use of hardware resources is made possible by accurate resource allocation and revocation. It is simpler to test and create new operating systems. Each user-space program is allowed to use a custom memory management system. Disadvantages of Exo-kernel: A decline in consistency. Exokernel interfaces have a complex architecture. Mr. Nitin Y. Suryawanshi Exo-Kernel Structure Mr. Nitin Y. Suryawanshi Layered structure The layered structure of an operating system divides its services into distinct layers, each with a specific well-defined task. Here are the key points about this design: Layer Hierarchy: The operating system is separated into several layers, typically numbered from 0 to n. The outermost layer is the User Interface layer, while the innermost layer is the Hardware layer. Each layer performs specific functions and interacts with the layers below it. Advantages: Modularity: Each layer focuses on its designated tasks, promoting modularity. Easy Debugging: Discrete layers make debugging simpler. Easy Updates: Modifications in one layer don’t affect others. Abstraction: Each layer is concerned only with its functions. Disadvantages: Complex Implementation: Layer arrangement must be carefully planned. Slower Execution: Inter-layer communication increases response time. Mr. Nitin Y. Suryawanshi Modular Structure  It is considered as the best approach for an OS.  It involves designing of a modular kernel.  The kernel has only a set of core components and other services are added as dynamically loadable modules to the kernel either during runtime or boot time.  It resembles layered structure due to the fact that each kernel has defined and protected interfaces, but it is more flexible than a layered structure as a module can call any other module. For example Solaris OS is organized as shown in the figure. Mr. Nitin Y. Suryawanshi VMs (virtual machines) Based on our needs, a virtual machine abstracts the hardware of our personal computer, including the CPU, disc drives, RAM, and NIC (Network Interface Card), into a variety of different execution contexts, giving us the impression that each execution environment is a different computer. An illustration of it is a virtual box. An operating system enables us to run multiple processes concurrently while making it appear as though each one is using a different processor and virtual memory by using CPU scheduling and virtual memory techniques. The fundamental issue with the virtual machine technique is disc systems. Let’s say the physical machine only has three disc drives, but it needs to host seven virtual machines. The program that creates virtual machines would need a significant amount of disc space in order to provide virtual memory and spooling, so it should be clear that it is impossible to assign a disc drive to every virtual machine. The answer is to make virtual discs available. Mr. Nitin Y. Suryawanshi Operating System Operations System Services Systems Calls System Programs System structure System Boot Mr. Nitin Y. Suryawanshi System Services System services, also known as system daemons, are Examples: background processes that run continuously to init/systemd: Manages system startup and provide core functionalities for the operating services. system. They manage hardware, execute cron: Schedules tasks to run at specified applications, and provide networking services, times. ensuring the smooth operation and maintenance of sshd: Manages secure shell (SSH) the system. connections.  System services ensure that critical functionalities of the operating system are available and managed efficiently.  They start automatically when the system boots and run continuously to provide the necessary background support.  Proper management and configuration of these services are crucial for the security, performance, and reliability of the system.  For instance, ensuring that SSHD ( Solid State Hybrid Driver) is correctly configured can prevent unauthorized access, while a properly scheduled cron job can automate essential maintenance tasks. Mr. Nitin Y. Suryawanshi Systems Calls System calls are the interface between user Common system calls include: open: Opens a file. programs and the operating system. They read: Reads data from a file. allow user-level processes to request services write: Writes data to a file. from the kernel, such as file operations, fork: Creates a new process. process control, and communication. exec: Replaces the current process image with a new one. wait: Waits for a process to change state. exit: Terminates a process. Importance of System Calls :  Provide a safe and controlled way for programs to interact with the system's hardware and resources.  Abstract the complexity of hardware operations, offering a simple API for developers.  Enable multitasking by allowing process creation, management, and communication.  Ensure security and stability by restricting direct access to hardware, preventing user programs from interfering with each other or the system. Mr. Nitin Y. Suryawanshi System programs System programs provide a convenient Examples: environment for program development and Compilers: Convert source code into executable execution. They perform various tasks related code. to system management and operation, often Shells: Command interpreters like Bash or Zsh. File utilities: Tools like cp, mv, ls. acting as an intermediary between the user Text editors: Programs like vim, nano. and the system calls. Importance of System Program :  Simplify System Management: Provide tools for managing files, processes, and system resources.  Enhance User Interaction: Offer interfaces for users to interact with the system efficiently.  Support Development: Facilitate software development with compilers, debuggers, and build tools.  Enable Automation: Allow automation of repetitive tasks through scripting and scheduling utilities.  Improve Security and Communication: Provide secure methods for remote communication and data transfer. Mr. Nitin Y. Suryawanshi System Boot The system boot process initializes the system and loads the operating system. This sequence of steps ensures that the hardware is correctly configured, and the operating system is ready to use. Here are the key steps involved:  Power-on Self-Test (POST): Hardware check by BIOS (Basic Input / Output System) /UEFI (Unified Extensible Firmware Interface).  Hardware Initialization: Initializing system hardware.  Locate Boot loader: BIOS/UEFI (Basic Input /Output System OR Unified Extensible Firmware Interface) locates and runs the boot loader.  Load Kernel: Boot loader loads the operating system kernel.  Hardware Setup by Kernel: Kernel sets up CPU, memory, and devices.  Mount Root File system: Kernel mounts the root file system.  Start Init / Systemd: Kernel starts the init process or system.  Execute Startup Scripts: Init /systemd executes scripts to start services. Mr. Nitin Y. Suryawanshi

Use Quizgecko on...
Browser
Browser