Operating System Assignment
Operating System Assignment
Assignment # 01
Operating System Structure
1. Main Components of an Operating System
An operating system (OS) is software that manages hardware and software resources and
provides common services for computer programs. The key components of an OS include
the kernel, process management, memory management, file system management, device
management, and security and protection.
The Kernel
The kernel is the core of the operating system and serves as a bridge between hardware and
software applications. It manages system resources and ensures communication between
hardware and software components.
Key Responsibilities of the Kernel:
• Resource Allocation: Manages CPU, memory, and device allocation.
• System Calls Handling: Facilitates communication between user applications and
hardware.
• Hardware Abstraction: Provides an abstraction layer to allow applications to interact
with hardware without knowing the details.
Process Management
Process management is responsible for managing processes (instances of programs in
execution). The OS ensures proper process execution and multitasking.
Responsibilities:
• Process Scheduling: Determines which process gets CPU time using scheduling
algorithms like round-robin, first-come-first-serve (FCFS), or priority scheduling.
• Multitasking: Ensures multiple processes can run simultaneously by switching between
them.
• Process States: Tracks the status of processes (running, waiting, suspended) using data
structures like the Process Control Block (PCB).
• Inter-process Communication (IPC): Allows processes to communicate and
synchronize, ensuring coordination in multi-threaded environments.
Memory Management
Memory management ensures efficient use of system memory (RAM). The OS allocates and
deallocates memory for processes and ensures data is stored efficiently.
Key Functions:
• Memory Allocation: Assigns memory to processes during execution.
• Virtual Memory: Uses secondary storage (disk) to simulate more RAM than physically
available.
• Paging & Segmentation: Divides memory into fixed-size pages or variable-size segments
to reduce fragmentation and enhance performance.
• Swapping: Temporarily moves inactive processes from RAM to disk when memory is
scarce.
File System Management
File system management controls how data is stored and retrieved from storage devices like
hard drives.
Key Responsibilities:
• File Access Methods: Supports different access methods like sequential or direct access.
• File Systems: The OS uses different file systems to organize data, such as NTFS
(Windows), ext4 (Linux), and FAT32.
• Directory Structure: Manages the organization of files in hierarchical structures
(folders/directories).
• File Permissions: Ensures secure access to files by defining user permissions (read, write,
execute).
Device Management
Device management manages all hardware devices connected to the computer
(input/output devices).
Key Functions:
• Device Drivers: These are specialized software components that facilitate communication
between the OS and hardware devices.
• I/O Scheduling: The OS manages input/output requests from devices, ensuring efficient
data flow and preventing conflicts between devices.
• Buffering and Spooling: Temporarily stores data in memory (buffering) or queues jobs
for later processing (spooling) to optimize device usage.
Monolithic Kernel
A single large process running in kernel space. All OS services like device drivers, memory
management, and file system management are part of the kernel.
• Advantages: High performance since all services are integrated into one kernel.
• Disadvantages: Any failure in the kernel can crash the entire system.
• Examples: Linux, early versions of Unix.
Microkernel
A minimalistic kernel where only essential services like communication, memory
management, and CPU scheduling run in kernel space. Other services run in user space.
• Advantages: More modular and secure; a bug in one service doesn’t crash the whole
system.
• Disadvantages: Slower due to more context switches between kernel and user space.
• Examples: QNX, Minix.
Hybrid Kernel
Combines aspects of both monolithic and microkernels. It runs some essential services in
kernel space and others in user space.
• Advantages: Performance closer to monolithic kernels but more modular.
• Disadvantages: More complex to develop.
• Examples: Windows NT, macOS.
Process Management
The OS schedules processes through various algorithms (round-robin, priority scheduling,
etc.) and keeps track of process states (new, ready, running, waiting, terminated). It
allocates CPU time to each process and uses process synchronization and IPC mechanisms
to ensure coordination in multitasking environments.
Memory Management
The OS employs techniques like:
• Paging: Divides memory into fixed-size pages.
• Segmentation: Divides memory into segments based on logical structures.
• Virtual Memory: Allows processes to use more memory than physically available by
swapping data between RAM and disk. The OS ensures efficient memory allocation,
minimizing fragmentation, and ensuring processes don’t interfere with each other’s
memory space.
Key Characteristics:
• No direct user interaction: Users submit jobs to the system, and they are processed in
batches without real-time feedback.
• Job scheduling: Jobs are scheduled and executed in the order they are received.
• Reduced CPU idle time: Since jobs are batched, the CPU remains busy executing tasks
one after the other, reducing downtime.
Typical Applications:
• Early mainframe computers (e.g., IBM 360) used batch processing for payroll, billing, and
data processing tasks.
Advantages:
• Efficient for executing large volumes of similar tasks.
• Minimizes CPU idle time and optimizes resource utilization.
Examples: IBM Job Control Language (JCL), early versions of UNIX.
Key Characteristics:
• Multitasking: Multiple tasks/processes are executed concurrently.
• Time slicing: The CPU is allocated to each user or process for a small time slice, then
moved to the next task.
• Interactive system: Users interact with the system in real time, receiving quick feedback.
Typical Applications:
• Time-sharing systems are ideal for environments where multiple users need to work
simultaneously, such as academic institutions or large corporations.
Advantages:
• High system utilization by multiple users.
• Quick response time for user interactions.
Examples: UNIX, Multics, Windows Server (with multi-user support).
Key Characteristics:
• Resource sharing: Resources like CPU, memory, and storage are shared across multiple
systems.
• Decentralization: No single point of control; tasks are distributed across multiple nodes.
• Fault tolerance: If one node fails, the system can continue functioning by rerouting tasks
to other nodes.
Typical Applications:
• Used in environments requiring large-scale computing, such as cloud computing platforms,
scientific simulations, and enterprise systems.
Advantages:
• Scalability, as new systems can be added to the network easily.
• Fault tolerance, as system failure can be mitigated by redundancy.
Examples: Google’s cloud infrastructure, Apache Hadoop, Distributed UNIX, Microsoft
Azure.
Key Characteristics:
• Centralized control: A central server manages network resources, controlling access to
files, applications, and devices.
• Remote resource access: Users can access files and applications hosted on other
machines across the network.
• File and printer sharing: Common network services include shared access to files,
printers, and other peripherals.
Typical Applications:
• Network operating systems are used in corporate environments, educational institutions,
and data centers where resource sharing over a network is critical.
Advantages:
• Centralized management and resource sharing.
• Increased collaboration and communication between users over a network.
Examples: Novell NetWare, Microsoft Windows Server, Linux with Samba for file sharing,
UNIX.
Time- Multitasking, CPU time slicing, Multi-user systems, academic UNIX, Windows Server,
Sharing OS interactive and corporate use Multics