Introduction to Operating Systems & System Structures
1. Introduction to Operating Systems
An Operating System (OS) is system software that acts as an intermediary between the user and the
computer hardware.
It manages hardware resources, provides a user interface, and offers services for application
execution.
Main Goals of an OS:
Convenience: Make the system easier to use.
Efficiency: Use hardware resources effectively.
Ability to evolve: Allow changes and upgrades easily.
2. What Operating Systems Do
Resource Management: Allocates CPU, memory, and I/O devices.
Process Management: Creates, schedules, and terminates processes.
File System Management: Manages storage, directories, and permissions.
Security & Protection: Ensures data integrity and access control.
User Interface: Command-Line Interface (CLI) or Graphical User Interface (GUI).
Error Detection & Handling: Identifies and responds to hardware/software failures.
3. Computer System Organization
A computer system consists of:
CPU – Executes instructions.
Memory – Stores data and programs.
I/O Devices – Input/Output operations.
Storage Devices – Permanent data storage.
System Bus – Communication pathway for data, control, and power.
4. Computer System Architecture
Single-Processor Systems: One CPU handles all tasks.
Multiprocessor Systems: Multiple CPUs share memory and I/O.
Clustered Systems: Multiple computers working together, connected via network.
5. Operating System Structure
Operating systems can be structured as:
Monolithic: All OS services run in a single kernel (e.g., Unix).
Layered: OS is divided into layers, each built on top of the other.
Microkernel: Minimal kernel; services run in user space for modularity.
Modules: Object-oriented approach with dynamically loadable modules.
Hybrid: Combination of above approaches (e.g., Windows NT).
6. Operating System Operations
Interrupt Handling: Responds to device or process requests.
System Calls: Interface for programs to request OS services.
Resource Allocation: Ensures fair distribution of CPU, memory, and I/O.
Multitasking & Scheduling: Enables multiple programs to run efficiently.
7. Process Management
Handles:
Process Creation/Termination
CPU Scheduling (e.g., FCFS, Round-Robin)
Synchronization (semaphores, mutexes)
Deadlock Handling
Inter-process Communication (IPC)
8. Memory Management
Ensures efficient memory utilization:
Allocation & Deallocation
Paging & Segmentation
Virtual Memory
Memory Protection
9. Storage Management
Deals with:
File System Management: Organization of files/directories.
Mass Storage Management: Disk scheduling & free-space management.
I/O System Management: Device drivers and buffering.
10. Protection and Security
Protection: Controls access to system resources.
Security: Prevents unauthorized access, ensures data confidentiality and integrity.
11. Distributed Systems
A distributed OS manages a group of independent computers and makes them appear as a single
system.
Examples:
Client-Server systems
Peer-to-Peer systems
Cloud Computing environments
12. Special-Purpose Systems
Real-Time Systems: Strict timing requirements (e.g., air traffic control).
Embedded Systems: OS inside devices (e.g., washing machine controllers).
Mobile Systems: Lightweight OS for smartphones (e.g., Android, iOS).
13. Computing Environments
Modern computing environments include:
Traditional Computing: PCs, servers.
Mobile Computing: Smartphones, tablets.
Client-Server Computing: Central server provides services to clients.
Peer-to-Peer Computing: Devices share resources directly.
Cloud Computing: On-demand resources via internet.
Virtualization: Running multiple OSs on a single physical machine.
Operating System Services
Operating systems provide a set of services to make the system convenient and efficient for users
and application programmers.
1. User – Operating System Interface
The OS provides two main types of interfaces:
Command-Line Interface (CLI):
o Text-based commands (e.g., Windows CMD, Unix shell).
o Fast and powerful but requires knowledge of commands.
Graphical User Interface (GUI):
o Visual interaction using windows, icons, and menus.
o User-friendly (e.g., Windows desktop, GNOME, macOS).
2. System Calls
System calls are the programming interface between a process and the OS.
Allow user-level processes to request services from the kernel.
Implemented as traps or software interrupts.
3. Types of System Calls
System calls are grouped into categories based on functionality:
1. Process Control
o Create/terminate processes
o Load/execute programs
o Wait for events/signals
o Examples: fork(), exit()
2. File Management
o Create/delete files
o Open, read, write, close files
o Examples: open(), read(), write()
3. Device Management
o Request/release device
o Read/write device
o Examples: ioctl(), read(), write()
4. Information Maintenance
o Get/set system time
o Get process attributes
o Examples: getpid(), alarm()
5. Communication
o Create/delete communication connections
o Send/receive messages
o Examples: pipe(), shmget(), send(), recv()
6. Protection
o Control access rights
o Set permissions
4. System Programs
System programs act as convenient tools for users to perform tasks:
File manipulation (editors, compilers)
Status information (date, time, memory usage)
Program loading and execution (shells, batch scripts)
Communication (network tools)
Application development (debuggers, libraries)
5. Operating System Design and Implementation
Design Goals:
o User goals: Easy to use, reliable, secure.
o System goals: Efficient, maintainable, flexible.
Implementation:
o Written in C, C++, and assembly language.
o OS can be monolithic, layered, or microkernel-based.
6. Operating System Structure
Monolithic: Entire OS runs in kernel mode (Unix).
Layered: OS is divided into layers (bottom = hardware, top = UI).
Microkernel: Minimal kernel + user space services (Mach).
Modules: Dynamically loadable kernel modules (Linux).
Hybrid: Combination of above (Windows NT).
7. Virtual Machines
A virtual machine (VM) provides an abstraction of physical hardware.
Runs multiple OS instances on the same hardware.
Examples: VMware, VirtualBox, Hyper-V.
Benefits:
o Isolation between systems
o Better resource utilization
o Easier testing and development
8. Operating System Debugging
Debugging: Finding and fixing errors in OS code or processes.
Techniques:
o Logging: Writing events to a log file.
o Tracing: Recording system call usage.
o Core Dumps: Snapshot of memory when crash occurs.
o Performance Monitoring: Checking CPU/memory utilization.
9. Operating System Generation
OS is customized for specific hardware.
Steps:
1. Determine hardware configuration.
2. Generate system tables.
3. Compile and link OS modules.
4. Build bootable image.
10. System Boot
The process of starting a computer and loading the OS.
Boot Process:
1. BIOS/UEFI Initialization – Basic hardware check.
2. Bootstrap Loader – Loads kernel into memory.
3. Kernel Initialization – Initializes memory, devices, file systems.
4. System Services Start – Starts background services and user login