Operating System - Unit 1
Operating System - Unit 1
SYSTEM
INTRODUCTION TO OPERATING SYSTEM
UNDERSTANDING THE BASICS OF
SOFTWARE
Software is a collection of data or computer instructions that tell the computer how to work.
It is the non-tangible component of computers, which contrasts with the physical hardware
from which the system is built and actually performs the work.
Types of Software:
• System Software: This software is designed to manage and control the hardware
components of a computer so that application software can perform its tasks.
• Examples: Operating systems (e.g., Windows, macOS, Linux), utility programs (e.g., antivirus
software, disk cleanup tools), and device drivers (software that allows the operating system to
communicate with hardware devices).
• Application Software: This software allows users to perform specific tasks or applications.
• Examples: Word processors (e.g., Microsoft Word), web browsers (e.g., Google Chrome), games,
media players, and business applications (e.g., accounting software).
UNDERSTANDING THE BASICS OF
SOFTWARE
Purpose of Software:
To perform specific tasks or functions that make the computer
useful.
To provide a user interface for interaction with the hardware.
How Software Works:
Software translates user commands into instructions that the
hardware can understand and execute.
It includes the entire set of programs, procedures, and
routines associated with the operation of a computer system
DEFINITION AND CONCEPT OF
OPERATING SYSTEM
Definition: An Operating System (OS) is a type of system software that acts as an
intermediary between computer hardware and the user. It manages and coordinates the
activities and resources of the computer, enabling the execution of applications and
providing essential services for them.
Concept:
• Intermediary Role: The OS facilitates interaction between the hardware components of
a computer (like the CPU, memory, and storage devices) and the software applications
that need to use these resources.
• User Interface: It provides a user interface, such as a graphical user interface (GUI) or
command-line interface (CLI), which allows users to interact with the computer.
• Resource Management: The OS ensures that hardware resources are efficiently
allocated to various applications and processes running on the computer.
Example
Windows: Developed by Microsoft, it's the most widely used OS for personal
computers. Known for its user-friendly GUI and broad software compatibility.
macOS: Developed by Apple, it's known for its sleek design, security
features, and seamless integration with other Apple products.
Linux: An open-source OS used in various environments, from desktops to
servers. Known for its flexibility, security, and performance. Popular
distributions include Ubuntu, Fedora, and Debian.
Android: A mobile operating system developed by Google, used in
smartphones and tablets. Based on the Linux kernel, it’s known for its wide
range of apps and customization options.
iOS: Developed by Apple for its mobile devices like the iPhone and iPad.
Known for its smooth performance, security, and integration with the Apple
ecosystem.
COMPUTER SYSTEM COMPONENTS
Resource Management:
CPU Management: OS manages the allocation of CPU time to various
processes and ensures efficient multitasking.
Memory Management: Allocates memory to programs as needed and
ensures efficient use of available RAM.
Storage Management:
Manages storage devices, handles file systems, and optimizes data storage
and retrieval.
Hardware Abstraction:
OS provides a layer of abstraction between hardware and software
applications. This allows programmers to write software without needing to
understand the intricate details of hardware components.
IMPORTANCE OF OS
User Interface:
Provides a user-friendly interface (GUI or CLI) for users to interact with the computer
system. This includes managing windows, icons, menus, and input methods
Process Management:
Controls the execution of processes and manages the scheduling of tasks to ensure
that multiple applications can run simultaneously without interference.
Security:
Implements security measures such as user authentication, access control, and data
encryption to protect the system from unauthorized access and malicious attacks.
File System Management:
Manages files and directories on storage devices, providing mechanisms for file
creation, deletion, reading, and writing.
Device Management:
Controls communication between the operating system and peripheral devices such
as printers, scanners, and external storage devices through device drivers.
FUNCTIONS OF
OS
1. RESOURCE MANAGEMENT
CPU Management:
• Function: Allocates CPU time to various processes.
• Example: Ensures that a word processor and a web browser can run
simultaneously without interfering with each other.
• Analogy: Like a traffic cop directing cars at a busy intersection to
prevent congestion.
Memory Management:
• Function: Manages the allocation and deallocation of memory to
processes.
• Example: Ensures that each running application has enough
memory to function properly without interfering with other
applications.
• Analogy: Like a librarian allocating specific shelves to different
books and ensuring they do not overlap.
Storage Management:
• Function: Manages data storage on hard drives and SSDs, including file
systems and disk management.
• Example: Controls how data is read from and written to disk drives,
manages disk space allocation.
• Analogy: Like an organizer who decides how and where to store items in
a warehouse.
Device Management:
• Function: Manages communication between the OS and peripheral
devices.
• Example: Ensures that printers, keyboards, and other external devices
can interact with the computer seamlessly.
• Analogy: Like a translator who helps people speaking different
languages understand each other.
2. PROCESS MANAGEMENT
Process Scheduling:
• Function: Determines the order in which processes run.
• Example: Ensures that background processes do not take up too much CPU time at the
expense of foreground applications.
• Analogy: Like a scheduler who decides the order of tasks in a project to ensure timely
completion.
Creation and Termination:
• Function: Handles the creation, execution, and termination of processes.
• Example: Starts new applications and closes them when they are no longer needed.
• Analogy: Like a director who starts and stops scenes during a play.
Interprocess Communication (IPC):
• Function: Manages communication between processes.
• Example: Allows a word processor to send a document to a printer process.
• Analogy: Like a network of mail couriers delivering messages between different offices.
3. FILE MANAGEMENT SYSTEM
File Creation and Deletion:
• Function: Manages the creation, deletion, and organization of files.
• Example: Allows users to create new documents, save them, and delete them when
no longer needed.
• Analogy: Like a clerk who files documents in a filing cabinet and removes them when
they are no longer needed.
File Access Control:
• Function: Controls access to files and directories.
• Example: Ensures that users have the necessary permissions to read, write, or
execute files.
• Analogy: Like a security guard who checks IDs before allowing access to a restricted
area.
Directory Management:
• Function: Manages directories and subdirectories.
• Example: Organizes files into folders and subfolders for easy navigation.
• Analogy: Like a librarian organizing books into categories and sections.
4. USER INTERFACE
Graphical User Interface (GUI):
• Function: Provides a visual interface for users to interact with the system.
• Example: Allows users to open applications, navigate files, and manage
system settings using windows, icons, and menus.
• Analogy: Like the dashboard of a car, providing buttons, gauges, and
controls for the driver to interact with the vehicle.
Command-Line Interface (CLI):
• Function: Provides a text-based interface for users to type commands.
• Example: Allows advanced users to perform complex tasks more quickly by
typing commands directly.
• Analogy: Like using a keyboard to type instructions instead of using a mouse
to click icons. (Instruction: Open the notebook to page 10.)
5. SECURITY AND PROTECTION
User Authentication:
• Function: Verifies the identity of users.
• Example: Requires users to log in with a username and password.
• Analogy: Like a doorman checking IDs before allowing entry into a building.
Access Control:
• Function: Regulates permissions and access to system resources.
• Example: Ensures that only authorized users can access certain files or perform
specific actions.
• Analogy: Like a keycard system that restricts access to certain rooms in a building.
Data Protection:
• Function: Protects data from unauthorized access and corruption.
• Example: Encrypts sensitive data to prevent unauthorized access.
• Analogy: Like a safe that keeps valuable items secure and inaccessible to
unauthorized persons.
6. DEVICE MANAGEMENT
Managing Communication with Peripheral Devices:
• Function: Ensures that external devices can communicate effectively with
the computer.
• Example: Facilitates the connection and use of printers, scanners, and
external drives.
• Analogy: Like a receptionist coordinating communication between office staff
and visitors.
Installing and Managing Device Drivers:
• Function: Handles the installation and management of device drivers.
• Example: Ensures that the correct drivers are used for hardware components
to function properly.
• Analogy: Like installing the right software to ensure a new gadget works with
your computer.
7. NETWORK MANAGEMENT
Facilitating Communication Within Networks:
• Function: Manages network connections and data transfer.
• Example: Allows computers to connect to the internet and share files over a
network.
• Analogy: Like a telephone operator connecting calls between different phones.
Network Resource Management:
• Function: Manages bandwidth and network resources.
• Example: Ensures efficient data transfer and prevents network congestion.
• Analogy: Like a traffic controller managing the flow of vehicles on roads to prevent
traffic jams.
Network Protocol Support:
• Function: Supports protocols like TCP/IP for communication.
• Example: Ensures that data is sent and received correctly over the internet.
• Analogy: Like ensuring mail is sent and received using a standardized postal
system.
8. MEMORY MANAGEMENT
Memory Allocation:
• Function: Allocates memory to processes.
• Example: Ensures that each running application gets enough memory to function
properly.
• Analogy: Like assigning different rooms to guests in a hotel.
Memory Deallocation (Freeing):
• Function: Frees memory when it is no longer needed by processes.
• Example: Reclaims memory from closed applications for use by new applications.
• Analogy: Like cleaning and preparing rooms for new guests after the previous ones
have checked out.
Virtual Memory Management:
• Function: Extends physical memory using disk space.
• Example: Allows systems to run more applications than the available physical RAM by
using disk space as "virtual memory."
• Analogy: Like using an overflow parking lot when the main parking lot is full.
9. ERROR HANDLING AND
LOGGING
Error Detection and Recovery:
• Function: Detects and handles errors in the system.
• Example: Displays error messages and attempts to recover from
faults.
• Analogy: Like a mechanic diagnosing and fixing problems in a car.
Event Logging for Troubleshooting and Analysis:
• Function: Logs system events and errors for later review.
• Example: Keeps a record of system crashes and performance issues.
• Analogy: Like a black box in an airplane recording flight data for
analysis after an incident.
10. USER MANAGEMENT
User Account Creation and Management:
• Function: Manages the creation, deletion, and maintenance of user
accounts.
• Example: Allows multiple users to have separate accounts on the
same computer.
• Analogy: Like a hotel managing guest check-ins and check-outs.
User Profile Settings and Preferences:
• Function: Manages individual user settings and preferences.
• Example: Saves personalized settings like desktop backgrounds and
application preferences.
• Analogy: Like a car saving seat and mirror positions for different
drivers.
TYPES OF
OPERATING
SYSTEM
SINGLE USER SYSTEM
Unix:
• One of the earliest and most widely used time-sharing operating systems.
• Known for its robustness, security, and flexibility.
Linux:
• An open-source operating system inspired by Unix.
• Widely used in servers, desktops, and embedded systems.
Multics (Multiplexed Information and Computing Service):
• A pioneering time-sharing operating system that influenced the development
of Unix.
• Known for its advanced features and high security.
MULTI TASKING
Context Switching:
• The operating system saves the state (context) of a currently running task
and loads the state of the next task.
• This involves saving the program counter, CPU registers, and other critical
data of the current task.
Time Slicing:
• The CPU time is divided into small units called time slices or quanta.
• Each task gets a time slice to execute, and the OS switches to the next task
when the time slice expires.
Scheduling Algorithms:
• Determines which task runs next based on factors like priority, fairness, and
efficiency.
• Examples include Round Robin (equal time slices for each task), Priority
Scheduling (higher priority tasks get more CPU time), and Multilevel Queue
Scheduling.
Advantages of Multitasking Operating
Systems
Improved CPU Utilization:
Ensures that the CPU is always busy executing tasks, reducing idle time.
Maximizes the efficiency of the CPU.
Increased Productivity:
Allows users to run multiple applications simultaneously, enhancing productivity.
Users can perform multiple tasks without waiting for one to complete before starting
another.
Resource Sharing:
Efficiently manages and shares system resources among multiple tasks.
Allows for better utilization of memory, I/O devices, and storage.
Disadvantages of Multitasking Operating Systems
•Complexity:
•Designing and maintaining multitasking systems is complex due to the need for efficient
scheduling, resource management, and context switching.
•Debugging and developing applications for multitasking systems can be more challenging.
•Performance Overhead:
•Context switching and managing multiple tasks introduce overhead, which can impact system
performance.
•The efficiency of the system can be affected if there are too many tasks competing for
resources.
•Security and Stability:
•Ensuring the security and stability of the system is more challenging due to the concurrent
execution of multiple tasks.
•Bugs or vulnerabilities in one task can potentially affect other tasks or the entire system.
•Resource Contention:
•Multiple tasks competing for limited resources can lead to contention and reduced performance.
•Ensuring fair and efficient allocation of resources is critical to maintaining system performance.
MULTI TASKING VS TIME SHARING
Aspect Multitasking OS Time-Sharing OS
Improve efficiency and responsiveness for a single Provide fair and interactive use of the system
Primary Goal
user running multiple tasks. for multiple users simultaneously.
User Context Single user running multiple tasks. Multiple users, each running their own tasks.
Resource Manages CPU, memory, and I/O devices among Manages CPU, memory, and I/O devices
Management tasks of a single user. among multiple users, ensuring fair access.
Scheduling Uses algorithms like Round Robin, Priority Uses time-slicing (e.g., Round Robin) to
Algorithms Scheduling, etc., to allocate CPU time to tasks. allocate CPU time fairly among users.
Context Frequently switches between tasks of a single Frequently switches between tasks of multiple
Switching user. users.
Typical Use Servers, mainframes in multi-user
Personal computers, smartphones.
Cases environments like universities and businesses.
Unix, Linux servers in educational and
Examples Windows, macOS, Linux on personal devices.
business environments.
Provide an interactive environment for
Enhance productivity for a single user by allowing
Objective multiple users to perform tasks concurrently
multiple applications to run simultaneously.
with fair resource allocation.
Resource Focuses on efficiently allocating resources to Ensures fair allocation of resources to tasks of
Allocation tasks of one user. multiple users.
User Multiple users experience an interactive and
Single user experiences smooth multitasking.
Experience fair use of the system.
More complex due to the need to manage
Less complex than time-sharing due to single-user
Complexity multiple users and ensure fair resource
focus.
allocation.
MULTI PROGRAMMING OS
•Resource Contention:
•Multiple programs competing for limited resources can lead to contention and
reduced performance.
Memory Handles memory allocation for multiple tasks Handles memory allocation for multiple programs, possibly using
Management within a single user’s context. techniques like paging or segmentation.
Typical Use
Personal computers, smartphones. Mainframes, servers, and large-scale computing environments.
Cases
Examples Windows, macOS, Linux on personal devices. Unix, IBM OS/360, early versions of Windows (e.g., Windows 3.x).
Enhance user experience by running multiple Ensure the CPU is never idle by keeping multiple programs ready to
Objective
applications smoothly. execute.
Resource Focuses on efficiently allocating resources to Ensures efficient allocation of resources to multiple programs,
Allocation tasks of one user. reducing CPU idle time.
User Single user experiences smooth multitasking of Multiple programs are processed efficiently, with the CPU switching
Experience applications. between them.
Less complex than multiprogramming, focusing More complex due to managing multiple programs and ensuring
Complexity
on a single user's tasks. efficient CPU use.
Debugging Easier to debug and test since it focuses on
More challenging due to concurrent execution of multiple programs.
and Testing single-user tasks.
MULTI PROCESSING OS
Multiple CPUs:
• Utilizes multiple CPUs to perform parallel processing.
• Each CPU can execute separate processes or threads concurrently.
Parallel Processing:
• Processes are divided into smaller tasks that can be executed simultaneously on
different CPUs.
• Enhances performance by distributing the computational load across multiple
processors.
Increased Throughput:
• By executing multiple processes concurrently, the overall system throughput is
increased.
• More tasks are completed in a shorter amount of time compared to single-processor
systems.
Improved Reliability:
• If one CPU fails, others can take over the workload, providing fault tolerance.
• The system continues to function, albeit with reduced performance, even if
one processor fails.
Complex Scheduling:
• The operating system must manage the allocation of processes to
multiple CPUs.
• Scheduling algorithms are more complex to ensure balanced and
efficient use of all processors.
TYPES OF MULTI PROCESSING OS
•Scalability:
•Systems can be scaled up by adding more CPUs to handle increased
workloads.
•Fault Tolerance:
•If one CPU fails, other CPUs can continue processing, providing a level of fault
tolerance and reliability.
•Complexity:
•More complex to design, implement, and manage compared to single-processor
systems.
•Requires sophisticated scheduling and synchronization mechanisms.
•Cost:
•Higher cost due to the additional hardware and complexity of the operating
system.
•Resource Contention:
•Multiple CPUs accessing shared resources can lead to contention and
performance bottlenecks.
•Synchronization Overhead:
•Processes running in parallel need to synchronize, which can introduce overhead
and reduce performance gains.
EXAMPLES
•Linux:
•Supports SMP and is widely used in servers and high-performance computing
environments.
•Windows Server:
•Windows Server editions support multiprocessing and are used in enterprise
environments.
•UNIX:
•Many UNIX systems, such as Solaris and AIX, support multiprocessing.
•IBM Mainframes:
•IBM mainframes have supported multiprocessing for decades, providing high
performance and reliability.
Aspect Multiprocessing Multitasking Multiprogramming
Utilizes multiple CPUs to perform parallel Allows a single CPU to switch between multiple Keeps multiple programs in memory to maximize CPU
Definition
processing. tasks rapidly. utilization.
Enhance performance and reliability by using Improve responsiveness and efficiency for a single Maximize CPU utilization by keeping it busy with
Primary Goal
multiple processors. user by running multiple tasks concurrently. multiple programs.
CPU Multiple CPUs execute processes A single CPU rapidly switches between tasks, A single CPU executes multiple programs by
Utilization simultaneously. giving the illusion of simultaneous execution. switching between them.
Can serve multiple users or a single user with Typically focuses on a single user running multiple Can serve multiple users, each running multiple
User Context
heavy computational needs. applications. programs.
Resource Manages CPU, memory, and I/O for multiple tasks Manages CPU, memory, and I/O for multiple
Manages resources across multiple CPUs.
Management within a single user’s context. programs.
Scheduling Uses algorithms to distribute processes across Uses algorithms like Round Robin, Priority Uses job scheduling algorithms like FCFS, SJN, Priority
Algorithms multiple CPUs. Scheduling to allocate CPU time to tasks. Scheduling to allocate CPU time to programs.
Context Occurs between processes running on different Frequently switches between tasks to give the Switches between multiple programs, each of which
Switching CPUs. illusion of concurrency. may belong to different users or services.
High complexity due to the need to manage Moderate complexity due to the need to manage High complexity due to managing multiple programs
Complexity
multiple CPUs. rapid context switching. and ensuring efficient CPU use.
Fault Higher fault tolerance; failure of one CPU does Lower fault tolerance as it's dependent on a single
Lower fault tolerance compared to multiprocessing.
Tolerance not halt the system. CPU.
Moderate performance; dependent on the Moderate performance; dependent on the efficiency
Performance Higher performance due to parallel execution.
efficiency of task switching. of program switching.
ONLINE OPERATING SYSTEM
•Platform Independence:
•Can be accessed from any device with an internet connection, regardless of the
underlying hardware or local OS.
•Supports cross-platform compatibility, allowing seamless transitions between
devices.
•Resource Accessibility:
•Files, applications, and settings are stored in the cloud, making them accessible
from any location.
•Provides scalable storage and computing resources as needed.
Key Features of Online Operating
Systems
•Maintenance and Updates:
•Maintenance, updates, and security patches are managed centrally by the
service provider.
•Users benefit from automatic updates without manual intervention.
•Accessibility:
•Access your OS and data from anywhere with an internet connection.
•Ideal for remote work and collaboration.
•Cost-Effective:
•Reduces the need for expensive hardware upgrades.
•Pay-as-you-go models allow for cost-effective scalability.
•Easy Collaboration:
•Multiple users can work on the same document or project in real-time.
•Enhances productivity and teamwork.
•Centralized Management:
•Simplifies IT management for organizations.
•Ensures that all users have the latest software versions and security patches.
Disadvantages of Online Operating
Systems
•Internet Dependency:
•Requires a stable and fast internet connection.
•Limited functionality in offline mode.
•Security Concerns:
•Data is stored on remote servers, which can be a target for cyber attacks.
•Requires strong security measures to protect sensitive information.
•Performance:
•Performance can be affected by internet speed and latency.
•May not be suitable for high-performance computing tasks requiring low latency
•Limited Control:
•Users have less control over system configurations and updates.
•Dependent on the service provider for uptime and maintenance.
REAL TIME OPERATING SYSTEM
•Priority-Based Scheduling:
•Uses priority-based task scheduling to ensure that high-priority tasks are executed
before lower-priority ones.
•Common scheduling algorithms include Rate Monotonic Scheduling (RMS) and Earliest
Deadline First (EDF).
•Resource Management:
•Efficiently manages system resources like CPU, memory, and I/O to meet
the real-time requirements.
•Often includes mechanisms to avoid resource contention and priority
inversion.
•Efficiency:
•Optimized to handle multiple tasks efficiently, making them suitable for systems with
stringent timing requirements.
•Resource Optimization:
•Efficiently manages system resources to ensure that high-priority tasks get the
necessary resources.
•Low Latency:
•Minimizes the delay in handling interrupts and executing high-priority tasks.
Disadvantages of Real-Time
Operating Systems
•Complexity:
•Designing and developing applications for an RTOS can be complex and requires
specialized knowledge.
•Limited Flexibility:
•Prioritizes real-time tasks, which may limit the flexibility for other non-real-time
tasks.
•Higher Cost:
•Implementing and maintaining an RTOS can be more expensive due to the
specialized hardware and software requirements.
•Resource Constraints:
•Often runs on systems with limited resources, requiring efficient use and careful
management.
DISTRIBUTES OPERATING SYSTEM
•Resource Sharing:
•Enables sharing of hardware (e.g., printers, storage), software, and data among multiple
computers in the network.
•Resources are managed in a way that provides seamless access to users and applications.
•Transparency:
•Location Transparency: Users and applications do not need to be aware of the physical
location of resources.
•Migration Transparency: Processes and data can move around the system without affecting
the user's perception.
•Replication Transparency: Multiple copies of data can exist without users knowing which
copy is being accessed.
•Concurrency Transparency: Multiple users or processes can access the same resources
concurrently without conflicts.
•Failure Transparency: The system continues to function despite failures, providing fault
tolerance.
•Scalability:
•The system can easily accommodate the addition of more nodes (computers)
without significant changes to the overall system architecture or performance
degradation.
•Openness:
•The system is built using standard protocols and interfaces, allowing easy
integration of new components and interoperability with other systems
•Security:
•Provides mechanisms for authentication, authorization, encryption, and auditing to
protect data and resources.
Advantages of Distributed Operating Systems
•Resource Sharing:
•Efficient use of resources by sharing hardware and software across multiple nodes.
•Users and applications can access powerful resources not available on a single node.
•Scalability:
•Easy to add new nodes to the system to handle increased load or additional functionality.
•Can handle a large number of users and applications.
•Flexibility:
•Allows the integration of different types of hardware and software.
•Supports a wide range of applications and use cases.
•Performance:
•Load balancing and resource allocation algorithms optimize performance.
•Distributed processing can speed up computation-intensive tasks.
Disadvantages of Distributed
Operating Systems
•Complexity:
•Designing, implementing, and managing a distributed system is complex.
•Requires sophisticated algorithms for resource management, load balancing, and fault
tolerance.
•Network Dependency:
•Performance and reliability depend on the underlying network.
•Network latency and bandwidth limitations can affect system performance.
•Security Risks:
•Increased potential for security breaches due to the distributed nature.
•Requires robust security measures to protect data and resources.
•Consistency Challenges:
•Ensuring data consistency across multiple nodes is challenging.
•Requires complex algorithms to manage data replication and synchronization.
USER VIEW
TOP DOWN
VIEW
What is user view
User View refers to how users perceive and interact with the operating
system. This view is concerned with the interface and services provided
to the users, enabling them to perform tasks efficiently.
As per top down view OS is a huge collection of programs which acts as
an intermediatory between a user of a computer hardware and makes
the computer system convenient to use.
It is because of OS that users don’t have to deal with the hardware to
get the work done.
Users can use simple command to perform various tasks.
Deals with the expectations of the user with the system
Key Aspects of User View:
User Interface:
• Graphical User Interface (GUI): Provides a visual environment with
windows, icons, and menus. Examples include Windows, macOS, and many
Linux distributions like Ubuntu.
• Command-Line Interface (CLI): A text-based interface where users type
commands to perform tasks. Examples include bash in Unix/Linux, and
Command Prompt or PowerShell in Windows.
Ease of Use:
• Designed to be user-friendly, allowing users to accomplish tasks without
needing to understand the underlying system complexities.
• Includes features like drag-and-drop, context menus, and wizards for common
tasks.
Key Aspects of User View:
User Programs:
• Includes applications and software that users run, such as word
processors, web browsers, and media players.
• Users interact with the OS through these applications, which in turn
make system calls to the OS.
Task Management:
• Users can run multiple applications simultaneously, switch between
them, and manage open windows.
• Provides utilities for managing files, folders, and system settings.
SYSTEM VIEW
BOTTOM UP
VIEW
What is system view
Resource Management:
• CPU Scheduling: Manages how processes share the CPU. Ensures efficient
use of CPU and fair process execution.
• Memory Management: Manages the allocation and deallocation of memory
space to processes. Includes virtual memory, paging, and segmentation.
• I/O Management: Manages input and output operations, including devices
like disks, keyboards, and printers.
System Calls:
• Provides a programming interface for applications to request services from
the OS. System calls handle low-level tasks like file operations, process
control, and network communication.
• Examples include open(), read(), write(), and fork() in Unix/Linux; CreateFile(),
ReadFile(), WriteFile(), and CreateProcess() in Windows.
Key Aspects of System View:
File System:
• Manages how data is stored, organized, and accessed on storage devices.
• Includes file permissions, directory structure, and file operations (create, read,
write, delete).
Security and Protection:
• Implements mechanisms to protect system resources and user data from
unauthorized access.
• Includes user authentication, access control lists (ACLs), and encryption.
Process Management:
• Manages the creation, scheduling, and termination of processes.
• Handles process synchronization, inter-process communication (IPC), and
deadlock prevention.
Differences Between User View and System View
Interface GUI or CLI for user interaction System calls and kernel interfaces
Primary Users End users and application users System administrators, developers
Task Management Running applications, managing windows Process scheduling, memory allocation
•ls /home/user/documents: Lists all files and directories in the specified path.
• dir C:\Users\YourUsername\Documents: Lists all files and directories in the specified path.
WRITE TO A FILE
SYSTEM CALL USER VIEW VS COMMAND LANGUAGE USER
VIEW
Aspect System Call User View Command Language User View
Low-level interface for applications to request High-level interface for users to interact with the OS via
Definition
services from the OS commands
Primarily used by programmers and system
Users End users, system administrators, and power users
developers
Command-line interface (CLI) commands (e.g., ls, cp,
Interface System calls (e.g., open(), write(), fork())
mkdir)
Access Method Through programming languages (e.g., C) Through a command-line shell or terminal
To perform low-level operations such as file
To perform high-level tasks such as file management,
Purpose manipulation, process control, and inter-process
system configuration, and running applications
communication
More complex and detailed, requiring knowledge of More user-friendly and abstract, requiring knowledge of
Complexity
programming command syntax
Abstraction Level Low-level abstraction, close to the hardware High-level abstraction, far from the hardware
Handled by the command interpreter and displayed to
Error Handling Handled programmatically within the application
the user
int fd = open("file.txt", O_RDONLY); <br> write(fd, ls /home/user/documents <br> cp source.txt
Examples
"Hello", 5); destination.txt
Writing system-level software, device drivers, System administration, routine file operations, executing
Typical Use Cases
operating system components scripts
Requires compilation and linking in a programming
Execution Executed directly by the command-line interpreter
environment
Generally more efficient due to direct interaction with May be less efficient due to additional abstraction and
Performance
the OS parsing
Returns error codes or sets errno for the application Displays error messages directly to the user in the
Error Reporting
to handle terminal
STRUCTURE OF
OPERATING
SYSTEM
SIMPLE (MS-DOS) STRUCTURE OF OS
APPLICATION PROGRAM LAYER
•Examples: Text editors (e.g., EDIT), file managers (e.g., Norton Commander), games, and other
utility programs.
•Role: They run on top of the operating system, utilizing the services provided by the OS to perform
tasks.
RESIDENT SYSTEM PROGRAM LAYER
• Examples: BIOS routines for disk access, keyboard input, screen output.
•Simplicity:
•Easy to Understand and Use: MS-DOS has a straightforward command-line interface and
simple commands, making it easy to learn and use.
•Minimal Resource Requirements: It can run on hardware with very limited resources, which
was advantageous in the early days of personal computing.
•Speed:
•Fast Boot Times: Due to its simplicity and minimalistic design, MS-DOS boots up quickly.
•Low Overhead: The lack of multitasking and complex GUI elements means that MS-DOS has
low system overhead, allowing it to run efficiently on minimal hardware.
•Single Tasking:
•Lack of Multitasking: MS-DOS can only run one application at a time, which is a
significant limitation compared to modern operating systems that support multitasking.
•Role: These applications interact with the system libraries and the kernel to
perform tasks.
•Interaction: Use system libraries to make requests to the kernel for services
such as file access, network communication, and process management.
SYSTEM LIBRARIES
•Description: Libraries that provide a standard interface for applications to interact with
the operating system.
•Examples: Standard C library (libc), graphical libraries, and other utility libraries.
•Role: These libraries offer convenient functions for applications to perform tasks like
I/O operations, memory management, and interfacing with hardware without needing to
make direct system calls.
•Functionality: Offer high-level APIs that simplify complex operations for user
applications. For instance, a function to open a file would internally manage the details
of the system call required to interact with the file system.
WHAT IS KERNEL?
The kernel is the core component of an operating system. It acts as a bridge between
software applications and the hardware of a computer. The kernel manages system
resources and allows applications to communicate with the hardware in a controlled
and efficient manner.
•Process Management:
•Scheduling: Determines which processes run at any given time, balancing fairness and efficiency.
•Inter-Process Communication (IPC): Mechanisms such as signals, pipes, and message queues that
allow processes to communicate and synchronize their activities.
•Memory Management:
•Allocation/Deallocation: Manages how memory is allocated to processes and reclaims it when no longer
needed.
•Paging/Segmentation: Techniques to manage virtual memory, allowing processes to use more memory
than is physically available.
•File Systems:
•File Operations: Functions to open, read, write, and close files. Manages directories and file metadata.
•File System Drivers: Interface with various file system types, ensuring compatibility and data integrity.
•Device Drivers:
•Hardware Abstraction: Provide a consistent interface for the kernel to interact with various hardware
devices, hiding the details of device operations.
•I/O Operations: Manage input and output operations to and from hardware devices.
•Networking:
•Protocols: Implementation of network protocols (e.g., TCP/IP) to handle data transmission and reception.
•Network Interfaces: Manage network cards and other communication hardware, providing connectivity to
other systems.
•Development Challenges:
•Complex Debugging: Debugging issues in a large, monolithic kernel can be
difficult as it may be hard to isolate the root cause of a problem.
•Testing Overhead: Thoroughly testing a monolithic kernel can be more resource-
intensive since changes can affect many parts of the system.
LAYERED OPERATING SYSTEM
Application Layer:
•Description: Contains user applications and programs.
•Examples: Web browsers, text editors, games, and other user software.
•Role: Utilizes system calls to request services from the lower layers.
Hardware Layer:
• Description: The physical components of the computer system.
• Examples: CPU, memory, storage devices, input/output devices, and network interfaces.
• Role: Executes instructions and processes data as directed by the higher layers.
Advantages of Layered Operating System
•Modularity:
•Each layer performs a specific function, making the system easier to understand, develop, and debug.
•Ease of Maintenance:
•Changes or updates in one layer can be made independently of other layers, simplifying maintenance
and upgrades.
•Abstraction:
•Each layer provides a level of abstraction, hiding the complexities of lower layers from the upper
layers.
•Security:
•The clear separation of layers enhances security by limiting direct access to the hardware and critical
system resources.
•Reliability:
•The separation of concerns reduces the risk of errors and makes the system more reliable.
Disadvantages of Layered Operating System
•Performance Overhead:
•The multiple layers can introduce performance overhead due to additional
processing and communication between layers.
•Complexity in Design:
•Designing a properly layered operating system can be complex and challenging,
requiring careful planning and implementation.
•Rigid Structure:
•The strict separation of layers can sometimes make it difficult to implement cross-
layer optimizations and integrations.
SYSTEM INTERFACE
The system interface in an operating system (OS) is a critical component
that provides the means by which user-level applications interact with the
system's hardware and other low-level functionalities. It acts as a bridge
between user programs and the hardware, ensuring that resources are
managed efficiently and securely.
Purpose:
• Abstraction: Simplifies the interaction with hardware by providing high-level
functions.
• Security: Ensures that applications access system resources in a controlled
manner, preventing unauthorized operations.
• Efficiency: Optimizes resource management by mediating access and ensuring
fair usage among competing applications.
• Stability: Helps maintain system stability by providing structured and
predictable interfaces for resource access and management.
COMMAND LINE INTERFACE
A Graphical User Interface (GUI) is a type of user interface that allows users to
interact with electronic devices, such as computers, through graphical icons
and visual indicators rather than text-based commands. GUIs are designed to
be intuitive and user-friendly, providing a more accessible way for users to
navigate and operate software applications and operating systems.
Key Components of GUI
1. Visual Elements
2. Point-and-Click Interaction
3. Window Management
4. Widgets and Controls
5. Event-Driven Programming
Visual Elements
GUIs rely on visual elements to represent information and actions, including:
• Icons: Graphical representations of files, applications, and actions.
• Menus: Dropdown lists that provide access to commands and options.
• Buttons: Clickable elements that initiate actions or confirm choices.
• Dialog Boxes: Pop-up windows for user input or messages.
• Toolbars: Quick-access panels with icons for common actions.
Point-and-Click Interaction
Users interact with GUIs primarily through pointing devices like a mouse, touchpad,
or touchscreen:
• Selection: Clicking icons, buttons, or menu items to select or activate them.
• Drag-and-Drop: Moving files or objects by dragging them with the mouse.
• Context Menu: Right-clicking to access additional options related to selected items.
Window Management
GUIs organize information and tasks into separate, movable windows:
• Window Controls: Minimize, maximize/restore, and close buttons for managing
windows.
• Window Layout: Users can arrange and resize windows to suit their preferences and
workflow.
• Multiple Windows: Supports multitasking by allowing multiple applications or
documents to be open simultaneously.
Advantages of GUI
• User-Friendly: Intuitive interface reduces the learning curve for new users.
• Visual Representation: Makes complex tasks and data more accessible and
understandable.
• Interactivity: Supports interactive elements that enhance user engagement and
productivity.
• Multitasking: Facilitates multitasking by managing multiple applications and tasks
concurrently.
Disadvantages of GUI
• Resource Intensive: Requires more system resources (memory, processing power)
compared to text-based interfaces.
• Complexity: GUIs can become overly complex, making simple tasks more
challenging for advanced users.
• Dependency on Hardware: Requires compatible hardware (graphics card, monitor)
to display properly.
• Accessibility: GUIs may present accessibility challenges for users with disabilities
compared to text-based interfaces.
SYSTEM CALLS
>/E d ^Zs Z
ZY h ^d
WW>/d/K E WW>/d/K E
Z^WK E ^
K WZd/E '
d^
^z ^dD
CLIENT SERVER MODEL
The client-server model divides tasks between service providers (servers) and service
requesters (clients). Servers host, manage, and deliver resources or services, while clients
request and use those resources or services.
Client:
• Definition: A client is a computing device (like a computer, smartphone, or tablet) that requests
services or resources from a server.
• Role: Initiates communication with the server, sends requests, and processes the server's
responses.
• Examples: Web browsers (requesting web pages), email clients (retrieving emails), or any
application accessing a remote service.
Server:
• Definition: A server is a powerful computer or program that provides resources, data, services, or
programs to clients over a network.
• Role: Listens for client requests, processes them, and sends back the required response or service.
• Examples: Web servers (serving web pages), database servers (providing database services), file
servers (storing and managing files).
Communication Process
1. Request-Response Cycle:
1. Client Request: The client sends a request to the server, typically using a
specific protocol (e.g., HTTP for web requests).
2. Server Processing: The server receives the request, processes it (which may
involve querying a database, performing computations, etc.), and prepares a
response.
3. Server Response: The server sends the response back to the client, which
then processes or displays the information.
EXPLANATION OF THE DIAGRAM
Clients Application (App)
• Definition: The software or application that the user interacts with on the client
side.
• Role: Sends requests to the server for resources or services and processes the
responses.
• Examples: Web browsers (like Chrome, Firefox), email clients (like Outlook, Gmail
app), or any other application that accesses remote services.
Operating System (OS)
• Definition: The software that manages the hardware and software resources of
the client device.
• Role: Provides a platform for applications to run and handles basic tasks such as
file management, memory management, and process management.
• Examples: Windows, macOS, Linux, Android, iOS.
Server
Application (App)
• Definition: The server-side software that provides services or resources to the
clients.
• Role: Listens for and processes client requests, interacts with the database if
needed, and sends responses back to the clients.
• Examples: Web servers (like Apache, Nginx), application servers (like Tomcat,
Node.js), email servers (like Microsoft Exchange, Postfix).
Database (DB)
• Definition: A structured collection of data that the server application can query and
update.
• Role: Stores and manages data required by the server application. Provides efficient
data retrieval and storage capabilities.
• Examples: MySQL, PostgreSQL, MongoDB, Microsoft SQL Server.
Communication Process
1. Request:
1. Action: The client application initiates a request for a service or resource.
2. Process: This involves sending data over the network to the server. For
example, a web browser requesting a web page from a web server.
2. Response:
1. Action: The server receives the client's request, processes it (which may
involve querying the database or performing some computation), and sends
back a response.
2. Process: The response might include HTML data for a web page, a JSON
object with requested data, or any other relevant information. The client
application then processes and displays this data to the user.