UNIT 1
INTRODUCTION
Introduction: Basics of Operating Systems: Definition – Generations of
Operating systems – Types of Operating Systems, OS Service, System Calls
Basics of Operating System
Definition
A program that acts as an intermediary between a user of a computer and the
computer hardware. The purpose of an operating system is to provide an
environment in which a user can execute programs in a convenient and
efficient manner.
Functionality of OS
1. Process Management
• The OS handles the creation, scheduling, and termination of processes.
• It ensures that multiple processes can run efficiently without interfering with each other
(multitasking).
• Provides mechanisms for inter-process communication (IPC).
2. Memory Management
• The OS manages the computer’s memory, deciding which process gets memory and for how
long.
• It ensures that processes do not interfere with each other's memory.
• Uses techniques like paging, segmentation, and virtual memory to optimize memory usage.
Functionality of OS
3. File System Management
• The OS provides a way to store, retrieve, and manage files.
• It organizes files in a structured way using directories and file systems.
• Handles operations like creating, reading, writing, and deleting files.
4. Device Management
• The OS controls hardware devices such as printers, keyboards, and hard drives.
• It provides an interface for programs to interact with these devices through device
drivers.
• Manages input/output operations and handles device allocation and deallocation.
Functionality of OS
5. Security and Protection
• The OS ensures the protection of system resources and user data.
• It controls access to resources through mechanisms like authentication, encryption,
and user permissions.
• Prevents unauthorized access and ensures system integrity.
6. User Interface (UI)
• The OS provides a way for users to interact with the system, either through a
command-line interface (CLI) or a graphical user interface (GUI).
• The UI allows users to launch programs, manage files, and adjust system settings.
Functionality of OS
7. Networking
• The OS facilitates communication between devices over a network.
• Manages network connections and data transmission, enabling internet access and
local area network (LAN) communications.
8. Resource Allocation
• The OS allocates resources like CPU time, memory, and I/O devices to various
programs and users.
• Ensures that resources are used efficiently and fairly among all processes.
Generations of Operating Systems
1st Generation (1945 - 1955): Vacuum Tubes and Plugboards
Early computers used vacuum tubes for calculations. Programming was
manual, done via plugboards and machine language. Punch cards were
later introduced for input, improving system usability.
• Advantages:
• Pioneered the field of digital computing.
• Enabled basic numerical problem-solving.
• Drawbacks:
• Extremely slow, large, and complex to operate.
• No operating system or programming languages, making operations labor-
intensive.
2nd Generation (1955 - 1965): Transistors and Batch Systems
Transistors replaced vacuum tubes, increasing speed and reliability. Batch
systems allowed jobs to be processed in groups, reducing idle time and
improving efficiency.
• Advantages:
• Faster and more reliable than the first generation.
• Automated job processing improved system productivity.
• Drawbacks:
• No interactive user access; required human operators for job management.
• Still lacked real-time processing capabilities.
3rd Generation (1965 - 1980): Integrated Circuits and Multiprogramming
Integrated circuits significantly improved performance and reduced costs.
Multiprogramming allowed the CPU to execute multiple tasks
simultaneously, optimizing resource usage.
• Advantages:
• Increased efficiency through multiprogramming.
• More affordable and faster systems due to integrated circuits.
• Drawbacks:
• Complex OS designs required advanced skills to develop and maintain.
4th Generation (1980 - Present): Personal Computers and Networking
Personal computers became affordable and widely accessible. Networking
capabilities enabled resource sharing, leading to network and distributed
operating systems.
• Advantages:
• Affordable, user-friendly systems with graphical interfaces.
• Networking allowed communication and resource sharing across systems.
• Drawbacks:
• Security risks increased with network connections.
• Managing distributed systems became more challenging.
5th Generation (Present and Beyond): Artificial Intelligence and Cloud-
Based Systems
Modern systems integrate cloud computing, distributed resources, and
artificial intelligence (AI). These systems provide scalability, automation,
and access to resources from anywhere, supporting IoT and edge
computing.
• Advantages:
• AI improves efficiency through automation and predictive capabilities.
• Cloud-based systems are highly scalable and flexible.
• Enables collaboration and resource accessibility from any location.
• Drawbacks:
• Dependence on reliable internet connectivity.
• Increased risks to privacy and data security.
• Infrastructure and AI integration can be expensive.
Types of Operating System
•Batch Operating System
•Multiprogramming Operating System
•Multiprocessing Operating System
•Multitasking Operating System
•Network Operating System
•Real-Time Operating System (RTOS)
•Time-Sharing Operating System
•Distributed Operating System
Batch Operating System
• A Batch Operating System groups similar tasks into batches and processes them without user interaction.
Jobs are submitted as batches, and the OS processes them in the sequence they are received.
• How It Works:
• Users prepare jobs offline and submit them together as a batch.
• The OS executes one job at a time, without interruption, by reading the next job after the previous one is
completed.
• Since there is no user interaction during execution, the system processes jobs in a scheduled manner,
making it efficient for repetitive tasks.
Advantages Disadvantages
• Efficient for large, repetitive tasks. • No interaction with the user during processing.
• Reduces the time the CPU is idle. • Error detection is difficult as errors are identified only
• Cost-effective in terms of resources. after completing all jobs.
• Slow response time.
Multiprogramming Operating System
A Multiprogramming Operating System allows multiple programs to run concurrently on a single CPU by switching
between them, increasing CPU utilization. The CPU runs one program, while others wait for I/O operations to complete.
How It Works:
• Multiple programs are loaded into the system's memory at once.
• The CPU executes one program, and when it needs to wait for I/O, the OS switches to the next program in
memory.
• This ensures the CPU is always working on one program while others are either waiting or performing I/O tasks.
Advantages Disadvantages
• Increased CPU utilization. • Poor response time for users.
• Efficient use of system resources. • Context switching between programs can cause overhead.
• Limited by the amount of available memory.
Multiprocessing Operating System
A Multiprocessing Operating System uses two or more CPUs to execute multiple tasks simultaneously,
which can improve system performance.
How It Works:
• The OS splits tasks into smaller processes, which are executed on multiple processors.
• Multiple CPUs can either work on different tasks (parallel processing) or on the same task (shared
processing).
• Tasks can be distributed to ensure better performance and faster completion of complex jobs.
Advantages Disadvantages
• True parallel processing improves performance. • Expensive hardware (more CPUs).
• Scalability by adding more processors. • Complexity in managing multiple processors.
• Suitable for heavy-duty computing like scientific • Increased difficulty in synchronization and data sharing
simulations. between CPUs.
Multitasking Operating System
A Multitasking Operating System allows multiple tasks (or programs) to run simultaneously by
sharing system resources, such as CPU time. Each task is given a small time slice to execute, giving
the illusion of running concurrently.
How It Works:
•The OS assigns each task a small time slice (called a quantum) and switches between tasks rapidly.
•When one task is waiting for I/O, another task is processed by the CPU.
•The system continuously switches tasks, so it seems like multiple tasks are running simultaneously.
Advantages Disadvantages
• Fast response times for users. • Overhead caused by frequent context switching.
• Efficient use of system resources. • Complex to manage in systems with limited resources.
Network Operating System
A Network Operating System allows computers in a network to communicate and share resources
such as files, printers, and other devices. It manages the network and enables centralized control of
connected devices.
•How It Works:
•The OS manages both the local resources (like storage and CPU) and network resources.
•It allows computers to communicate over the network, share files, and access network services.
•A central server may manage user accounts, permissions, and resources across the network.
Advantages Disadvantages
• Centralized management of resources and users. • Network performance depends on the connectivity and
• Improved security and data sharing across multiple bandwidth.
devices • Complexity in managing large networks and resources.
Real-Time Operating System (RTOS)
A Real-Time Operating System (RTOS) is designed for applications that require precise timing
and high reliability, such as medical devices, industrial machines, or automotive systems.
• How It Works:
• RTOS processes tasks in real-time, meaning they must meet strict timing constraints.
• The system guarantees that critical tasks are completed within a specified time frame.
• RTOS uses priority scheduling to ensure high-priority tasks are completed first.
Advantages Disadvantages
• Predictable behavior with strict timing requirements. • Limited multitasking capabilities.
• Ideal for mission-critical systems (e.g., air traffic control, • High complexity in managing real-time constraints.
medical devices).
Time-Sharing Operating System
A Time-Sharing Operating System allows multiple users to share a computer’s resources
simultaneously. Each user gets a small portion of CPU time in a rotating manner, enabling them to
interact with the system in real-time.
How It Works:
• The CPU time is divided into small intervals, called time slices.
• Each user or task is allocated a slice of CPU time and is rotated quickly among all active users.
• The system gives each user the impression of exclusive use of the machine.
Advantages Disadvantages
• Multiple users can access the system at the same time. • Users experience delays as the system switches between
• Fair allocation of system resources. users.
• Performance may degrade with a high number of users.
Distributed Operating System
A Distributed Operating System manages a group of independent computers and makes them
appear as a single system to the users. It allows sharing of resources and coordination between
machines.
How It Works:
• The system consists of multiple machines (nodes) connected via a network, each running an
OS.
• A central control system manages the distribution of tasks, resources, and data across the nodes.
• Users interact with the system as though it is a single machine, even though their requests may
be processed across different machines.
Advantages Disadvantages
• High scalability by adding more nodes. • Complex to set up and manage.
• Fault tolerance, as tasks can be distributed to other • Network dependency can cause delays and
machines if one fails. failures if the network goes down.
System Call
• A system call is a mechanism that allows user-level processes to request
services from the operating system's kernel. It provides an interface
between an application and the OS, enabling access to hardware resources
such as files, memory, and processes in a controlled manner.
• When a system call is made, the process switches from user mode to
kernel mode, allowing privileged operations to be executed securely.
How System Calls works.
• The Applications run in an area of memory known as user space. A system
call connects to the operating system's kernel, which executes in kernel
space.
• When an application creates a system call, it must first obtain permission
from the kernel. It achieves this using an interrupt request, which pauses the
current process and transfers control to the kernel.
• If the request is permitted, the kernel performs the requested action, like
creating or deleting a file. As input, the application receives the kernel's
output.
• The application resumes the procedure after the input is received. When the
operation is finished, the kernel returns the results to the application and
then moves data from kernel space to user space in memory.
Types of System Calls
There are commonly five types of system calls. These are as follows:
1.Process Control
2.File Management
3.Device Management
4.Information Maintenance
5.Communication
1. Process Control System Calls
Process control system calls allow a program to create and terminate
processes, execute other programs, and manage process execution.
2. File Management System Calls
File management system calls allow programs to perform operations on
files, including opening, closing, reading, writing, and deleting them.
3. Device Management System Calls
Device management system calls enable applications to communicate
with hardware devices by reading, writing, or controlling them.
4. Information Maintenance System Calls
Information maintenance system calls allow processes to retrieve system-
related details and modify process attributes.
5. Communication System Calls
Communication system calls enable processes to communicate with each
other via shared memory, pipes, message queues, or sockets.