Unit-1(OS)
Unit-1(OS)
Operating System:
An Operating System acts as a communication bridge (interface) between the user and
computer hardware. The purpose of an operating system is to provide a platform on which a
user can execute programs conveniently and efficiently.
The main goal of the Operating System is to make the computer environment more
convenient to use and the Secondary goal is to use the resources most efficiently.
Memory Management The operating system manages the Primary Memory or Main
Memory. Main memory is made up of a large array of bytes or words where each byte or
word is assigned a certain address. Main memory is fast storage and it can be accessed
directly by the CPU. For a program to be executed, it should be first loaded in the main
memory. An operating system manages the allocation and deallocation of memory to
various processes and ensures that the other process does not consume the memory
allocated to one process. An Operating System performs the following activities for Memory
Management:
● It keeps track of primary memory, i.e., which bytes of memory are used by
which user program. The memory addresses that have already been
allocated and the memory addresses of the memory that has not yet been
used.
I/O operation.
Processor Management In a multiprogramming environment, the OS decides the order in
which processes have access to the processor, and how much processing time each
process has. This function of the OS is called Process Scheduling. An Operating System
performs the following activities for Processor Management.
● An operating system manages the processor’s work by allocating various jobs to it
and ensuring that each process receives enough time from the processor to function
properly.
● Keeps track of the status of processes. The program which performs this task is
known as a traffic controller. Allocates the CPU that is a processor to a process. De-
allocates the processor when a process is no longer required.
● Decide which process gets access to a certain device and for how long.
● There are various input and output devices. An OS controls the working of
● It receives the requests from these devices, performs a specific task, and
File Management A file system is organized into directories for efficient or easy navigation
and usage. These directories may contain other directories and other files. An
The Operating System carries out the following file management activities. It keeps track of
where information is stored, user access settings, the status of every file, and more. These
facilities are collectively known as the file system. An OS keeps track of information
regarding the creation, deletion, transfer, copy, and storage of files in an organized way. It
also maintains the integrity of the data stored in these files, including the file directory
structure, by protecting against unauthorized access.
User Interface or Command Interpreter The user interacts with the computer system
through the operating system. Hence OS acts as an interface between the user and the
computer hardware. This user interface is offered through a set of commands or a graphical
user interface (GUI). Through this interface, the user interacts with the applications and the
machine hardware.
Booting the Computer The process of starting or restarting the computer is known as
booting. If the computer is switched off completely and if turned on then it is called cold
booting. Warm booting is a process of using the operating system to restart the computer.
Security The operating system uses password protection to protect user data and similar
other techniques. it also prevents unauthorized access to programs and user data. The
operating system provides various techniques which
assure the integrity and confidentiality of user data. The following security measures are
used to protect user data:
Control Over System Performance Operating systems play a pivotal role in controlling and
optimizing system performance. They act as intermediaries between hardware and software,
ensuring that computing resources are efficiently utilized. One fundamental aspect is
resource allocation, where the OS allocates CPU time, memory, and I/O devices to different
processes, striving to provide fair and optimal resource utilization. Process scheduling, a
critical function, helps decide which processes or threads should run when preventing any
single task from monopolizing the CPU and enabling effective multitasking.
Job Accounting The operating system Keeps track of time and resources used by various
tasks and users, this information can be used to track resource usage for a particular user or
group of users. In a multitasking OS where multiple programs run simultaneously, the OS
determines which applications should run in which order and how time should be allocated
to each application.
Error-Detecting Aids The operating system constantly monitors the system to detect errors
and avoid malfunctioning computer systems. From time to time, the operating system
checks the system for any external threat or malicious software activity. It also checks the
hardware for any type of damage. This process displays several alerts to the user so that
the appropriate action can be taken against any damage caused to the system.
Coordination Between Other Software and Users Operating systems also coordinate and
assign interpreters, compilers, assemblers, and other software to the various users of the
computer systems. In simpler terms, think of the operating system as the traffic cop of your
computer. It directs and manages how different software programs can share your
computer’s resources without causing chaos. It ensures that when you want to use a
program, it runs smoothly without crashing or causing problems for others. So, it’s like the
friendly officer ensuring a smooth flow of traffic on a busy road, making sure everyone gets
where they need to go without any accidents or jams.
Performs Basic Computer Tasks The management of various peripheral devices such as
the mouse, keyboard, and printer is carried out by the operating system. Today most
operating systems are plug-and-play. These operating systems automatically recognize and
configure the devices with no user interference.
Classification of Operating Systems:
Operating systems can be classified based on how they manage tasks, users, and
resources. Here are the main types:
Definition
A Batch Operating System groups similar jobs together and executes them without any user
interaction. Users submit jobs using punch cards or other input media, and the OS
processes them one by one.
Features
Advantages
Disadvantages
Examples
Use Cases
Definition
Interactive OS allows users to directly communicate with the computer through a user
interface, usually in real-time.
Features
Advantages
● User-friendly.
Disadvantages
● More resource-intensive.
Examples
Use Cases
Definition
Allows multiple users to share the system resources simultaneously by allocating fixed time
slots to each task.
Features
Advantages
Examples
● UNIX, Multics.
Use Cases
Definition
Designed to process data and deliver results within a guaranteed time frame, often critical
for applications where timing is crucial.
Types
● Soft Real-Time: More flexible but still time-sensitive (e.g., video streaming).
Features
Advantages
Disadvantages
● Limited multitasking.
Examples
Definition
Supports multiple CPUs (processors) working together, sharing the same memory and I/O
devices.
Features
Advantages
Disadvantages
● Expensive hardware.
● Complex OS design.
Examples
Use Cases
Definition
Allows multiple users to access and use the computer resources at the same time.
Features
● User isolation and data security.
Advantages
Disadvantages
Examples
Use Cases
Definition
Allows more than one program to reside in memory and be executed simultaneously by
managing CPU time efficiently.
Features
Advantages
Disadvantages
● Complex memory and process management.
Examples
Use Cases
Definition
Features
Advantages
Disadvantages
Examples
Use Cases
There are six layers in the layered operating system. A diagram demonstrating these layers
is as follows:
Hardware
This layer interacts with the system hardware and coordinates with all the peripheral devices
used such as printer, mouse, keyboard, scanner etc. The hardware layer is the lowest layer
in the layered operating system architecture.
CPU Scheduling
This layer deals with scheduling the processes for the CPU. There are many scheduling
queues that are used to handle processes. When the processes enter the system, they are
put into the job queue. The processes that are ready to execute in the main memory are kept
in the ready queue.
Memory Management
Memory management deals with memory and the moving of processes from disk to primary
memory for execution and back again. This is handled by the third layer of the operating
system.
Process Management
This layer is responsible for managing the processes i.e assigning the processor to a
process at a time. This is known as process scheduling. The different algorithms used for
process scheduling are FCFS (first come first served), SJF (shortest job first), priority
scheduling, round-robin scheduling etc.
I/O Buffer
I/O devices are very important in computer systems. They provide users with the means of
interacting with the system. This layer handles the buffers for the I/O devices and makes
sure that they work correctly.
User Programs
This is the highest layer in the layered operating system. This layer deals with the many user
programs and applications that run in an operating system such as word processors, games,
browsers etc.
Performance Overhead: Data and control must pass through multiple layers, possibly
reducing performance.
Complex Implementation: Requires strict planning to properly define layer responsibilities
and interfaces.
Dependency Issues: Layers must be carefully managed to prevent lower layers from
depending on higher layers.
Example of Layered OS:
The Operating System (developed by E.W. Dijkstra) — one of the first OSes to use the
layered design.
Modern OSes like UNIX and Windows have components inspired by layered design, though
they often use a combination of architectures.
1. Process Management
Purpose:
Responsibilities:
● Scheduling processes.
Example:
When you open multiple applications, the OS ensures each process gets a fair share of CPU
time.
2. Memory Management
Purpose:
Responsibilities:
Example:
When you open a new tab in a browser, the OS allocates memory for it.
Purpose:
Responsibilities:
Saving a Word document involves the file system managing where and how the file is
stored.
Purpose:
Controls and coordinates input/output devices like keyboards, mice, printers, and storage
devices.
Responsibilities:
Example:
When you print a document, the OS uses the printer driver to send the job to the printer.
Purpose:
Responsibilities:
● Free space management.
Example:
Storing data across multiple partitions on a hard drive is handled by this component.
6. Networking
Purpose:
Responsibilities:
Example:
Using a browser to access a website involves the networking component managing data
transmission over the internet.
7. User Interface
Purpose:
Allows users to interact with the system.
Types:
Responsibilities:
Example:
Purpose:
Responsibilities:
When you log into your account or restrict access to certain files.
Summary Table
Component Function
Operating systems provide a set of services to help both users and programs interact
effectively with the system hardware and resources. These services simplify the task of
managing hardware, files, programs, and data.
1. Program Execution
What it does: Loads programs into memory, executes them, and manages their execution
until completion.
Features:
2. I/O Operations
What it does: Manages input and output devices, like keyboard, mouse, printer, or storage.
Features:
What it does: Allows programs and users to create, read, write, delete, and manage files
and directories.
Features:
What it does: Enables processes to communicate with each other, either on the same
system or over a network.
Features:
What it does: Monitors the system for errors and takes appropriate action.
Features:
6. Resource Allocation
What it does: Manages and allocates CPU, memory, and I/O devices to different programs
and users.
Features:
● Scheduling algorithms.
7. Accounting
Features:
What it does: Protects system resources and data from unauthorized access.
Features:
● Data encryption.
Example: Logging into a user account securely, restricting access to private files.
Summary Table
Service Function
Protection & Security Safeguards against unauthorized access and ensures data
privacy
A Reentrant Kernel is a type of operating system kernel that allows multiple processes to
execute kernel code simultaneously without interfering with each other.
This means the kernel code is safe to re-enter — it can be interrupted in the middle of
execution and safely called again (“re-entered”) before the previous execution is complete.
Key Concept
How It Works
● When a process enters kernel mode (e.g., during a system call), it may be interrupted
by another process.
● The kernel ensures that the second process can also enter kernel mode without
corrupting shared resources.
Benefit Explanation
Disadvantages
Drawback Explanation
More resource usage Needs separate stacks and more control structures for each pr
1. Monolithic Kernel
Definition:
A Monolithic Kernel is a kernel architecture where the entire operating system runs in
kernel mode as a single large process. All the OS services (like process management,
memory management, file system, device drivers, etc.) are part of the kernel itself.
Key Features:
● Everything (scheduler, memory manager, I/O, drivers) runs in one address space.
● Faster because all services interact through direct function calls (no message
passing).
● Linux
● Unix
● MS-DOS
Advantages:
Feature Benefit
High performance Faster execution due to no context
switching.
Disadvantages:
Less secure A bug in one module can crash the whole system.
2. Microkernel
Definition:
A Microkernel is a kernel architecture where only the essential core functions run in
kernel mode — like CPU scheduling, inter-process communication (IPC), and basic memory
handling. Other services (drivers, file systems, etc.) run in user mode as separate
processes.
Key Features:
● Services communicate via message passing.
● QNX
● MINIX
● L4 microkernel family
Advantages:
Feature Benefit
Disadvantages:
Issue Why it matters
Complexity Simple concept, but large More modular, but complex IPC
codebase