UNIT I: What is Operating System?
History and Evolution of OS, Basic OS functions, Resource
Abstraction, Types of Operating Systems– Multiprogramming Systems, Batch Systems, Time Sharing
Systems; Operating Systems for Personal Computers, Workstations and Hand-held Devices, Process
Control & Real time Systems.
UNIT-1
1. What is Operating System?
An Operating System (OS) is an interface between a user and computer hardware. An operating
system is a system software which performs all the basic tasks like file management, memory
management, process management, handling input and output, and controlling peripheral
devices such as disk drives and printers.
Generally, a Computer System consists of the following components:
Computer Users are the users who use the overall computer system.
Application Softwares are the softwares which users use directly to perform different
activities. These softwares are simple and easy to use like Browsers, Word, Excel,
different Editors, Games etc.
System Softwaresare the softwares which are more complex in nature and they are
more near to computer hardware.Operating Systems (Microsoft Windows, macOS, and
Linux).
Computer Hardwareincludes Monitor, Keyboard, CPU, Disks, Memory, etc.
Objectives of Operating System
1. To make the computer system convenient to use in an efficient manner.
2. To hide the details of the hardware resources from the users.
3. To provide users a convenient interface to use the computer system.
4. To act as an intermediary between the hardware and its users, making it easier for the users to
access and use other resources.
5. To manage the resources of a computer system.
6. To provide efficient and fair sharing of resources among users and programs.
2. Write about History and Evolution of Operating System
The history of the operating system is divided into four generations. Let us explore all of them in
detail, one by one, in the following sections:
1. First Generation of Operating System: UNIX Operating System
The UNIX Operating System was the first generation of modern computer operating systems. It was
designed in 1969 by Ken Thompson and Dennis Ritchie at Bell Labs, a research division of AT&T
Corporation. UNIX was originally written in assembly language.
Limitations of First-Generation Operating System:
Severely limited in capabilities
Could only run on a single type of computer
Did not support multitasking – users could only run one program at a time
2. Second Generation of Operating System: OS/360
The OS/360 operating system was developed in the early 1960s for IBM mainframes. It was a
comprehensive, multi-user, multitasking system that supported virtual memory and provided an
interface to a wide variety of peripheral devices.
3. Third Generation of Operating System: MS-DOS
Microsoft came up with their MS-DOS operating system in 1981.
It was a single-user, single-tasking operating system that ran on IBM personal computers.
4. Fourth Generation of Operating System: Windows
Microsoft released their first version of Windows, called Windows NT, in 1993.
It was a multi-user, multitasking operating system that replaced MS-DOS on IBM
personal computers.
Windows NT was based on the UNIX operating system and provided:
A Graphical User Interface (GUI)
Support for networking
In today’s world, we use Microsoft Windows as our standard operating system.
Advantages of Operating System:
Allows multiple users to access the computer simultaneously
Organizes and manages files
Provides a platform for software applications
Enables communication between computers and peripheral devices
Disadvantages of Operating System:
Can be expensive
Can require significant hardware resources
Vulnerable to malicious software attacks
3. Explain the Functions of Operating System
An Operating System (OS) is an interface between a user and computer hardware. It manages both
the hardware and software resources of a computer system and provides services for computer
programs.
Functions of Operating System:
1. Process Management
1. The operating system manages the creation, execution, and termination of processes (running
programs).
2. It ensures that each process gets a fair chance to use the CPU using scheduling algorithms.
3. The OS coordinates processes to work together in an organized and conflict-free manner.
4. It allocates necessary resources like memory, input/output devices, and files to each process.
5. The operating system handles multitasking efficiently, allowing multiple processes to run
smoothly at the same time.
6. It prevents and handles deadlocks by detecting and resolving resource conflicts.
7. The OS enables communication between processes using inter-process communication methods
like shared memory and message passing.
Key Components of Process Management:
Process Scheduling: The OS schedules processes using techniques like Round Robin or Priority
Scheduling to ensure fair CPU time and high performance.
Process Synchronization: The OS uses tools like semaphores, locks, and monitors to ensure
processes do not interfere with each other when accessing shared resources.
Deadlock Handling: The system prevents, detects, and recovers from deadlocks by using
techniques like resource allocation graphs or process termination.
Inter-Process Communication (IPC): Processes can exchange data and messages either
through shared memory or message passing, improving coordination and performance.
2. Memory Management
1. The operating system manages the main memory (RAM) and allocates memory to each process
as needed.
2. The OS deallocates memory once a process finishes execution.
3. It uses memory protection to prevent one process from accessing another process's memory
space.
4. The OS supports virtual memory, allowing the system to use disk space to simulate additional
RAM.
Key Components of Memory Management:
Main Memory Management:
The OS allocates memory using methods like paging or segmentation and ensures that memory
is protected and efficiently used.
Secondary Memory Management:
The OS manages storage devices like hard drives by organizing files, tracking free space, and
ensuring efficient read/write operations. It also provides backup and recovery services to
protect data.
3. File System Management
1. The operating system manages how files are stored, named, accessed, and secured on storage
devices.
2. It provides a logical structure of files and directories, making it easier for users to interact with
data.
3. The OS assigns attributes to files such as name, size, type, and permissions.
4. It supports various file types like text files, binary files, and executable files.
5. The OS allows operations on files such as creating, reading, writing, and deleting.
6. It supports different file access methods including sequential, direct, and indexed access.
Key Components of File System Management:
File Attributes:
Each file has properties like its name, size, extension, and permissions that determine access
rights.
File Operations:
The OS enables users to create new files, read contents, write data, and delete unwanted files.
Access Methods:
The system allows access in different ways: sequentially (from beginning to end), directly (jump
to a position), or using indexes for fast searching.
4. Device Management (Input/Output System)
1. The operating system controls and coordinates input/output devices like printers, disks, and
network cards.
2. It uses device drivers to communicate between the OS and the hardware.
3. The OS uses techniques like buffering to temporarily store data and reduce speed mismatch
between devices.
4. Caching is used to store frequently accessed data in faster memory for quicker retrieval.
5. The OS uses spooling to queue jobs (like print requests), allowing devices to process them one at
a time while the CPU continues other tasks.
Key Components of Device Management:
Device Drivers: Device drivers act as translators between hardware and software, with kernel-
space drivers offering faster performance and user-space drivers offering more safety.
Buffering and Caching: Buffering helps manage data flow between devices of different speeds,
while caching improves performance by storing commonly used data in faster memory.
Spooling: Spooling stores output jobs like print commands in a queue so they can be processed
one by one without delaying other system tasks.
5. Protection and Security
1. The operating system ensures that only authorized users or processes can access specific system
resources.
2. It uses access control methods to restrict usage based on user identity and assigned permissions.
3. The OS uses authentication methods like user IDs and passwords to verify the identity of users.
4. It protects resources such as memory, files, and devices from unauthorized or harmful access.
5. The OS provides security features to defend against external attacks like viruses, worms, and
denial-of-service (DoS) attacks.
Key Components of Protection and Security:
Access Control: The OS uses hardware and software techniques to restrict access to sensitive
areas and ensure resources are shared properly.
User Authentication: Authentication is done using unique identifiers like user IDs or passwords
to allow only authorized access.
Resource Protection: Systems are protected from unauthorized use by assigning correct access
rights to files and devices.
Security Against Attacks: The OS incorporates antivirus tools and firewalls to detect and
prevent cyber threats or malicious activity.
7. Control Over System Performance
1. Monitors system performance to ensure efficiency.
2. Measures response time and identifies bottlenecks.
3. Helps optimize CPU, memory, and I/O usage.
8. Job Accounting
1. Tracks usage of CPU time, memory, and I/O devices by each process or user.
2. Supports billing and auditing in multi-user systems.
3. Helps in fair resource allocation among users.
4. Provides usage reports for system administrators.
9. Error Detection and Handling
1. Detects hardware and software errors during execution.
2. Provides error messages, logs, and memory dumps for debugging.
3. Prevents system crashes by isolating faults.
4. Helps maintain system stability and reliability.
4) Explain different types of Operating Systems
1. Classification by Interface
a. CUI (Character User Interface) / CLI (Command Line Interface)
1. In a CUI or CLI operating system, the user interacts with the computer by typing commands in a
text-based interface.
2. It requires users to remember and enter commands accurately.
3. These systems are fast and lightweight, but not user-friendly for beginners.
4. Examples include MS-DOS and UNIX shell.
b. GUI (Graphical User Interface)
1. A GUI operating system allows users to interact with the computer through graphical elements
like windows, icons, buttons, and menus.
2. It is easy to use and supports multitasking and visual feedback.
3. GUI systems are more intuitive and widely used on personal computers and smartphones.
4. Examples include Windows, macOS, Ubuntu Desktop, and Android.
2. Classification by Interaction
a. Single-User Operating System
1. A single-user operating system allows only one user to use the computer at a time.
2. It does not support multiple user accounts or remote access.
3. These systems are commonly used in personal desktop computers.
4. Examples include MS-DOS and Windows 10 Home Edition.
b. Multi-User Operating System
1. A multi-user operating system allows multiple users to access the system resources
simultaneously or at different times.
2. Each user has a separate account and can run applications independently.
3. It is used in networked and server environments to manage multiple users effectively.
4. Examples include UNIX, Linux, and Windows Server.
3. Classification by Tasking
a. Single-Tasking Operating System
1. A single-tasking operating system can run only one program or task at a time.
2. It is simple and uses fewer system resources like memory and CPU.
3. These systems are outdated and rarely used today.
4. Example: MS-DOS.
b. Multi-Tasking Operating System
1. A multi-tasking operating system can run multiple tasks or processes at the same time.
2. It switches quickly between tasks, giving the appearance that they are running simultaneously.
3. This improves system efficiency and user productivity.
4. Examples include Windows, Linux, and macOS.
c. Multi-Processing Operating System
1. A multi-processing operating system can use more than one processor (CPU) at the same time.
2. It increases the speed and performance of the system by executing multiple processes in parallel.
3. These systems are used in high-performance computing and servers.
4. Examples include UNIX, Linux (on multiprocessor machines), and Windows Server editions.
4. Classification by Purpose
a. Desktop Operating System
1. A desktop operating system is designed for general-purpose use on personal computers and
workstations.
2. It supports a wide range of applications like browsing, editing, gaming, and productivity tools.
3. It usually includes a GUI and supports multitasking.
4. Examples include Windows 11, macOS, and Ubuntu.
b. Mobile Operating System
1. A mobile operating system is specifically designed for smartphones, tablets, and handheld
devices.
2. It supports touch-based input, sensors, mobile apps, and efficient battery management.
3. These systems are lightweight and optimized for wireless communication.
4. Examples include Android, iOS, and HarmonyOS.
c. Server Operating System
1. A server operating system is built to manage and serve multiple client machines or users over a
network.
2. It provides features like file sharing, user management, security, and database hosting.
3. These systems are more powerful and stable, suitable for enterprise and data center use.
4. Examples include Windows Server, Red Hat Enterprise Linux, and Ubuntu Server.
d. Real-Time Operating System (RTOS)
1. A real-time operating system is designed to process data and respond within strict time
constraints.
2. It is used in systems where timing is critical, such as robotics, medical devices, and embedded
controllers.
3. These systems are predictable, fast, and highly reliable.
4. Examples include FreeRTOS, RTLinux, and VxWorks.
e. Embedded Operating System
1. An embedded operating system runs on embedded systems or specialized hardware devices.
2. It is lightweight, fast, and optimized for specific functions.
3. These are used in devices like ATMs, smart TVs, washing machines, and industrial controllers.
4. Examples include Embedded Linux, Windows IoT, and QNX.
5. Explain Resource Abstraction?
An abstraction is software that hides lower-level details and provides a set of higher-level
functions.
Resources include the Central Processing Unit (CPU), memory, file storage, I/O devices, and
network connections.
Resource abstraction is a core concept in operating systems.
It means hiding the internal, complex details of hardware and resources from programs and
users and provides simple, uniform interfaces to the users and applications.
The operating system acts as a middleman between hardware and software.
It provides a simplified and consistent interface to access system resources.
Application programs can interact with resources without needing to know hardware details.
How Resource Abstraction Works
The operating system manages all system resources.
It gives users and programs a consistent interface for accessing them.
System calls are used to request resource operations.
System calls act as abstractions of the actual hardware operations.
Example:
open() system call – opens a file.
read() system call – reads data from a file.
EXAMPLES
1. File Systems
A program can write data to a file without knowing if it’s on an HDD, SSD, or network drive.
OS handles data storage and retrieval operations.
2. Printers
A program sends a document to print without knowing the printer’s specific commands.
OS translates generic print requests into the correct printer instructions.
6) Explain Multiprogramming system
1. Multiprogramming refers to the concept where more than one program can be active in memory
at the same time.
2. Earlier systems could run only one program at a time, which made the CPU sit idle during
input/output operations.
3. Multiprogramming improves efficiency by allowing the CPU to execute another process while
one is waiting for I/O.
4. This approach gives users the feeling that multiple programs are running simultaneously, even
though the CPU handles one at a time.
5. Most modern operating systems like Windows and Linux use multiprogramming.
Advantages
1. Multiprogramming increases the utilization of system resources like CPU and memory.
2. It allows multiple users to interact with the system simultaneously.
3. Several jobs are kept in memory at the same time, which reduces delays.
4. The overall system throughput is increased, meaning more jobs are completed in less time.
5. Programs spend less time waiting for CPU or I/O.
6. It improves the responsiveness of the system.
7. The system becomes more reliable and stable under multiprogramming.
8. It makes the operating system more suitable for multitasking environments.
Disadvantages
1. Multiprogramming requires knowledge of scheduling algorithms to decide which process should
be executed next.
2. If there are too many jobs in the system, some jobs may have to wait for a long time.
3. Proper memory management is necessary, as multiple processes need to share main memory.
4. Excessive use of multiprogramming may lead to system heating issues.
Working of a Multiprogramming OS
1. Multiple programs are loaded in memory as
separate processes.
2. The OS selects a ready process for CPU execution.
3. If a process needs I/O, it is moved to secondary
storage.
4. CPU switches to another ready process.
5. Once I/O is done, the previous process resumes.
6. Fast switching gives the illusion of simultaneous
execution.
7) Explain Batch systems
Batch Operating Systems (BOS) are a type of operating system that automates the execution of
programs in batches or groups with minimal user interaction.
These systems were common in the early days of computing when hardware resources were
limited and user input was done via punch cards or similar methods.
In a batch system, jobs are submitted together in a batch, and the operating system processes
them one by one without any user involvement
during execution.
Advantages of Batch Systems:
Efficiency: Batch systems allow efficient use of
system resources by minimizing idle CPU time.
The CPU remains busy as it processes jobs one
after another.
Resource Management: The operating system
handles job scheduling and resource allocation, making it easier to manage resources without
user input.
Cost-Effectiveness: These systems require less powerful hardware compared to interactive
systems, making them ideal for earlier, resource-constrained computers.
Disadvantages
1. Limited User Interaction:Once a job is submitted, users cannot interact with it. They must wait
for the entire batch to complete before seeing the results.
2. Slow Turnaround Time:Jobs may take a long time to finish, especially if they are queued behind
other higher-priority or resource-intensive tasks.
3. Error Handling:Debugging is difficult in batch systems because there is no real-time feedback
or interaction during job execution.
Modern Applications of Batch Systems:
1. Back-End Processing: Batch systems are still used for large-scale data tasks such as overnight
data processing and financial transactions.
2. Server Automation: Tasks like system backups and security scans are often automated and
executed in batches.
3. High-Performance Computing (HPC): Batch processing helps manage complex tasks like
scientific simulations and machine learning workloads that require distributed computing
resources.
8) Explain Time Sharing Systems
Time-sharing operating systems (OS) are designed to allow multiple users to access a single
computer system simultaneously.
This is achieved by dividing the CPU's time among different users' processes efficiently.
These systems are especially useful for creating multi-user environments on computers with a
single CPU.
Time-sharing allows the CPU to switch between different programs so quickly that it appears as
if they are all running at the same time.
Each program is given a short period of CPU time, called a time slice or quantum, to execute its
instructions.
Key Components :
1. Multiprogramming: Time-sharing is built on the
concept of multiprogramming, which enables the OS
to load and switch between multiple programs in
memory.
2. CPU Scheduling: The operating system uses
scheduling algorithms to decide which process gets
the CPU after each time slice expires.
o Priority Scheduling gives more CPU time to
high-priority processes.
o Round-Robin Scheduling distributes time slices equally among processes to maintain
fairness.
3. Time Slices: These are small fixed durations (typically 10 to 100 milliseconds) assigned to each
process to execute on the CPU.
4. Context Switching: When the CPU switches from one process to another, the OS saves the
current process's state and loads the next process’s state.
This switching happens frequently and contributes to the performance of time-sharing.
Benefits of Time Sharing Systems:
1. Increased CPU Utilization: By keeping the CPU busy with multiple processes, the system works
more efficiently.
2. Improved User Responsiveness: Users experience quicker response times because they can
interact with their programs even if other processes are running.
3. Resource Sharing: Users can share system resources like printers and disk space effectively.
Drawbacks of Time Sharing Systems:
1. Overhead: Constant context switching between processes causes some performance loss due to
overhead.
2. Starvation: Low-priority processes may have to wait for a long time if high-priority tasks
dominate CPU time.
Examples of Time-Sharing Operating Systems:
Unix and its variants like Linux
Multics (one of the earliest time-sharing systems)
9) Explain Operating System for Personal Computers?
1. Microsoft Windows
Market Share: Most popular OS for PCs, easy to use, and works with many apps and devices.
History: Made by Microsoft in the 1980s; now includes Windows 10 and 11.
Features: Graphical interface (windows, icons, menus), multitasking, device and security
management, and lots of software.
2. Apple macOS (Mac OS X)
Designed for Apple Computers: Comes with Apple desktops and laptops; known for stylish
design and ease of use.
History: Based on classic Mac OS, now uses a Unix base for better security and stability.
Features: Easy-to-use interface, multitasking, strong multimedia tools, and growing app
support.
3. Linux
Open and Free: Linux is free and open-source; known for flexibility and security.
Distributions: Many types, like Ubuntu, Mint, Fedora, and Debian.
Features: Many desktop styles, strong security, customization, and free software.
4. Chrome OS
Made by Google: Lightweight and fast, designed for online apps and cloud storage.
Hardware Integration: Often found in Chromebooks; works well with Google tools.
Features: Fast startup, simple interface, works well with Gmail, Drive, and Docs.
10 ) Write about Workstations and Hand-held Devices?
Workstations
1. Workstations are computers that are specifically configured to meet the most demanding
technical computing requirements.
2. To be considered a workstation, systems must include key capabilities related to performance,
reliability, data integrity, scalability, and expandability.
3. Workstations are most frequently used in creative, engineering, scientific, and financial services
industries.
Operating Systems for Workstations
1. Windows
Windows is a popular operating system developed by Microsoft.
It is widely used in personal computers, offices, and gaming systems.
Windows supports a large number of applications and provides a user-friendly interface.
2. macOS
macOS is developed by Apple and runs on Mac computers.
It is known for its sleek design, performance, and creative tools.
macOS integrates well with other Apple devices like iPhones and iPads.
3. Linux
Linux is an open-source operating system used by developers and servers.
It is known for its stability, security, and customization options.
Many distributions of Linux, like Ubuntu and Fedora, are available for different users.
4. UNIX
UNIX is a powerful, multiuser operating system used in servers and workstations.
It is known for its security, multitasking, and stability.
Many modern operating systems, including Linux and macOS, are based on UNIX.
Operating Systems for Handheld Devices
Mobile operating systems are made for smartphones, tablets, and other portable devices.
These systems are different from desktop OS in the following ways:
1. Resource Efficiency
Mobile devices have less power, memory, and battery than desktops.
Mobile OS uses power and resources carefully to work efficiently.
2. Touch-Centric Interfaces
Mobile OS supports touchscreens with gestures and on-screen keyboards.
3. Connectivity and Mobility
Mobile OS supports mobile data, Wi-Fi, Bluetooth, and GPS.
Apps use location and online services for a better experience.
History of Mobile Operating Systems
Early Systems (1990s–2000s)
Symbian OS: Popular on Nokia phones. Good battery life, but lacked features.
BlackBerry OS: Known for security and messaging. Not good for touch and apps.
Modern Systems (2000s–Now)
Android: Made by Google. Open-source and used in most smartphones. Customizable and
affordable.
iOS: Made by Apple for iPhones and iPads. Easy to use, secure, and works well with Apple
devices.
Windows Mobile: Made by Microsoft. It was once popular but is now discontinued.
11) Explain Process Control and Real-time Systems?
Process Control in Operating Systems
Process control refers to the management of how programs (or processes) are started, executed, and
terminated by the operating system.
One of the key functions of process control is process creation. When a program is launched, the
operating system allocates memory and other necessary resources, and it begins tracking the process to
manage it properly.
Another important function is process scheduling, where the operating system determines the order
in which processes should be executed. There are different scheduling strategies used:
First Come First Served (FCFS) scheduling allows processes to run in the order they arrive,
without prioritization.
Priority scheduling gives preference to processes that are more important, allowing them to
run before less critical tasks.
Round Robin scheduling assigns each process a fixed time slice in which to run, and then cycles
through all processes in order, ensuring fairness.
Process execution occurs when the CPU is assigned to a process and begins to carry out its
instructions until it completes or is interrupted.
Once a process has finished, process termination takes place. The operating system halts the process
and reclaims any resources it was using, such as memory and processing time.
In some cases, a process may need to be temporarily stopped and later continued. This is handled
through process suspension and resumption, which allows a process to pause and then restart
without losing its progress.
Benefits of Process Control
Effective process control provides several benefits. It helps the system use available resources, such as
CPU time and memory, more efficiently. It also improves the system’s responsiveness, ensuring that
tasks are completed in a timely manner. Additionally, process control enables safe and organized
sharing of memory and files among different processes, while also ensuring that one process does not
interfere with the operation of another.
Real-Time Operating Systems (RTOS)
A Real-Time Operating System (RTOS) is a type of operating system that is designed for
environments where the timing of operations is critical. These systems are commonly used in
applications such as medical devices, industrial automation, and factory control systems.
An RTOS prioritizes speed and timing accuracy over user interface features or visual design. It is
designed to respond to events or tasks within a guaranteed time frame, making it highly reliable for
time-sensitive operations.
Features of RTOS
RTOS have several key features:
Deterministic behavior ensures that the system responds to inputs or events within a
predictable and set time limit.
Minimal resource usage allows the RTOS to operate effectively even with limited power and
memory, which is often the case in embedded systems.
Task prioritization enables the system to process high-priority tasks before less important
ones.
Event-driven operation allows the RTOS to respond quickly to real-world events, such as
signals from sensors.
Applications of RTOS
RTOS are widely used in many fields. In industrial systems, they control machines and robotic
operations to ensure precision and safety. In embedded systems, RTOS are found in devices like
medical equipment, aircraft control systems, and Internet of Things (IoT) devices. In the field of
telecommunications, RTOS help manage phone calls, internet data routing, and time-sensitive
network operations.
Types of RTOS
There are two main types of RTOS:
A Hard RTOS is extremely strict with its timing requirements and is used in life-critical systems
such as aircraft control or surgical equipment, where even a small delay could lead to failure or
danger.
A Soft RTOS is more flexible and can tolerate small delays. It is typically used in general real-
time applications where strict timing is important but not absolutely critical.