Session 1.1: Operating System Fundamentals
Understanding what operating systems do and computer system organization
Learning Objectives
By the end of this session, you will be able to:
- Define what operating systems do
- Explain operating system operations
- Understand computer system organization
- Identify system views (User vs System)
Key Concept
An operating system acts as an intermediary between the computer user and the computer hardware, managing resources and providing an environment for application programs to run.
What Operating Systems Do
An operating system (OS) is software that manages a computer's hardware and provides an environment for application programs to run. It acts as an intermediary between the computer user and the computer hardware.
Fundamental Goal
The fundamental goal of computer systems is to execute programs and make solving user problems easier. The OS provides the means for proper use of hardware, software, and data resources.
Core Purpose and Views
User View
From a user's perspective, the OS is designed primarily for ease of use, with attention to:
- Performance optimization
- Security measures
- Maximizing user productivity
For single-user systems like laptops, the goal is to maximize work or play. Embedded systems may have minimal user interfaces.
System View
From the computer's perspective, the OS functions as:
- Resource Allocator: Managing CPU time, memory, storage, I/O devices
- Control Program: Managing program execution, preventing errors
Particular concern for I/O devices and ensuring efficient, fair resource allocation.
Key Services Provided by Operating Systems
Program Execution
Load programs into memory, run them, handle normal or abnormal termination.
I/O Operations
Provide mechanisms for performing input/output operations with files and devices.
File-System Manipulation
Read, write, create, delete files and directories. Manage permissions and searching.
Resource Allocation
Allocate CPU cycles, memory, and storage when multiple processes run concurrently.
Accounting
Track resource usage for billing, monitoring, and usage statistics.
Protection and Security
Control access to resources, protect processes, defend against attacks.
Error Detection
Monitor for errors in CPU, memory, I/O devices, and user programs.
User Interface
Provide GUI, CLI, or touch-screen interfaces for user interaction.
Process Management
Create, delete, schedule, suspend, and resume processes. Handle synchronization.
Memory Management
Track memory usage, allocate/deallocate space, manage data movement.
Mass-Storage Management
Manage secondary storage: mounting, free-space management, allocation, scheduling.
Virtualization
Abstract hardware into multiple execution environments.
Underlying Mechanisms and Concepts
Multiprogramming and Multitasking
Keep several processes in memory simultaneously. When one waits for I/O, switch to another process to keep CPU busy.
Dual-Mode Operation
User Mode: For user applications
Kernel Mode: For OS code with privileged instructions
Timers
Ensure OS maintains control over CPU, preventing infinite loops or programs monopolizing resources.
System Calls
Interface for user programs to request OS services. Accessed through APIs that provide library functions.
Computer System Organization
A computer system can be broadly divided into four fundamental components:
Computer System Components
The layered approach where each layer provides services to the layer above
System Organization
A modern general-purpose computer system is organized with one or more CPUs and several device controllers connected via a common bus that facilitates access between components and shared memory.
Key System Components
Hardware
- CPU: Executes instructions, may have multiple cores
- Memory (RAM): Volatile storage directly accessible by CPU
- I/O Devices: Peripherals like disks, displays, audio
- Device Controllers: Manage specific I/O devices
- System Bus: Main communication pathway
Operating System
- Kernel: Always-running core OS component
- Device Drivers: Interface with specific hardware
- System Calls: Interface for user program requests
- Memory Controller: Manages shared memory access
Software Layer
- Application Programs: Word processors, browsers, games
- System Programs: Compilers, utilities
- User Interface: GUI, CLI, or touch interface
How Components Interact
Interrupts
Device controllers inform the CPU when operations complete. CPU stops current task, handles the interrupt, then resumes.
I/O Operations
Device drivers load controller registers, controllers handle data transfer to/from local buffers.
Direct Memory Access (DMA)
For large transfers, DMA controller moves data directly between devices and memory without CPU intervention.
Storage Hierarchy
From fast/expensive (registers, cache) to slow/cheap (hard drives, tapes). OS manages this hierarchy.
System Bus Architecture
System Bus
Session Summary
Key Takeaways:
- Operating systems act as intermediaries between users and hardware
- They provide essential services like process management, memory management, and I/O operations
- Modern systems use multiprogramming and multitasking for efficiency
- Computer systems are organized in layers with hardware at the bottom and users at the top
- Components interact through buses, interrupts, and system calls
Next Session
Session 1.2: Operating System Types
Batch, Multiprogrammed, Time-Sharing, Distributed, and Real-Time Systems
Study Tips:
- Review the system organization diagram and understand each component's role
- Practice identifying OS services in everyday computing tasks
- Understand the difference between user view and system view perspectives