Operating Systems - PDF
Document Details
Uploaded by Deleted User
Tags
Summary
This document introduces the concept of operating systems. It describes the fundamental components and functions of an OS, including hardware, software, and the relationship between them. Different analogies like a phone manual and a flight manual help explain the OS interaction with the hardware, as well as the operating system's role as an intermediary.
Full Transcript
Created by Turbolearn AI Operating Systems What is an Operating System? An operating system (OS) is a piece of software that manages computer hardware and software resources and provides common services for computer programs. It is the fundamental software that allows you to int...
Created by Turbolearn AI Operating Systems What is an Operating System? An operating system (OS) is a piece of software that manages computer hardware and software resources and provides common services for computer programs. It is the fundamental software that allows you to interact with your computer. Hardware: The physical components of a computer (CPU, memory, input/output devices). Software: The programs and data that run on a computer. This includes both application software (like word processors and games) and system software (like the operating system). System Software: Essentially the operating system. It acts as an intermediary between the application software and the hardware. The Relationship Between Hardware, Software, and the OS The computer system can be visualized as follows: Level Component Description Application Programs designed for specific user tasks (e.g., word Top Software processors, web browsers) System Software Manages computer resources, provides services to Middle (OS) application software Computer The physical components of the computer (CPU, Bottom Hardware memory, input/output devices) How the OS Works The OS is like an instruction manual for the computer. The CPU (Central Processing Unit, considered the "little man" in the computer), reads the instructions in the OS file to know how to control the computer hardware. Page 1 Created by Turbolearn AI The CPU fetches instructions, decodes them, executes them, and stores the results. The OS provides instructions on how to manage hardware components, ensuring they work together seamlessly. The OS acts as an intermediary between application software and the hardware, enabling applications to run. Analogies for Understanding the OS Analogy 1: Mobile Phone and User Manual A phone's user manual explains how to use its features. The operating system is like that manual for the computer. It tells the CPU how to operate the hardware. Analogy 2: Human Body and Brain Your brain (CPU) controls your body's actions. When you decide to do something (e.g., stand up), your brain sends signals to your muscles to execute the action. Similarly, the CPU, using instructions from the OS, controls the computer hardware to perform actions. Analogy 3: Airplane Pilot and Flight Manual A pilot uses a flight manual (like the OS) to learn how to control the airplane (computer). The manual contains instructions on how to operate all aspects of the plane; the OS provides similar instructions for the computer. Operating System Analogy: The Flight Schedule The relationship between a pilot, a flight schedule, and an operating system manual is analogous to how application software interacts with the operating system. Page 2 Created by Turbolearn AI Flight Schedule: Similar to application software; it dictates what actions should be performed at specific times. Operating System Manual: Contains the instructions (code) needed to perform actions. Pilot (Actor/Controller): The CPU; it executes the instructions from the operating system. An "actor" is defined as someone who causes actions to happen. The Operating System: A Collection of Files The operating system is not a single file, but a collection of hundreds of thousands of files, each representing a program or subprogram. These files can be categorized into three groups: Memory Resident Part (Kernel) This is the core of the operating system, always loaded into memory. It contains essential and fundamental functions that run every time the computer is turned on. Think of it as information you always remember, like your name and where you live. Always loaded upon startup. Essential functions include activating the screen, registering keyboard/mouse input, and establishing internet connection. Memory Non-Resident Part (Utility Programs) These are programs loaded only when needed. They enhance the computer's operation but aren't essential for basic functionality. Think of them as optional car features, like air conditioning or an entertainment system. Loaded on a need-to-use basis. Examples: antivirus software, VPN software, disk defragmenter, file checkers. Improve the overall user experience and stability. Bootstrap Program (IPL) This program is responsible for loading the operating system at startup. It checks hardware, configurations, and then loads the kernel. It’s the initial program load (IPL). Page 3 Created by Turbolearn AI First program to run when the computer is turned on. Checks computer hardware and configurations. Loads the operating system's kernel. The Operating System: A Deep Dive Fundamental Functions and Categorization of OS Files The operating system (OS) is a collection of files—hundreds of thousands in some cases—categorized into three groups: Memory Resident: Contains the most essential functions. Memory Non-Resident: Includes utility programs that enhance efficiency and functionality. Bootstrap Program: Loads the OS when the computer starts. The OS-User-Computer Relationship The relationship between the user, the computer, and the operating system can be understood through an analogy: The user is like a customer at a restaurant. The computer is the restaurant itself, with the CPU as the chef. The operating system is the chef's recipe book, detailing every action the restaurant (computer) can perform. The CPU reads the instructions (OS files) and directs the various components of the computer hardware to perform actions. The user interacts with the computer through a user interface (UI), which acts like a menu. Just as a customer can only order items from a menu, a user can only ask the computer to perform actions permitted by the OS. User Interface (UI) vs. Application Programming Interface (API) Page 4 Created by Turbolearn AI User Interface (UI): A mechanism by which a user communicates with a system (e.g., the menu at a restaurant, the buttons and options in a software application). Application Programming Interface (API): A menu of functions that the operating system provides to application programs. Application programs use APIs to request actions from the operating system. Think of an application program like a health inspector—a specialized type of user with specific privileges and tasks. The health inspector's interaction with the restaurant (computer) differs from a regular customer's, mirroring how application programs interact with the OS through APIs. Application Programs and Their Interfaces Application programs need to communicate with the operating system using an Application Programming Interface (API). The API acts like a menu for the application, limiting the requests it can make to the OS. The UI of an application (e.g., the drawing tools in OneNote) allows the user to give instructions to the application. The application, in turn, uses the API to relay these instructions to the operating system, which then executes them. Functions of a Typical Operating System (Further details on the functions of a typical operating system were to follow in the lecture but were cut off from this segment of the transcript.) Operating Systems Lecture Notes What is an Operating System? An operating system (OS) is a set of files containing instructions that control and coordinate all computer activities. The CPU reads these instructions to perform actions. Page 5 Created by Turbolearn AI Three Fundamental Functions of an OS All operating systems, regardless of complexity, perform these three core functions: 1. Accepting Commands: The OS provides a way for users and programs to input commands. This is facilitated by a user interface (UI) or application program interface (API). A menu is one example of a UI. A menu is a list of instructions or options presented to the user. It's a type of user interface, but not all user interfaces are menus. 2. Controlling Hardware: The OS controls all hardware connected to the computer, including input devices and the processor. The CPU executes OS instructions to manage hardware functions. The OS instructions are read by the CPU, which then uses them to control and coordinate the computer's hardware. The CPU is the actor, following instructions from the OS. 3. Controlling Software: All installed software runs on top of the OS. This is why software is called "application" software; it's "applied" on top of the OS. Application software requires an underlying OS to function. The metaphor of applying hair cream to hair illustrates this point: you need hair (the OS) before you can apply cream (application software). Application Software and the Operating System Application software is a set of instructions applied on top of the operating system. It cannot function without an OS. The CPU's Role The CPU performs four fundamental functions: fetch, decode, execute, and store. It fetches operating system instructions, which dictate its actions, similar to a waiter following a restaurant's schedule. Page 6 Created by Turbolearn AI Device Drivers A device driver is a piece of software that tells the OS how to interact with a specific device. While not part of the OS itself, it's considered system software. It's like a translator between the OS and the device; the device's operating system, allowing the computer to control it. System Software vs. Application Software Category Description Example System Operating system, Controls hardware Software device drivers Application Software designed for specific tasks, Word processors, Software running on top of the operating system. games, web browsers Memory Resident vs. Memory Non-Resident Software This categorization applies to system software, not application software. Application software is its own category. Some application software may function as utilities (e.g., antivirus software), working within the OS. Device Drivers A device driver is not part of an operating system; it's a separate entity used by the OS or computer to control connected devices. OS vs. Application Interaction Page 7 Created by Turbolearn AI Operating System (OS): The foundational software that manages computer hardware and software resources. The user interacts directly with the OS through its user interface (UI). Example: macOS. Application Software: Programs built on top of the OS that provide specific functionalities to the user. Example: Weather app. Application software interacts with the OS to perform tasks like connecting to the internet, performing calculations, and displaying information on the screen. It passes requests to the OS, which then executes them. Application Software's Dependence on the OS Application software relies on the OS to: Access hardware resources (e.g., CPU, memory, storage). Communicate with other software components. Manage input/output operations. The OS acts as an intermediary between the application and the hardware. Think of it like this: the application tells the OS what it needs, and the OS does the work of interacting with the hardware to fulfill that request. The OS then presents the results back to the application, which displays the information to the user. OS Loading Process When a computer starts up: 1. The bootstrap program (part of the OS) performs a power-on self-test (POST). 2. The OS is loaded from storage (hard drive, SSD) into RAM (Random Access Memory). 3. The kernel (core of the OS) becomes memory-resident, meaning it remains in RAM and is always active. The kernel is the fundamental part of the OS responsible for managing all computer resources. If the kernel is removed, the computer won't function. CPU's Role in OS and Application Execution The CPU (Central Processing Unit) executes both OS and application software instructions. Page 8 Created by Turbolearn AI Analogy: The brain (CPU) manages both automatic functions (OS - like heartbeat) and conscious actions (application software - like moving). Both work together. RAM and Faulty Chips If a computer has multiple RAM chips and one is faulty: The computer might ignore the faulty chip and use the others. Or, depending on how the chips are connected, the entire system might fail. Utility Programs Utility programs are tools that help manage and monitor computer resources. Examples include: Activity Monitor: Tracks CPU usage, memory usage, disk space usage, network activity, and energy consumption. Disk Utility: Manages hard drives, partitions, and free space. Many utility programs run in the background, unseen by the user. They support essential OS functions and improve user experience. The Operating System: A Deep Dive What is an Operating System? The operating system (OS) is the core of your computer. It's not just one program, but a collection of programs that act as an intermediary between you, the user, and the computer's hardware. Think of it as the manager of your computer, handling all the behind-the-scenes tasks that allow you to use applications and interact with your computer. It's stored on your storage device (hard drive, SSD, etc.), separate from the utility programs and applications you use. Definition: A set of files that controls and coordinates all the activities of a computer, aiming to increase user productivity. How the OS Works Page 9 Created by Turbolearn AI The CPU (Central Processing Unit), the computer's brain, executes instructions. These instructions originate from the OS and the applications you run. The OS provides the instructions that dictate how the CPU should behave. To illustrate: Imagine the CPU as a human worker. The OS is their work schedule, containing tasks, times, and methods. The work schedule includes tasks like: "Check user requests", "Open application X", "Manage hardware resources". The CPU follows this schedule, executing the instructions. If the user wants to open a program, the OS dictates the steps: load the program into memory, activate the necessary devices, and respond to user interactions. Every action, from launching an application to saving a file, requires the OS to instruct the CPU on what to do. If a user tries an action, the CPU checks with the OS to see if it’s permitted. If yes, the OS provides the steps needed. What You Can't Do Without an OS The lecture highlighted several critical functions impossible without an operating system: Loading program instructions into memory manually. Having a user interface other than rudimentary input/output routines in each program. Without an OS, each program would need to handle its own I/O. The system would remain idle while waiting for user input. Managing and manipulating files would not be possible. There would be no control over peripheral devices. Only one program could run at a time. OS Services The primary functions of an operating system include: Command Interface: Passing commands to the computer and programs. This includes installing, managing, loading and executing programs. Software Management: Control over all software on the system. Hardware Management: Management of all hardware resources, including networks and external devices. Page 10 Created by Turbolearn AI Concurrent Operations Concurrent operations allow a computer to run multiple tasks seemingly simultaneously, boosting efficiency. Multitasking: Running multiple programs concurrently (even on a single processor core). Multiprocessing: Running multiple programs concurrently on multiple processor cores. Definition of Task: A running program. The Relationship Between User, OS, and Application The lecture included a diagram representing the interactions: Element Interaction Interacts with the computer through the operating system's user User interface Operating Manages hardware, software, and provides interfaces for the user System and application Application Communicates with the OS (via API) to access computer resources. Multitasking vs. Multiprocessing Multitasking is having multiple programs open simultaneously. This doesn't mean they all run at once; only the active program fully utilizes resources. Others are idle, consuming minimal resources (e.g., memory). Switching between programs is easy. It is also called multiprogramming. Multitasking: More than one program open at a time. Multiprocessing, however, requires two or more processors to execute multiple instructions concurrently. Think of a restaurant: one waiter handles one task at a time, while multiple waiters handle more tasks in parallel. Multiple processors share the workload, leading to faster execution. Multiprocessing: More than one instruction running simultaneously (requires multiple processors). Page 11 Created by Turbolearn AI Operating System Services The operating system provides various services: File Management: Accessing and managing files (demonstrated using the example of opening a file in PowerPoint). Input/Output (I/O) Support: Handling interactions with peripherals (keyboard, mouse) and displaying output on the screen (demonstrated using right-click functionality in PowerPoint). Core Services: Memory and CPU management. Operating System Architecture The operating system sits between the hardware (computer and network hardware – noted that network hardware is not essential for a computer to function) and applications. Key components include: Command Interface: The user interface. File Services: Allows applications to access files. Core Services: Memory and CPU management. Input/Output (I/O) Services: Manages input and output operations. The operating system interacts with applications through its services (e.g., PowerPoint uses OS file services to access files). Categorizing Computing Systems Computing systems can be categorized based on their capabilities: Page 12 Created by Turbolearn AI Category Description Example Single User, One user, one task at a time. Mostly obsolete Older, less powerful Single Tasking due to advancements in technology. devices Single User, One user, multiple tasks concurrently (e.g., Smartphones Multitasking multiple apps open simultaneously). Multiple users can access the system Laptops, Desktops, Multi-User simultaneously, each with their own profile Tablets (e.g., laptops, desktops). Servers in large Powerful servers handling large data Mainframes corporations and processing for organizations. universities Controls and manages multiple computers Network connected on a network, simplifying University network, Servers maintenance and updates (e.g., university corporate network network). Distributed Multiple devices spread geographically, Google search, Systems functioning as a single unit. McDonald's franchise Real-Time Functionality depends on time; time-sensitive Banking applications Systems operations. Embedded Simple operating systems integrated into Smart microwaves, Systems small devices. smart fridges Degrees of Activities of an Operating System The degrees of activities of an operating system refer to how actions are performed or the nature of those actions. There are several types: Interactive Activities Interactive activities are like having a conversation with your computer. You input a command, and the system responds, often with further prompts or options. Examples include deleting a file (confirmation prompts) or right-clicking to access context menus. Batch Processing Page 13 Created by Turbolearn AI Batch processing involves performing many tasks at once. An example is renaming multiple files simultaneously using a batch operation application. The lecture provides an example where files named "0- introduction.txt", "1-introduction.txt", etc., were renamed to remove the initial numbering. Event-Driven Operations Event-driven operations are triggered by specific events such as mouse clicks, keyboard presses, or other inputs. The lecture uses the example of increasing/decreasing font size by clicking buttons, or using keyboard shortcuts (like 'B' to black out a screen and 'W' to white out a screen) as examples of event-driven interactions. Operating System and Hardware Relationship Some operating systems are hardware-dependent, meaning they only work with specific hardware architectures (e.g., macOS on Apple hardware, Windows on Intel- based PCs). Others, such as Linux, are more hardware-independent and can run on a wider range of systems (including game consoles like PlayStations and Nintendos, and mobile operating systems like Android). Operating System Services The following services were mentioned, each to be covered in later lectures: Process Control: Managing processes within the operating system. Memory Management: How the OS manages computer memory. Scheduling: Creating a list of tasks for the computer to perform (e.g., when a computer starts up). Secondary Storage Management: Managing data storage on hard drives and other non-volatile media. File Systems: Managing files and directories. User Interfaces A future lecture will cover various types of user interfaces, their advantages, and disadvantages. Page 14 Created by Turbolearn AI File Utilities A future lecture will cover how file utilities work and how to execute file commands. CPU Utilization and Time Sharing The lecture illustrated how the CPU can be utilized more efficiently through time- sharing. When a program is idle (e.g., waiting for user input), the CPU can switch to other tasks, improving overall system performance. An example given was a paused PowerPoint presentation; while the lecturer is not actively using the program, the operating system can perform background tasks. This is to prevent the CPU from being idle during these periods. This improves efficiency by reducing wasted CPU time. This example demonstrates how the OS manages multitasking. Network and Communication Services Network and communication aspects of operating systems will be covered in a separate module, "Introduction to Networking." Administrative Services Operating systems provide administrative services, allowing users to manage tasks like creating/deleting users, setting privileges, and performing file management and access control. Operating System Configurations Administrative Services Managing files and software. Assigning privileges. Various administrative tools will be demonstrated later. Operating System Configurations Configuration: Arrangement of components within an operating system. Three main types of configurations exist: Page 15 Created by Turbolearn AI Monolithic: Kernel at the center. Shell interfaces utilities with the kernel. Example: Linux. Stable, but a kernel failure causes system failure. Hierarchical: Components stacked upon each other (e.g., user interface dependent on command utilities, which depend on file services, and so on). Example: Windows. Efficient, but failure of one component can cause cascading failures. This is why Windows historically crashed frequently (blue screen of death). Microkernel: Smaller kernel; essential functions are modules loaded as needed. Example: macOS. Memory-efficient; improved resource management; failures less catastrophic than monolithic. Apple devices' lower RAM is due to the microkernel architecture, allowing for efficient resource use and less likelihood of memory bottlenecks compared to systems using monolithic kernels. Recent increases in RAM in Apple devices are due to the addition of AI (neural processing) components that require additional memory. Comparison Table Architecture Example Advantages Disadvantages Monolithic Linux Stable System failure if kernel fails Cascading failures if a Hierarchical Windows Efficient component fails Memory-efficient, modular, Potentially less efficient than Microkernel macOS less catastrophic failures other architectures Upcoming Test & Attendance Page 16 Created by Turbolearn AI Test 1: Date and time to be announced via Teams. Be prepared for the test as early as next Monday. Attendance: Two opportunities to sign in (first 5 minutes and last few minutes of class). Missing both results in an absence; emails regarding missed attendance will be ignored, except for last week's attendance, which will be corrected. Page 17