0% found this document useful (0 votes)
96 views145 pages

Operating System - Unit 1

Uploaded by

Rauank
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views145 pages

Operating System - Unit 1

Uploaded by

Rauank
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 145

UNIT 1: OPERATING

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

 1. Hardware – provides basic computing resources (CPU, memory, I/O


devices).
 2. Operating system – controls and coordinates the use of the
hardware among the various application programs for the various users.
 3. Applications programs – define the ways in which the system
resources are used to solve the computing problems of the users
(compilers, database systems, video games, business programs).
 4. Users (people, machines, other computers).
ABSTRACT VIEW OF SYSTEM COMPONENTS
HISTORY OF OS

 Early Computing Era (1940s-1950s):


1. 1940s:
 ENIAC OS (1945): One of the earliest electronic general-purpose computers,
ENIAC (Electronic Numerical Integrator and Computer), didn't have an
operating system as we think of today. Programming was done by manually
setting switches and connecting cables.
2. 1950s:
 Batch Processing Systems: Computers like UNIVAC I and IBM 701 used
batch processing systems. Programs and data were submitted in batches on
punched cards or magnetic tapes and processed sequentially.
Development of Early Operating Systems (1960s-1970s):
1.Early 1960s:
• CTSS (Compatible Time-Sharing System): Developed at MIT in 1961, CTSS allowed
multiple users to interact with a computer simultaneously through terminals, pioneering
the concept of time-sharing.
2.Late 1960s:
• Multics (Multiplexed Information and Computing Service): Developed in the late
1960s, Multics was a pioneering effort in creating a multi-user, multi-tasking operating
system. It influenced many subsequent OS designs.
3.1970s:
• UNIX (1970s): Developed at Bell Labs by Ken Thompson, Dennis Ritchie, and others in
the early 1970s, UNIX introduced concepts like hierarchical file systems, shell
programming, and multi-tasking. It became highly influential in subsequent OS
development.
• CP/M (Control Program for Microcomputers): Developed by Gary Kildall in 1974,
CP/M was one of the first widely adopted operating systems for microcomputers, laying
the foundation for personal computing.
• MS-DOS (1981): Developed by Microsoft, MS-DOS (Microsoft Disk Operating System)
became the standard operating system for IBM PCs and compatible computers in the
1980s. It used a command-line interface and was later succeeded by Windows.
GUI and Modern Operating Systems (1980s-Present):
1.1980s:
• Macintosh System Software (1984): Apple introduced the Macintosh with a graphical user
interface (GUI), setting a new standard for user-friendly computing environments.
• Windows (1985): Microsoft launched Windows as a graphical extension for MS-DOS, leading to the
widespread adoption of GUI-based operating systems in personal computers.
2.1990s-2000s:
• Linux (1991): Linus Torvalds developed the Linux kernel, based on UNIX principles and released it
under an open-source license. Linux has since become widely used in servers, embedded systems,
and as a desktop OS.
• Windows NT (1993): Microsoft introduced Windows NT as a more advanced, multitasking operating
system designed for both servers and workstations, laying the foundation for modern Windows
versions.
• Mac OS X (2001): Apple transitioned to Mac OS X, based on UNIX, combining stability, security, and
a modern GUI, which evolved into macOS.
3.2000s-Present:
• Mobile OS (iOS, Android): The rise of smartphones led to the development of iOS by Apple and
Android by Google, both based on UNIX/Linux, dominating the mobile operating system market.
• Cloud OS (Chrome OS, Server OS): Chrome OS by Google introduced a cloud-based operating
system model for laptops, while server OS like Windows Server and Linux distributions became
essential for data centers and cloud computing.
Recent Trends and Future
Directions:
1. Virtualization and Containerization: Technologies like virtual
machines (VMs) and containers (e.g., Docker) are reshaping OS
deployment and management, enabling efficient use of hardware
resources and application deployment.
2. IoT (Internet of Things): OS tailored for IoT devices (e.g., embedded
Linux distributions) are becoming critical for managing interconnected
devices and sensors.
3. Security and Privacy: Modern OS continue to evolve to address
cybersecurity challenges, focusing on data protection, secure boot
processes, and user privacy.
IMPORTANCE OF OS

 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

 A single-user operating system is an OS that is designed to manage the


computer so that one user can effectively use it at a time.
 It does not support multiple users simultaneously.
 Single user system uses I/O devices such as keyboards, mice, display
screens, scanners, and small printers.
 Examples: Early versions of MS-DOS, Mac OS, and early versions of
Windows (e.g., Windows 95, 98)
Advantages & Disadvantages
 Advantages:
1. Simplicity: Easier to design and use, as they cater to the needs of a single user.
2. Security: Less risk of unauthorized access since only one user operates the system.
3. Performance: Dedicated resources for one user lead to better performance for that
user’s tasks.
4. Cost-Effective: Typically cheaper to maintain and support compared to multi-user
systems
 Disadvantages:
1. Resource Underutilization: Resources may be underutilized if the system is not
used to its full capacity by the single user.
2. Limited Scalability: Cannot accommodate multiple users or shared workloads.
3. Single Point of Failure: If the single user encounters a problem, there is no
immediate support system within the OS to resolve it quickly.
4. Lack of Multi-User Capabilities: Inability to support collaborative or concurrent
work by multiple users.
BATCH SYSTEM

 Batch operating systems manage jobs by collecting them and then


executing them one by one.
 Users prepare their jobs on an offline device like a punch card or tape,
and submit them to the computer operator.
 The operator sorts the jobs into batches with similar needs and submits
them to the computer.
 The system processes each batch automatically.
 1950s-1960s: Developed during the early days of computing to handle
large-scale data processing tasks. Mainframe computers were expensive
and resource-intensive, making batch processing a practical solution.
System space contains OS code and data currently
is use and user scape contains user programs
(process).
In case of batch system, there is only 1 process
because 1 process is executing at a time.
Advantages & Disadvantages
 Advantages:
1. Efficient Resource Utilization: Maximizes CPU usage by processing jobs during
idle times.
2. Automated Processing: Reduces the need for human intervention, allowing
continuous job execution.
3. Throughput: Can handle large volumes of jobs efficiently.
4. Cost-Effective: Minimizes costs by running multiple jobs in one go, reducing idle
time and resource waste.
 Disadvantages:
1. No User Interaction: Users cannot interact with their jobs once they are
submitted, making it difficult to handle errors or make adjustments.
2. Debugging Difficulty: Errors are hard to detect and correct since jobs are
processed without user interaction.
3. Turnaround Time: Longer turnaround time since jobs are processed in batches,
not immediately.
TIME SHARING

 A time-sharing operating system is a type of operating system that


allows multiple users to access a computer system concurrently by
rapidly switching between them.
 This ensures that each user gets a small slice of the CPU's time, making
it seem as though the computer is dedicated to them alone.
 Each user has atleast one separate program in memory.
 It is time-sharing, multi user, multi process, and interactive system.
 To obtain a reasonable response time, jobs may be swapped in and out
of memory.
Key Features of Time-Sharing
Operating Systems
 Multitasking:
• Multiple tasks (or processes) are executed simultaneously by sharing the CPU time.
• The CPU switches between tasks so quickly that it gives the illusion that tasks are
running concurrently.
 Interactive Computing:
• Users can interact with the system directly and get immediate responses.
• Ideal for environments where multiple users need to access the system
simultaneously, such as educational institutions and business organizations.
 Fair Allocation of Resources:
• The operating system ensures that resources are fairly allocated among users.
• Time slices, or time quanta, are allocated to each user or process, ensuring no
single user monopolizes the system.
 Preemptive Scheduling:
• The operating system can interrupt and preempt the CPU from a
running process to assign it to another process.
• This ensures that high-priority tasks are executed promptly.
 User-Friendly:
• Designed to be user-friendly with command-line interfaces or
graphical user interfaces.
• Users can run programs, edit files, and access system resources
seamlessly.
How Time-Sharing Operating Systems
Work
 Time Slice Allocation:
• Each user or process is given a time slice or quantum, a short duration during
which the CPU executes its instructions.
• When a time slice expires, the operating system switches to the next task.
 Context Switching:
• The process of saving the state of a currently running task and loading the state
of the next task.
• This involves saving the program counter, registers, and other key data of the
current task and restoring those of the next task.
 Scheduling Algorithms:
• Different algorithms can be used to determine which process gets the CPU next,
such as Round Robin, Priority Scheduling, or Multilevel Queue Scheduling.
• These algorithms help in efficient CPU utilization and fair resource allocation.
ADVANTAGES OF TIME SHARING OS
 Efficiency:
• Maximizes CPU utilization by ensuring it is always busy executing tasks.
• Minimizes idle time of the CPU, leading to better overall performance.
 User Convenience:
• Provides a responsive and interactive environment for users.
• Users can perform multiple operations simultaneously, enhancing
productivity.
 Resource Sharing:
• Allows multiple users to share system resources, reducing the cost per user.
• Facilitates collaboration and resource utilization across different users and
processes.
 Reduced Idle Time:
• Minimizes idle time for both the CPU and the users, leading to more efficient
computing.
DISADVANTAGES OF TIME SHARING O
S
 Complexity:
• System Complexity: Time-sharing systems are complex to design, implement, and
maintain. They require sophisticated algorithms for scheduling, resource allocation,
and process management.
• Software Complexity: Developing and debugging software for time-sharing
systems can be more challenging due to the need for concurrency control and
synchronization
 Performance Overhead:
• Context Switching: Frequent context switching between tasks adds overhead.
Saving and loading the state of processes consumes CPU time, potentially reducing
overall system efficiency.
• Resource Management: Managing shared resources such as memory, I/O devices,
and storage can introduce additional overhead, impacting system performance.
 Security and Privacy Concerns:
• Data Privacy: Since multiple users share the same system, there is a risk of
data breaches or unauthorized access to sensitive information.
• System Security: Time-sharing systems are more vulnerable to security
threats like hacking, malware, and viruses, as multiple users access the
system concurrently.
 Resource Contention:
• Resource Conflicts: Multiple users competing for limited system resources
(CPU, memory, I/O devices) can lead to contention, causing delays and
reduced performance.
• Fairness Issues: Ensuring fair allocation of resources among users can be
challenging, especially when some tasks require more resources than others.
 Reliability and Availability:
• System Reliability: A failure in a time-sharing system can affect multiple
users simultaneously, potentially causing significant disruptions.
• Availability: Ensuring high availability of the system is critical, as downtime
affects all users. This requires robust fault tolerance and recovery
mechanisms.
EXAMPLE

 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

 A multitasking operating system is a type of operating system that


allows multiple tasks or processes to run concurrently on a single CPU.
 It is designed to maximize the use of the CPU and improve system
efficiency by switching between tasks so quickly that it appears as if
they are running simultaneously.
Key Features of Multitasking
Operating Systems
 Concurrent Execution:
• Multiple tasks are executed at the same time, with the CPU switching between
them rapidly.
• Tasks can be applications, processes, or threads.
 Task Scheduling:
• The operating system uses scheduling algorithms to determine the order in
which tasks are executed.
• Common algorithms include Round Robin, Priority Scheduling, and Shortest
Job Next.
 Resource Management:
• The operating system manages system resources (CPU, memory, I/O devices)
to ensure efficient and fair allocation among tasks.
• Includes mechanisms for resource sharing and avoiding conflicts.
Key Features of Multitasking
Operating Systems
 Preemptive and Cooperative Multitasking:
• Preemptive Multitasking: The operating system can interrupt and suspend
a running task to start or resume another task, ensuring higher-priority tasks
get CPU time.
• Cooperative Multitasking: Tasks voluntarily yield control of the CPU,
typically when they are waiting for I/O operations to complete.
How Multitasking Operating Systems Work

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

 Responsive User Experience:


 Provides a responsive and interactive experience as tasks are quickly switched, and the
system remains responsive to user inputs.
 Ensures that applications remain responsive even when multiple processes are running.

 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

 A multiprogramming operating system is designed to maximize CPU


utilization by running multiple programs simultaneously. The key idea
behind multiprogramming is to keep the CPU busy by ensuring that it
always has some work to do. When one program is waiting for I/O
operations to complete, the CPU can switch to another program that is
ready to execute.
Key Components of
Multiprogramming
 Job Pool:
• The job pool is a collection of all the jobs (programs) waiting to be
loaded into memory for execution.
• Jobs in the pool are typically stored on a secondary storage device (like
a hard drive) and are waiting for an opportunity to be executed.
• The operating system selects jobs from the job pool based on
scheduling criteria and loads them into memory when space becomes
available.
 Memory Management:
• Memory management is critical in multiprogramming as multiple
programs need to reside in memory simultaneously.
• Techniques such as partitioning, paging, and segmentation are used to
allocate memory efficiently and manage the memory space.
 CPU Scheduling:
• The operating system uses scheduling algorithms to determine which program gets to
use the CPU at any given time.
• Common scheduling algorithms include First-Come, First-Served (FCFS), Shortest Job
Next (SJN), Priority Scheduling, and Round Robin.
 Context Switching:
• When the CPU switches from executing one program to another, it performs a context
switch.
• This involves saving the state (context) of the current program (e.g., program counter,
CPU registers) and loading the state of the next program to be executed.
 I/O Management:
• The operating system manages I/O operations efficiently to ensure that the CPU is not
idle while waiting for I/O devices to complete their tasks.
• When a program requests I/O operations, it is placed in a waiting state, and the CPU is
allocated to another ready program.
How Multiprogramming Works
•Job Submission:
•Users or system administrators submit jobs to the system. These jobs are placed in the job pool on
secondary storage.
•Job Selection:
•The operating system selects jobs from the job pool based on scheduling criteria, such as job priority,
estimated execution time, or arrival time.
•Selected jobs are loaded into main memory when there is sufficient space.
•Execution and Context Switching:
•Once in memory, jobs are scheduled for execution by the CPU.
•The operating system switches between jobs using context switching, ensuring the CPU is always
executing a job and never idle.
•Handling I/O Operations:
•If a job requires I/O operations, it is placed in a waiting state. The CPU then switches to another job
that is ready to execute.
•When the I/O operation completes, the job is moved back to the ready state and can be scheduled for
execution again.
•Job Completion:
•Jobs continue to execute, get preempted, and resume execution until they complete.
•Completed jobs are removed from memory, and new jobs from the job pool are loaded into memory.
Advantages of Multiprogramming
Operating Systems
•Increased CPU Utilization:
•Ensures the CPU is always busy by executing another job when one is
waiting for I/O.

•Improved System Throughput:


•More jobs are processed in a given amount of time compared to single-
program systems.

•Better Resource Utilization:


•Efficiently uses memory, I/O devices, and other system resources.

•Reduced Waiting Time:


•Programs spend less time waiting for CPU or I/O operations to complete,
improving overall system performance.
Disadvantages of Multiprogramming
Operating Systems
•Complexity:
•More complex to design and maintain due to the need for efficient scheduling,
memory management, and context switching.

•Resource Contention:
•Multiple programs competing for limited resources can lead to contention and
reduced performance.

•Security and Protection Issues:


•Programs need to be isolated to prevent interference and ensure security.

•Debugging and Testing:


•More challenging to debug and test programs due to concurrent execution.
MULTI TASKING VS MULTI PROGRAMMING
Aspect Multitasking OS Multiprogramming OS
Allows a single user to run multiple tasks Allows multiple programs to be loaded into memory and run
Definition
simultaneously. concurrently.
Improve responsiveness and efficiency for a
Primary Goal Maximize CPU utilization by keeping it busy with multiple programs.
single user.
Multiple programs running, which may serve multiple users or a
User Context Single user running multiple applications.
single user.

Resource Manages CPU, memory, and I/O for tasks of a


Manages CPU, memory, and I/O for multiple programs.
Management single user.
Uses various algorithms like Round Robin,
Scheduling Uses job scheduling algorithms like FCFS, SJN, Priority Scheduling to
Priority Scheduling to allocate CPU time to
Algorithms allocate CPU time to programs.
tasks.
Context Frequently switches between tasks of a single Switches between multiple programs, each of which may belong to
Switching user. different users or services.

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

 A multiprocessing operating system is designed to use two or more


central processing units (CPUs) within a single computer system.
 These systems can execute multiple processes simultaneously, which
significantly improves performance and reliability.
 Multiprocessing can be implemented in various forms, such as
symmetric multiprocessing (SMP) and asymmetric multiprocessing
(AMP), each with its own characteristics and advantages.
Key Features of 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

•Symmetric Multiprocessing (SMP):


•All CPUs are treated equally and share the same memory and I/O
resources.
•Each CPU runs its own process but can also access processes in other
CPUs.
•The operating system’s scheduler distributes the workload evenly across all
CPUs.
•Asymmetric Multiprocessing (AMP):
•specific tasks. One CPU is designated as the master, while others are
subordinate processors.
•The master CPU controls the system and assigns tasks to subordinate
CPUs.
•The subordinate CPUs do not have equal access to system resources and
are used for
SMP VS AMP
Aspect Symmetric Multiprocessing (SMP) Asymmetric Multiprocessing (AMP)
CPU
All CPUs are treated equally. One CPU is the master, and others are subordinate.
Equality
Task
Distributio Tasks are distributed evenly among all CPUs. The master CPU controls and assigns tasks to subordinate CPUs.
n
Memory All CPUs share the same memory space and have equal The master CPU has full access to memory; subordinate CPUs may
Access access to it. have limited or no access.
No single CPU controls the system; control is The master CPU has control over the system and manages the
Control
decentralized. operation of subordinate CPUs.
Load The operating system dynamically balances the load
Load balancing is managed by the master CPU.
Balancing across all CPUs.
More complex to implement due to the need for efficient Simpler to implement since the master CPU manages the system
Complexity
synchronization and resource sharing among equal CPUs. and assigns tasks.
Fault Higher fault tolerance as failure of one CPU does not halt
Lower fault tolerance; failure of the master CPU can halt the system.
Tolerance the system; others can take over.
Performanc Generally higher performance due to efficient use of all Potentially lower performance due to reliance on the master CPU for
e CPUs. task distribution.
Less scalable; adding more CPUs may require reconfiguring the
Scalability Highly scalable; additional CPUs can be added easily.
master-subordinate relationship.
Communica CPUs communicate and coordinate directly with each
Subordinate CPUs typically communicate through the master CPU.
tion other.
Modern versions of Linux, Windows, and UNIX operating Early versions of some operating systems and specialized embedded
Examples
systems. systems.
Resource Higher potential for resource contention due to equal
Lower resource contention as tasks are managed by the master CPU.
Contention access.
Synchroniz Requires sophisticated synchronization mechanisms to
Simpler synchronization, as the master CPU coordinates tasks.
ation ensure data consistency and prevent race conditions.
How Multiprocessing Operating
Systems Work
 Process Allocation:
• The operating system allocates processes to available CPUs based on
scheduling algorithms.
• In SMP, processes can be dynamically assigned to any CPU, while in AMP, the
master CPU assigns tasks to subordinates.
 Memory Management:
• All CPUs share a common memory space in SMP, allowing any CPU to access
the same memory locations.
• In AMP, memory may be divided, and only the master CPU has full access.
How Multiprocessing Operating
Systems Work
 Inter-Process Communication (IPC):
• Processes running on different CPUs need to communicate and synchronize
with each other.
• IPC mechanisms such as semaphores, message queues, and shared memory
are used.
 Load Balancing:
• The operating system ensures that the workload is evenly distributed across
all CPUs.
• Load balancing helps to prevent any single CPU from becoming a bottleneck.
Advantages of Multiprocessing
Operating Systems
•Enhanced Performance:
•Multiple CPUs working in parallel can handle more processes and tasks
simultaneously, leading to improved performance.

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

•Efficient Resource Utilization:


•Efficient use of system resources by balancing the workload across multiple
processors.
Disadvantages of Multiprocessing Operating
Systems

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

Handles memory allocation for multiple programs,


Memory Each CPU may have its own memory cache; Handles memory allocation for multiple tasks
possibly using techniques like paging or
Management shared memory is used. within a single user’s context.
segmentation.
True parallelism with multiple CPUs working
Parallelism Pseudo-parallelism as tasks share a single CPU. Pseudo-parallelism as programs share a single CPU.
simultaneously.
Typical Use High-performance computing, servers, Personal computers, smartphones, user-facing Mainframes, servers, large-scale computing
Cases mainframes. applications. environments.
Modern multi-core processors, high- Unix, IBM OS/360, early versions of Windows (e.g.,
Examples Windows, macOS, Linux on personal devices.
performance servers. Windows 3.x).

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

 An online operating system (OS) typically refers to cloud-based or web-


based operating systems that allow users to access and manage their
files, applications, and resources over the internet.
 These operating systems leverage cloud computing technologies to
provide a platform-independent, accessible-from-anywhere experience.
Key Features of Online Operating
Systems
•Cloud-Based Infrastructure:
•The core components and resources of the OS are hosted on remote servers in
the cloud.
•Users access the OS through a web browser or a dedicated client application.

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

•Collaboration and Sharing:


•Facilitates real-time collaboration and file sharing among users.
•Provides tools for simultaneous editing, communication, and project
management.

•Reduced Local Resource Dependency:


•Minimizes the need for powerful local hardware, as most processing is done on
remote servers.
•Suitable for devices with limited storage and processing capabilities.
Advantages of Online Operating Systems

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

•Automatic Backups and Recovery:


•Data is regularly backed up on remote servers.
•Simplifies disaster recovery and data retrieval.

•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

 A Real-Time Operating System (RTOS) is designed to serve real-time


applications that process data as it comes in, typically without buffer
delays.
 These operating systems are used in environments where timing is
crucial, and they are required to handle events or data within a strict
deadline.
 The main objective of an RTOS is to ensure a predictable response to
events within a specified time constraint.
Key Features of Real-Time Operating
Systems
•Deterministic Behavior:
•Guarantees that specific operations are completed within a defined time frame.
•Ensures predictable response times to real-time events.

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

•Minimal Interrupt Latency:


•Designed to handle interrupts quickly and efficiently.
•Minimizes the delay between the occurrence of an interrupt and the start of the interrupt
handler.
Key Features of Real-Time Operating
Systems
•Multi-Tasking:
•Supports concurrent execution of multiple tasks.
•Ensures that tasks are managed and executed in a way that meets their
timing constraints.

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

•Real-Time Clocks and Timers:


•Utilizes precise timing mechanisms to track and manage task execution
times and deadlines.
•Supports high-resolution timers for accurate time measurements.
Types of Real-Time Operating
Systems

•Hard Real-Time Systems:


•Requires that all critical tasks are completed within their deadlines.
•Missing a deadline can lead to catastrophic consequences.
•Examples: Aerospace control systems, medical devices, industrial automation.

•Soft Real-Time Systems:


•Allows some flexibility in meeting deadlines.
•Missing a deadline may degrade performance but does not lead to catastrophic failure.
•Examples: Multimedia systems, online transaction systems.
Advantages of Real-Time Operating
Systems
•Predictability:
•Ensures that tasks are completed within their deadlines, providing predictable and
reliable performance.

•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

 A Distributed Operating System (DOS) manages a collection of


independent, networked, communicating, and physically separate
computational nodes.
 They provide the illusion of a single coherent system to the user, making
the distributed nature of the underlying hardware transparent.
 The key goal is to enable the sharing of resources and information
across the network while providing reliability, flexibility, and efficiency.
Key Features of Distributed Operating
Systems

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

•Reliability and Fault Tolerance:


•The system can detect and recover from failures, ensuring continuous operation.
•Redundant components and data replication enhance reliability.

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

•Reliability and Fault Tolerance:


•System continues to operate even if some nodes fail.
•Fault-tolerant design ensures data integrity and availability.

•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

 System View refers to how the operating system manages and


controls the hardware and software resources(CPU, memory
space, file storage space, I/O devices etc.) of the computer. This
view focuses on the internal mechanisms, processes, and
architecture of the operating system.
 Tell what are the expectations of designer of OS from hardware
point of view. (100% utilization of resources )
 The OS acts as a manager of these resources, facing numerous
and possibly conflicting requests for resources, the OS must
decide how (and when) to allocate (and deallocate) them to
specific programs and users so that it can operate on the
computer system efficiently, fairly and securely.
Key Aspects of 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

Aspect User View System View


Efficient management of system
Focus Ease of use and user interaction
resources

Interface GUI or CLI for user interaction System calls and kernel interfaces

Primary Users End users and application users System administrators, developers

Resource Detailed management of CPU, memory,


Abstracted, user-friendly controls
Management I/O

Task Management Running applications, managing windows Process scheduling, memory allocation

Access control, encryption, system


Security User authentication, simple permissions
protection

Managing file descriptors, kernel


Example Actions Opening a file through a file explorer
routines
VIEWS

 Views refer to the different perspectives or interfaces through which


users and applications interact with the system. These views can be
categorized based on the level of interaction and the methods used to
perform operations. The main types of views are:
1. Command Language User Views
2. System Call User Views
Command Language User Views
 Command language user views provide a text-based interface for users to
interact with the operating system.
 This interaction is typically done through a command-line interface (CLI) or
shell, where users type specific commands to perform various tasks such as
managing files, running programs, and configuring system settings.
 Key Characteristics:
• Text-Based Interaction: Users input commands via a terminal or command prompt.
• Syntax and Commands: Users need to learn and understand the syntax and
available commands of the operating system.
• Scripting: Users can create scripts (a series of commands saved in a file) to
automate repetitive tasks.
• Immediate Feedback: The system provides immediate feedback for each command
executed, either in the form of results or error messages.
EXAMPLS (UNIX/LINUX)

•ls /home/user/documents: Lists all files and directories in the specified path.

•cp source.txt destination.txt: Copies the file source.txt to destination.txt.

•rm oldfile.txt: Deletes the file oldfile.txt.

•mkdir newfolder: Creates a new directory named newfolder.


Windows Commands

• dir C:\Users\YourUsername\Documents: Lists all files and directories in the specified path.

• copy source.txt destination.txt: Copies the file source.txt to destination.txt.

• del oldfile.txt: Deletes the file oldfile.txt.

• mkdir newfolder: Creates a new directory named newfolder.


SYSTEM CALL USER VIEW
 System call user views involve interaction with the operating system at a
lower level, usually through programming.
 System calls are the primary interface between user programs and the
operating system kernel.
 They allow programs to request services such as file manipulation, process
control, and communication directly from the OS.
 Key Characteristics:
• Programming Interface: Interaction is done through code, where system calls are
invoked in programs.
• Direct Kernel Access: Provides direct access to the operating system's kernel and
its services.
• Abstracted Hardware Interaction: System calls abstract the complexities of
hardware management, allowing programs to perform tasks without needing to
manage hardware directly.
• Critical for System Functionality: Essential for performing fundamental
operations like reading/writing files, creating processes, and managing memory.
EXAMPLE
 OPENING A FILE

 READING FROM FILE

 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

•Description: These are user-level programs that provide various functionalities.


•These programs provide the main functionality that users interact with. They rely on the underlying OS to
handle hardware and system resources.

•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

•Description: Core components of MS-DOS that remain resident in memory


while the system is running.
•Examples: COMMAND.COM, system utilities.
•Role: Provide essential services and user interfaces. COMMAND.COM, the
command-line interpreter, processes user commands and executes built-in
commands or launches programs. Other resident utilities provide system
maintenance functions.
DEVICE DRIVERS

•Description: Software components that allow the OS to


communicate with hardware devices.

•Examples: HIMEM.SYS (extended memory manager),


ANSI.SYS (console driver for advanced text features).

•Role: Facilitate interaction between the operating system and


hardware devices, managing I/O operations and ensuring devices
work correctly. These drivers are loaded during system startup via
the CONFIG.SYS file.
ROM BIOS DEVICE DRIVERS

• Description: Basic Input/Output System (BIOS) routines stored in ROM


(Read-Only Memory).

• Examples: BIOS routines for disk access, keyboard input, screen output.

• Role: Perform low-level hardware initialization during the boot process


and provide runtime services for fundamental hardware operations. The
BIOS acts as an intermediary between hardware and the higher layers of
the operating system.
SUMMARY
•Application Programs: Provide user-level functionality and
rely on system services.
•Resident System Programs: Core utilities and command
interpreter (COMMAND.COM) that manage basic operations.
•MS-DOS Device Drivers: Allow the OS to interface with
hardware devices and manage I/O operations.
•ROM BIOS Device Drivers: Perform hardware initialization
and provide low-level hardware control and services.
ADVANTAGES

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

•Direct Hardware Access:


•Control: Programs can directly access hardware resources, which can be useful for certain
types of applications like games and system utilities.

•Low Memory Footprint:


•Efficiency: MS-DOS occupies very little memory, leaving more available for applications.
DISADVANTAGES

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

•Limited Memory Management:


•Conventional Memory Limit: MS-DOS is limited to accessing 640 KB of conventional
memory without additional drivers or extenders.
•No Built-in Virtual Memory: There is no support for virtual memory, leading to
constraints on the amount of memory available for applications

•Limited User Interface:


•Command-Line Interface: The text-based interface is less user-friendly than graphical
user interfaces (GUIs) found in later operating systems.
•Security Issues:
• No User Privileges: MS-DOS lacks user accounts and permissions, making it less secure as any
program has full access to system resources.
• Susceptibility to Viruses: The lack of built-in security mechanisms makes MS-DOS systems more
vulnerable to malware.

•Poor Hardware Abstraction:


• Device Dependency: Programs often need to include hardware-specific code, making them less
portable.
• Driver Management: Managing and configuring device drivers can be cumbersome and error-prone.

•File System Limitations:


• File Naming Constraints: The 8.3 filename convention (eight-character name and three-character
extension) is restrictive.
• No Built-in Support for Advanced File Systems: MS-DOS primarily supports the FAT file system,
which lacks the features and robustness of more advanced file systems.
MONOLITHIC OPERATING SYSTEM

USER SPACE APPLICATIONS


LIBRARIES
KERNEL SPACE FILE SYSTEMS
INTER PROCESS COMMUNICATIONS
I/O AND DEVICE MANAGEMENT
FUNDAMENTAL PROCESS MANAGEMENT
HARDWARE
USER APPLICATIONS
•Description: The topmost layer where user programs run.

•Examples: Word processors, web browsers, games, and other software


applications.

•Role: These applications interact with the system libraries and the kernel to
perform tasks.

•Functionality: Provide the main features and functionalities that users


interact with. These rely on the underlying system services provided by the
OS.

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

•Interaction: Provide a layer of abstraction that allows applications to perform various


tasks without needing to interact directly with the kernel.
KERNEL SPACE

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.

•Security and Protection:


•User Authentication: Verify user identities to control access to system resources.
•Access Control: Enforce permissions and security policies to protect system integrity and user data.
ADVANTAGES
 Performance:
 Direct Communication: Components within the kernel can call each other's functions
directly without the need for messaging or context switching, leading to faster execution of
system calls and operations.
 Efficient Resource Management: Since everything operates within a single address space,
the overhead associated with switching between user and kernel modes is reduced.
 Simplicity in Design:
 Unified Codebase: Having all the operating system components in one large codebase
simplifies the design and can make certain types of development and debugging easier.
 Ease of Access: Direct access to hardware and system resources can be more
straightforward to implement compared to more modular designs.
 Better Resource Utilization:
 Memory Usage: Memory is often used more efficiently as there is no need to maintain
separate address spaces for different components.
 Speed:
 Fast Boot Times: The OS can start up quickly due to its compact and tightly integrated
nature.
DISADVANTAGES

•Complexity and Maintenance:


•Large Codebase: As the OS grows and more features are added, the kernel can become
very large and complex, making it difficult to manage and maintain.
•Tightly Coupled Components: Changes in one part of the system can have unexpected
impacts on other parts, leading to potential instability and bugs.

•Stability and Security Risks:


•Single Point of Failure: Since all components run in the same address space, a bug in any
part of the kernel can potentially crash the entire system.
•Vulnerability Exposure: More code running in kernel mode means a larger attack surface
for potential security vulnerabilities.
•Lack of Modularity:
•Difficult to Extend: Adding new features or modifying existing ones can be
challenging as it often requires changes to the entire kernel.
•Limited Scalability: The monolithic structure can become unwieldy as the
system grows, potentially leading to scalability issues.

•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

 Layered Structure is a type of system structure in which the different


services of the operating system are split into various layers, where
each layer has a specific well-defined task to perform. It was created to
improve the pre-existing structures like the Monolithic structure ( UNIX )
and the Simple structure ( MS-DOS ).
 A layered operating system is designed to simplify the structure of the
operating system by dividing it into distinct layers, each with a specific
function and level of abstraction. This approach enhances modularity,
maintainability, and clarity, as each layer performs a well-defined role
and interacts only with adjacent layers.
Structure of Layered Operating
System
 User Interface (UI) Layer:
•Description: The topmost layer where users interact with the operating system.
•Examples: Command-line interfaces (CLI) or graphical user interfaces (GUI).
•Role: Provides tools for users to interact with the system, such as command interpreters, window
managers, and desktop environments.

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

 System Call Interface Layer:


•Description: Serves as the interface between user applications and the kernel.
•Examples: APIs and system call interfaces.
•Role: Provides standard methods for user applications to interact with the kernel functions, such as
file manipulation, process control, and network communication.
 Kernel Layer:
• Description: The core layer that manages the system resources and hardware.
• Components:
• Process Management: Handles process creation, scheduling, and termination.
• Memory Management: Manages memory allocation, paging, and segmentation.
• File System Management: Controls file operations and storage management.
• Device Management: Manages device drivers and I/O operations.
• Security and Protection: Enforces access controls and security policies.
• Role: Executes core functions and manages hardware resources efficiently.

 Hardware Abstraction Layer (HAL):


• Description: Provides an abstraction of the hardware for the kernel.
• Examples: Virtualization layers, device drivers, and firmware interfaces.
• Role: Hides the complexities of the hardware from the kernel, ensuring compatibility and
simplifying hardware interaction.

 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 Command-Line Interface (CLI) is a user interface that allows users to


interact with the operating system or software applications by typing
commands into a console or terminal.
 CLIs require users to input text commands to perform specific tasks.
 Key Characteristics of CLI
1. Text-Based Interaction
2. Command Syntax
3. Prompt
4. Commands and Utilities
5. Scripting and Automation
 Text-Based Interaction
 In a CLI, users type text commands to interact with the system. This
interaction occurs in a console or terminal window, where the user types a
command and the system responds with text output.
 Command Syntax
Commands in a CLI follow a specific syntax that usually includes:
 Command Name: The primary keyword that tells the system what
operation to perform.
 Options/Flags: Modifiers that alter the behavior of the command. These are
typically preceded by a hyphen (-) or double hyphen (--).
 Arguments: Additional information or parameters that the command
operates on, such as file names or directories.
 EXAMPLE : ls -l /home/user/documents
 ls: Command to list directory contents.
 -l: Option to use long listing format.
 /home/user/documents: Argument specifying the directory to list.
 Prompt
 The prompt is a symbol or series of characters that indicate the CLI is ready to accept a
command. It typically includes information such as the current user and directory.
 Commands and Utilities
CLIs provide a wide range of commands and utilities that perform various tasks. These
can be broadly categorized into:
 File Management: Commands for manipulating files and directories.
 ls: List directory contents.
 cp: Copy files or directories.
 mv: Move or rename files or directories.
 rm: Remove files or directories.

 Process Management: Commands for managing processes.


 ps: Display current processes.
 kill: Terminate a process.
 top: Display real-time process information.
 System Information: Commands for retrieving system information.
 df: Display disk space usage
 .free: Display memory usage.
 uname: Display system information.

 Network Management: Commands for network configuration and troubleshooting.


 ping: Test network connectivity.
 ifconfig: Configure network interfaces.
 netstat: Display network connections and statistics.

 Scripting and Automation


One of the most powerful features of a CLI is the ability to automate tasks through
scripting. Shell scripts are text files containing a series of commands that the CLI can
execute sequentially.
 EXAMPLE: Script: A script can automate the installation of software packages and
dependencies. Automation: This script can be used to deploy applications
consistently across multiple systems.
ADVANTAGES & DISADVANTAGES OF CLI
 Advantages of CLI
1. Efficiency: Experienced users can perform complex tasks quickly with concise
commands.
2. Scriptability: Commands can be combined into scripts for task automation.
3. Resource Usage: CLIs are lightweight and consume fewer system resources compared
to GUIs.
4. Remote Management: CLI can be used over network connections (e.g., SSH) for remote
system management.
 Disadvantages of CLI
1. Learning Curve: CLI requires users to memorize commands and syntax, which can be
challenging for beginners.
2. User-Friendliness: CLIs are less intuitive than GUIs, making them less accessible to non-
technical users.
3. Error-Prone: Typing errors or incorrect command syntax can lead to unintended
consequences, including data loss.
GRAPHICAL USER 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.

 Widgets and Controls


GUIs use widgets and controls to facilitate interaction and display information:
• Text Boxes: Input fields for entering text or numeric data.
• Scroll Bars: Controls for navigating content within windows.
• Checkboxes and Radio Buttons: Selecting options from lists or toggling settings.
• Sliders and Progress Bars: Adjusting values or indicating progress of tasks.
• Dropdown Menus: Selecting options from a list of choices.
 Event-Driven Programming
GUIs operate on an event-driven model where actions by the user
(clicking, typing) or the system (time-based events, data changes)
trigger responses:
• Event Handlers: Functions or procedures that respond to specific user
interactions or system events.
• User Feedback: GUIs provide visual and auditory feedback (like
notifications or animations) to indicate actions or changes.
ADVANTAGES AND DISADVANTAGES OF GUI

 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

 A system call is a fundamental interface between an operating system


(OS) and user programs or applications.
 It allows user-level processes to request services from the operating
system kernel, which is the core of the OS responsible for managing
hardware resources and providing essential services.
PURPOSE OF SYSTEM CALLS
 System calls provide a way for user programs to access operating system
functionality that is not directly accessible through normal application code. They
serve several essential purposes:
1. Resource Management: System calls manage and allocate system resources such as
CPU time, memory, files, and I/O devices.
2. Process Control: They control the execution of processes, including creating,
terminating, and scheduling processes.
3. File Management: System calls handle operations on files and directories, such as
creating, opening, reading, writing, and deleting files.
4. Device Management: They manage and control devices, including accessing hardware
devices such as printers, disks, and network interfaces.
5. Information Maintenance: System calls provide functions to retrieve information
about the system, processes, and resources.
HOW SYSTEM CALLS WORK
 When a user program needs to perform a privileged operation (one that requires
access to system resources managed by the kernel), it initiates a system call. Here’s
an overview of how system calls typically work:
1. User Program Request: The user program makes a request for a service (e.g., opening a
file, creating a new process) through a high-level function call in its code.
2. Trap to Kernel Mode: The CPU switches from user mode to kernel mode (also known as
supervisor mode or privileged mode). This mode allows the CPU to execute privileged
instructions and access protected resources.
3. System Call Invocation: The system call number and parameters are passed to the kernel
via a well-defined mechanism (e.g., registers, stack).
4. Execution in Kernel Space: The kernel executes the requested operation on behalf of the
user program. It validates parameters, performs the requested operation, and manages
resources as necessary.
5. Return to User Mode: After the system call completes, control returns to the user program,
typically with a return value indicating the status of the operation (success or failure).
Examples of System Calls

•File System Calls:


•open(), close(), read(), write(), seek(): Manage files and file descriptors.

•Process Control Calls:


•fork(), exec(), exit(), wait(): Create and manage processes.

•Memory Management Calls:


•brk(), mmap(): Allocate and manage memory resources.

•Device Management Calls:


•ioctl(), read(), write(): Communicate with hardware devices

•Network Management Calls:


•socket(), connect(), send(), recv(): Establish and manage network connections.
CLIENT SERVER MODEL

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

You might also like