Unit 1: Introduction




Introduction to Operating System

An Operating System (OS) is system software that acts as an interface between the user and computer hardware.

Simple meaning: The operating system tells the computer how to work and how to respond to user commands.

Examples of Operating Systems:

  • Windows
  • Linux
  • macOS
  • Android
  • iOS

Without an operating system:

  • Computer hardware cannot be used
  • Programs cannot run

Operating System Structure

The structure of an operating system defines how its components are organized and interact.

One of the most common structures is the Layered Structure.

Layered Structure of Operating System

In the layered approach, the OS is divided into multiple layers, where:

  • Each layer performs a specific function
  • Each layer uses services of the layer below it

Simple meaning: Think of OS like a multi-storey building:

  • Ground floor → Hardware
  • Top floor → User

Layered Structure Diagram (Text Form)

User ↑ Application Programs ↑ System Call Interface ↑ Operating System Kernel ↑ Hardware

Explanation of Each Layer

LayerFunction
User LayerUsers interact with system
Application LayerRuns user programs
System Call LayerInterface between OS & programs
KernelCore of OS (process, memory, file control)
HardwareCPU, memory, I/O devices

Advantages of Layered Structure

  • Easy to design and debug
  • Clear separation of functions
  • Better security

Disadvantages

  • Performance may reduce
  • Strict layer dependency

System Components of Operating System

The operating system consists of several key components that work together.

Process Management

Controls execution of programs.

Functions:

  • Creating and deleting processes
  • Scheduling processes
  • Process synchronization
  • Deadlock handling

Memory Management

Manages main memory (RAM).

Functions:

  • Allocates memory to programs
  • Deallocates memory after use
  • Keeps track of used and free memory

File System Management

Manages files and directories.

Functions:

  • Create, delete, read, write files
  • Organize files in folders
  • Protect file data

I/O Device Management

Manages input/output devices.

Examples:

  • Keyboard
  • Printer
  • Disk

Functions:

  • Device drivers
  • Buffering
  • Spooling

Secondary Storage Management

Manages hard disk and storage devices.

Functions:

  • Free space management
  • Disk scheduling
  • Disk allocation

Protection and Security

Protects system from unauthorized access.

Functions:

  • User authentication
  • Access control
  • Data security

Command Interpreter (Shell)

Interface that accepts user commands.

Examples:

  • Command Prompt
  • Linux Shell

Functions of Operating System

The operating system performs many important functions.

Process Control

  • Starts and stops programs
  • Manages CPU time

Memory Control

  • Allocates and frees memory
  • Prevents memory misuse

File Management

  • Organizes files
  • Controls file access

Device Management

  • Controls I/O devices
  • Handles device communication

Security and Protection

  • Protects data and programs
  • Prevents unauthorized access

Error Detection

  • Detects hardware and software errors
  • Takes corrective action

Resource Allocation

  • Shares CPU, memory, and devices
  • Ensures fair usage

User Interface

  • Provides GUI or CLI
  • Allows user interaction

Summary Table

AspectDescription
OSInterface between user and hardware
Layered StructureOS divided into layers
System ComponentsProcess, memory, file, device management
OS FunctionsResource management, security, error handling

Conclusion

An operating system is the backbone of a computer system.
Its layered structure, system components, and core functions ensure:

  • Efficient resource utilization
  • Smooth program execution
  • Secure and user-friendly operation

Understanding these basics is essential for OS exams, interviews, and system-level knowledge.

Classification of Operating Systems

Operating systems are classified based on how they process jobs, handle users, and manage hardware resources.

Types of Operating Systems

Batch Operating System

A batch operating system processes jobs in batches without user interaction.

Simple explanation

Users submit jobs (programs + data) together.
The OS executes them one after another automatically.

Characteristics

  • No user interaction during execution
  • Jobs are grouped in batches
  • Long turnaround time

Example

  • Early IBM mainframe systems

Advantages

  • Efficient CPU utilization
  • Good for large data processing

Disadvantages

  • No immediate feedback
  • Difficult to debug errors

Interactive Operating System

Allows direct interaction between user and computer.

Simple explanation

User gives commands and gets immediate response.

Characteristics

  • User interaction via keyboard/mouse
  • Fast response time

Examples

  • Windows
  • Linux
  • macOS

Advantages

  • Easy to use
  • Quick feedback

Disadvantages

  • Requires more system resources

Time-Sharing Operating System

Allows multiple users to share CPU time.

Simple explanation

Each user gets a small time slice of CPU, making the system appear fast.

Characteristics

  • Multitasking
  • Quick response
  • CPU scheduling

Example

  • UNIX

Advantages

  • Efficient CPU usage
  • Supports many users

Disadvantages

  • Performance decreases with too many users

Real-Time Operating System (RTOS)

An OS that responds within a fixed time limit.

Simple explanation

Correctness depends on time as well as result.

Types of RTOS

TypeDescription
Hard RTOSMissing deadline = system failure
Soft RTOSMissing deadline reduces performance

Examples

  • Air traffic control
  • Medical systems
  • Embedded systems

Advantages

  • High reliability
  • Predictable response

Disadvantages

  • Complex design
  • Expensive

Multiprocessor Operating System

Supports multiple CPUs working together.

Simple explanation

More than one processor executes tasks simultaneously.

Characteristics

  • Parallel processing
  • Shared memory

Examples

  • Modern servers

Advantages

  • High performance

  • Reliability

Disadvantages

  • Complex synchronization

Multiuser Operating System

Allows multiple users to use the system at the same time.

Simple explanation

Many users log in simultaneously and work independently.

Examples

  • UNIX
  • Linux servers

Advantages

  • Resource sharing
  • Cost effective

Disadvantages

  • Security concerns

Multiprocess Operating System

Allows multiple processes to run at the same time.

Simple explanation

Several programs execute simultaneously.

Characteristics

  • Process scheduling
  • Context switching

Example

  • Windows
  • Linux

Advantages

  • Better CPU utilization

Disadvantages

  • Complex process management

Multithreaded Operating System

Allows multiple threads within a process.

Different parts of the same program run concurrently.

Example

  • Web browsers
  • Media players

Advantages

  • Faster execution
  • Better responsiveness

Disadvantages

  • Synchronization issues

Operating System Services

Operating system services help users and programs use hardware efficiently.

Major OS Services

ServiceDescription
Program executionRuns programs
I/O operationsHandles input/output
File systemManages files
CommunicationInter-process communication
Error detectionDetects errors
Resource allocationAllocates CPU, memory
Protection & securityControls access

Reentrant Kernels

A reentrant kernel allows multiple processes to execute kernel code simultaneously.

Kernel functions can be safely used by many processes at the same time.

Characteristics

  • No shared writable data
  • Uses local variables

Advantages

  • Supports multiprocessing
  • Faster system response

Example

  • Modern UNIX kernels

Kernel Architectures

Monolithic Kernel

All OS services run inside the kernel.

Characteristics

  • Large kernel
  • High performance

Examples

  • Linux
  • UNIX

Advantages

  • Fast system calls

Disadvantages

  • Difficult to maintain
  • Crash affects whole system

Microkernel

Only essential services run in kernel mode.

Characteristics

  • Small kernel
  • Other services run in user mode

Examples

  • Minix
  • QNX

Advantages

  • Better security
  • Easy maintenance

Disadvantages

  • Slower due to message passing

Comparison: Monolithic vs Microkernel

FeatureMonolithicMicrokernel
Kernel sizeLargeSmall
PerformanceHighModerate
SecurityLessHigh
StabilityLowHigh
MaintenanceDifficultEasy

Summary

TopicKey Point
Batch OSProcesses jobs in batches
Interactive OSUser interaction
Time-Sharing OSCPU time sharing
RTOSDeadline-based response
Multiprocessor OSMultiple CPUs
Multiuser OSMultiple users
Multithreaded OSMultiple threads
OS ServicesProgram, file, I/O management
Kernel TypesMonolithic, Microkernel