0% found this document useful (0 votes)
62 views

Operating System Assignment

Uploaded by

rehmankhansa9
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Operating System Assignment

Uploaded by

rehmankhansa9
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Name: Zain Imran Roll No: 22-Arid-4398

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.

Security and Protection


Security and protection ensure that the OS can prevent unauthorized access to system
resources and protect data integrity.
Key Mechanisms:
• User Authentication: The OS verifies the identity of users via credentials like passwords,
biometrics, etc.
• Access Control: Defines user and process permissions for accessing files, memory, and
devices, often through models like Access Control Lists (ACLs).
• Data Encryption: The OS can encrypt sensitive data to protect confidentiality.
• System Protection: Protects the system from malicious software, using firewalls,
antivirus programs, and system integrity checks.

➢ Types of Kernels and Their Roles

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.

➢ OS Handling of Process and Memory Management

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.

➢ Structure and Types of File Systems


• File systems determine how data is stored, accessed, and managed on storage devices.

File Systems Types


• NTFS (Windows): Supports large files, metadata, and encryption.
• ext4 (Linux): Extensible and robust, widely used in Linux environments.
• HFS+ (macOS): Optimized for Apple devices, supports large files and journaling.
• FAT32: Simple, widely compatible, but with file size limitations.

File System Structures


• Hierarchical Structure: Files are organized into directories (folders) for easy
management.
• File Metadata: File systems store metadata like file size, permissions, and creation dates.

➢ Interaction with Hardware Devices


The OS communicates with hardware devices using device drivers, which translate high-
level OS commands into hardware-specific operations. The OS also manages I/O
operations, buffering data to ensure smooth and efficient communication with devices.
➢ Mechanisms for Ensuring Security and Protecting Resources
The OS enforces security through:
• Access Control: Restricts access to files, memory, and devices based on user roles and
permissions.
• Authentication: Ensures only authorized users can access the system.
• Encryption: Protects sensitive data from unauthorized access.
• Auditing and Monitoring: Logs system activity to detect and prevent unauthorized
actions.

2. Types of Operating Systems


Operating systems can be classified into different types based on how they manage
resources, interact with users, and execute processes. These include batch, time-sharing,
distributed, network, and real-time operating systems. Each type has unique characteristics
and is suited for specific applications.

2.1 Batch Operating Systems


A batch operating system groups similar jobs together into a batch, which is then processed
sequentially without any user interaction. It was widely used in early computing where jobs
(e.g., data processing tasks) were queued and processed one after the other.

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.

2.2 Time-Sharing Operating Systems


Time-sharing operating systems allow multiple users to share system resources
simultaneously by switching the CPU among tasks rapidly. This creates an illusion that each
user has their own dedicated machine.

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).

2.3 Distributed Operating Systems


A distributed operating system manages a group of independent computers and makes
them appear to the user as a single coherent system. These systems coordinate tasks over
multiple interconnected machines.

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.

2.4 Network Operating Systems


A network operating system (NOS) allows multiple computers to communicate and share
resources over a network. Unlike distributed systems, NOSs focus on providing network
functionality such as file sharing, printer sharing, and email services.

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.

2.5 Real-Time Operating Systems (RTOS)


A real-time operating system is designed to process tasks and provide output within a
defined time frame, often in environments where timing is critical.
Key Characteristics:
• Predictable response times: Ensures that tasks are completed within strict time
constraints, often in milliseconds or microseconds.
• Deterministic behavior: The system guarantees that certain operations are executed at
precise times.
• Minimal task delays: Interruptions or delays in task execution are minimized to meet
real-time requirements.
Types of RTOS:
• Hard Real-Time OS: Fails if deadlines are not met (e.g., control systems in airplanes,
medical devices).
• Soft Real-Time OS: Performance degrades if deadlines are missed but system continues
functioning (e.g., multimedia applications, video streaming).
Typical Applications:
• Used in systems requiring real-time processing like medical equipment, embedded systems,
automotive control systems, industrial automation, and telecommunications.
Advantages:
• Precise and reliable task execution within defined time frames.
• Critical for applications where timing is essential for safety and performance.
Examples: VxWorks, FreeRTOS, QNX, RTLinux.

Summary of Different Types of Operating Systems

Type Key Characteristics Typical Applications Examples

No real-time interaction, jobs Early mainframes, payroll


Batch OS IBM JCL, Early UNIX
processed in batches systems, data processing

Time- Multitasking, CPU time slicing, Multi-user systems, academic UNIX, Windows Server,
Sharing OS interactive and corporate use Multics

Resource sharing across


Distributed Cloud computing, enterprise- Google Cloud, Apache
multiple machines, fault
OS level applications Hadoop, Azure
tolerance

Centralized control of network Corporate and institutional Novell NetWare,


Network OS
resources, file sharing networks Windows Server

Real-Time Guaranteed response times, Embedded systems, medical VxWorks, FreeRTOS,


OS (RTOS) deterministic behavior devices, automation QNX

You might also like