Operating System
Introduction to Operating System (OS)
Course Content
What is an OS
Key functions of an OS
Evaluation of OS
Popular types of OS
Basics of UNIX and Windows
Advantages of open source OS like Linux
Network OS
What is an Operating System?
A computer system consists of hardware and software.
Software includes application software and system software (OS).
An Operating System is system software acting as an interface between the user and computer hardware.
Goals of an Operating System:
Execute user programs and make solving user problems easier.
Make the computer system convenient to use.
Utilize computer hardware efficiently.
The Structure of Computer Systems
Accessing computer resources is structured into layers:
Each layer interacts only with the layer above or below.
Installing new hardware:
No changes needed for user/applications.
Changes required in the OS for device drivers.
Installing new software:
No hardware changes required.
Application compatibility with the OS is necessary.
Changing the OS:
Ensure compatibility with both applications and hardware.
Operating System Mode
User Mode:
Manages user interface, running applications, and accessing files.
Kernel Mode:
Manages background processes, system resources, and hardware control.
System calls transition modes from User to Kernel.
Kernel
The kernel is the core software of the OS with complete control of the system.
Loaded first into main memory upon booting.
Remains in memory throughout the session.
Separates user tasks in user area from kernel tasks in kernel space for security.
Interacts with users via shell and other programs, not directly.
Kernel Functions
Includes:
Scheduler: Allocates processing time between processes.
Supervisor: Manages resource permissions for processes.
Interrupt handler: Manages hardware requests.
Memory manager: Allocates memory for kernel services.
Provides services for process management, file management, I/O management, and memory management through system calls.
System Call
System calls request services from the kernel by applications.
Applications cannot directly access privileged resources for security reasons.
Used for I/O operations, memory allocation, process management, etc.
Also known as software-interrupts.
Starting an Operating System (Booting)
Power On: Activates the motherboard via Voltage Good line.
BIOS (Basic Input/Output System) checks hardware via POST (Power-On Self Test).
BIOS locates MBR (Master Boot Record) which maps hard disk partitions.
Bootstrap loader initializes the OS, and early Kernel setup is activated.
BIOS
Firmware stored in ROM/EPROM chip on the motherboard.
Accessible during initial boot by pressing specific keys (del, F2, F10).
Initializes and controls boot sequence until handing over to bootloader.
UEFI
Unified Extensible Firmware Interface serves a function like BIOS but with enhanced features.
Initializes systems using .efi files stored on EFI System Partition (ESP).
Supports larger drive sizes, faster booting, discrete driver support, and improved security.
Functions of Operating System
User Interface
Process Management
Security and Protection
I/O Management
Memory Management
File Management
1. Process Management
A process is a program in execution needing resources.
OS handles creation, execution, termination, and synchronization of processes.
Manages dependent and independent processes based on priority.
2. Memory Management
Memory tracks usage and allocation for processes.
Main memory is volatile; OS allows for virtual memory usage for better management.
Allocation and de-allocation are crucial responsibilities.
3. File Management
Manages file systems that dictate data encoding and storage methods.
Responsibilities include file creation/deletion, directory management, and backup.
Common file systems: FAT32, NTFS, EXT3, HFS+.
4. Device Management or I/O Management
Interfaces CPU with devices through controllers and drivers.
Manages resources, prioritization, and allocation of devices to processes.
Handles deadlocks and tracks all connected devices.
5. Security & Protection
Uses password protection and access permissions to safeguard data.
Ensures multi-user systems maintain data integrity and privacy.
6. User Interface Mechanism
Two types of user interfaces:
Command Line Interface (CLI): User interacts via typed commands.
Graphical User Interface (GUI): User interacts through visual elements and menus.
History of Operating System
First Generation (1940's to early 1950's): No OS, programming in machine language.
Second Generation (1955-1965): GMOS, first basic batch OS.
Third Generation (1965-1980): Introduction of multiprogramming and minicomputers.
Fourth Generation (1980-Present): Development of PCs and modern OS.
Types of Operating Systems
Batch Operating System
Multiprogramming Operating System
Time-Sharing OS
Multiprocessing OS
Distributed OS
Network OS
Real Time OS
Embedded OS
1. Batch Operating System
Users submit jobs via offline devices (e.g., punch cards).
Jobs are grouped and processed sequentially.
Advantages of Batch Operating System
Predictable processing time and reduced idle time.
Efficient for managing large workloads.
Disadvantages of Batch Operating System
Difficulty in debugging and management.
Unknown wait times if jobs fail.
Examples: IBM's MVS.
2. Multiprogramming Operating System
Executes multiple jobs simultaneously using a single processor.
Increases CPU utilization through scheduling mechanisms.
3. Time-Sharing Operating Systems
Allocates a time slice for each task to share resources.
Reduces idle CPU time and ensures user fairness.
Advantages of Time-Sharing OS
Each task gets equal opportunity with reduced software duplication.
Disadvantages of Time-Sharing OS
Reliability and security concerns, data communication issues.
Examples: Multics, Unix.
4. Multiprocessor Operating Systems
Known as parallel OS, utilizing multiple processors for concurrent processing.
Supports faster processing and recovery from individual processor failures.
5. Distributed Operating System
Interconnected systems share resources via networks in a loosely coupled model.
Example: Locus, DYSEAC.
6. Network Operating System
Manages data, users, and applications across a network.
Enables resource sharing among client computers and servers.
Advantages of Network Operating System
Centralized stability, integrated technologies, and remote access.
Disadvantages of Network Operating System
Costly servers, dependence on central operation, and maintenance needs.
7. Real-Time Operating System
Serves systems with time-critical operations (e.g., air traffic control).
Responds quickly to inputs with strict time limits.
8. Embedded Operating System
Built into devices for specialized tasks (e.g., cars, medical devices).
Examples: Windows CE, Palm OS.
Popular Types of OS
Desktop Class: Windows, OS X, Unix/Linux, Chrome OS.
Server Class: Windows Server, Mac OS X Server, Unix/Linux.
Mobile Class: Android, iOS, Windows Phone.
Desktop Class Operating Systems
Includes various platforms such as Intel for Windows, Mac for OS X, etc.
Ms-DOS
A single-user, single-tasking OS with a command line interface, lacks networking support.
Still used due to its simplicity and low resource requirements.
Microsoft Windows
A graphical operating system for Intel-based computers with a wide application selection.
Current editions: Windows 7, 8, 8.1, and 10.
Mac OS
User-friendly, exclusive to Mac hardware with a variety of applications.
Current editions: Sierra, High Sierra, Mojave, Catalina, Big Sur.
Linux
Open-source, flexible, and runs across multiple platforms.
Users can modify and redistribute code under GPL.
Google Chrome OS
A thin client OS optimized for web usage with minimal hardware requirements.
Server Operating Systems
Windows Server with familiar GUI, stable UNIX capabilities, and customizable Linux options.
Tablet and Phone Operating Systems
System-on-chip (SoC) OS like iOS and Android preinstalled for portable devices.
Applications available through dedicated app stores.
iOS on the iPhone and iPad
Apple's operating system for mobile devices, latest version iOS 14 released Sept 2020.
Android
A popular smartphone OS based on Linux Kernel, with versions up to Android 11.
Advantages of Linux Operating System
Open Source: Customizable, modifiable, and distributable code.
Security: Less vulnerable to threats.
Free: Accessible without licensing costs.
Lightweight: Lower resource requirements compared to other OS.
Stability: Reliable performance with minimal downtime.
Performance: Handles multiple users efficiently.
Flexibility: Suitable for diverse applications.
Software Updates: User-controlled updates.
Distributions: Various flavors to choose from.
Live CD/USB option for trial runs.
Graphical User Interface: User-friendly interfaces available.
Suitable for Programmers: Supports major languages and development tools.
Community Support: Extensive online resources and forums.
Privacy: Minimal data collection from users.
Networking: Strong networking capabilities and command-line tools.
Compatibility: Universal file format support.
Installation: Fast and easy setup process.
Multiple Desktop Support: Several environments available.
Multitasking: Efficiently processes various tasks simultaneously.
Heavily Documented: Abundant manual and online resources for users.
UNIX Shell and Utilities
Shell is separate from the kernel for easier debugging and switching.