os week 1
Overview
Course: COB231 – Operating Systems, Networks, and the Internet 1
Lectures Covered: 1 & 2 – Introduction to Operating Systems and System Calls
Computer System Structure
Components
Users: Include individual people and computer systems that interact with the computer, playing a crucial role in operation and feedback.
Application Programs: Diverse software applications designed for specific tasks, including (but not limited to) spreadsheets, databases, compilers, web browsers, games, and scientific programs, each serving functions that enhance productivity and entertainment.
Operating System: A critical software layer that manages hardware resources and coordinates usage among multiple applications and users, ensuring that various software can run simultaneously and efficiently.
Computer Hardware: Comprises essential components such as CPU (Central Processing Unit), Memory (RAM and permanent storage), and I/O (Input/Output) devices including keyboards, mice, and printers.
What is an Operating System (OS)?
Definition: An operating system is a specialized program that manages computer hardware and provides a software platform for application programs to operate on.
Role: The OS acts as a middle layer between the physical hardware and end-users, facilitating user commands and system operations.
Objectives: It aims to enhance user convenience, optimize resource efficiency, and allow the system to adapt and evolve with new functionalities and updates.
Operating Systems Examples
Closed Source: Proprietary systems like Microsoft™ Windows (various versions), which restrict access to the source code and limit user modifications.
Open Source: Systems like Linux, FreeBSD, and UNIX variants, in addition to mobile platforms such as Android™ and iOS™, which allow users to access, modify, and distribute the source code, promoting collaboration and rapid innovation.
Open Source vs. Closed Source
Open Source: Freely available source code that encourages community development and transparency (example: Linux).
Closed Source: Proprietary binary executables that are typically developed and maintained by companies, limiting user access to the underlying code (example: Windows).
Reverse Engineering: The process of deconstructing software to recover its source code, which is often illegal and raises ethical questions about copyright and intellectual property.
Operating System Objectives
Key Objectives
Convenience: Focused on enhancing the overall user experience through intuitive interfaces and accessibility.
Efficiency: Aims to optimize the use of hardware resources, ensuring that system performance is maximized while minimizing waste.
Evolution: Supports the seamless introduction of new features and updates without disrupting ongoing user activities.
Role of the Operating System
Resource Manager: Efficiently allocates CPU time, memory, file storage, and I/O devices based on current system demands and priorities.
Control Program: Oversees program execution, controlling the sequence of operations, scheduling tasks, and preventing resource conflicts (e.g., preventing two programs from using the same resource at the same time).
Sharing and Protection: Ensures fair access to shared resources while implementing security measures to prevent unauthorized access or misuse.
Processing Schemes
Multiprogramming: Allows several programs to reside in memory, sharing the CPU's time for concurrent execution, improving resource utilization.
Multitasking: Creates the appearance of simultaneous execution by rapidly switching between programs, providing a responsive user experience.
Process Management
Processor Sharing
Fair Share: Ensures equitable distribution of CPU time so that no single program can dominate processing power.
Efficiency: Balances CPU utilization effectively while programs await I/O operations, maintaining system performance.
Interrupts
Definition: Signal sent to the OS to handle important events requiring immediate attention.
Types:
Hardware Interrupts: Triggered by hardware components (e.g., keyboard input, mouse clicks).
Software Interrupts: Generated by executing program instructions that demand OS intervention (e.g., system calls).
Memory Management
Memory Sharing: Implements strategies that allow multiple programs to share main memory while ensuring security and isolation between them.
Memory Protection: Establishes boundaries that prevent one program from interfering with the memory space of another, essential for system stability.
Multi-State Processors
Modes: Distinguishes between User State (limited access) and Kernel Mode (full access) for the OS.
Privileges: User applications have restricted access to system-level instructions, whereas the OS can access all instructions necessary for management and control.
Switching: Mode switching occurs as a response to interrupts or at predefined intervals, essential for maintaining system control and efficiency.
System Calls
Definition: Mechanisms that allow user programs to request specific services from the OS, enabling effective interaction.
Necessity: Ensures protection by restricting user programs from accessing critical system resources directly, averting potential risks.
API (Application Programming Interface): Simplifies and standardizes the methods by which external programs interact with the OS, enabling developers to implement complex tasks without deep system knowledge.
Summary
Operating System Functions: Focus on resource management, data protection, and enabling user-level sharing of resources.
Objectives: Aim for efficient management, user convenience, and system extensibility.
Multiprogramming: Involves sharing the processor among multiple programs via efficient switching, maintaining operational fluidity.
User State vs. Special State: Differentiates between limited user access and full access for the OS to ensure system integrity.
Key Concepts: Includes mechanisms like interrupts that signal the OS to respond to events and manage user demands effectively.