Introduction to Operating System
Unit-1
Operating System
An Operating System (OS) is software that acts as an interface between
computer hardware components and the user.
Every computer system must have at least one operating system to run other
programs.
Applications like Browsers, MS Office, Notepad Games, etc., need some
environment to run and perform its tasks.
“The OS helps you to communicate with the computer without knowing how
to speak the computer’s language. It is not possible for the user to use any
computer or mobile device without having an operating system.”
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 1
Introduction to Operating System
Unit-1
Functions/Features/Need/Services of Operating
System
Process Management.
Memory Management.
File Management.
Device Management.
User Interface.
Security and Access Control.
Networking.
Error Handling and Debugging.
I/O device Management
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 2
Introduction to Operating System
Unit-1
1. Process management: Process management helps OS to create and
delete processes. It also provides mechanisms for synchronization and
communication among processes.
2. Memory management: Memory management module performs the
task of allocation and de-allocation of memory space to programs in
need of these resources.
3. File management: It manages all the file-related activities such as
organization storage, retrieval, naming, sharing, and protection of files.
4. Device Management: Device management keeps tracks of all devices.
This module also responsible for this task is known as the I/O
controller. It also performs the task of allocation and de-allocation of
the devices.
5. I/O System Management: One of the main objects of any OS is to
hide the peculiarities of those hardware devices from the user.
6. Secondary-Storage Management: Systems have several levels of
storage which includes primary storage, secondary storage, and cache
storage. Instructions and data must be stored in primary storage or
cache so that a running program can reference it.
7. Security: Security module protects the data and information of a
computer system against malware threat and authorized access.
8. Command interpretation: This module is interpreting commands
given by and acting system resources to process that commands.
9. Networking: A distributed system is a group of processors which do
not share memory, hardware devices, or a clock. The processors
communicate with one another through the network.
10. Job accounting: Keeping track of time & resource used by various job
and users.
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 3
Introduction to Operating System
Unit-1
11. Communication management: Coordination and assignment of
compilers, interpreters, and another software resource of the various
users of the computer systems.
Features of Operating System (OS)
Protected and supervisor mode
Allows disk access and file systems Device drivers Networking
Security
Program Execution
Memory management Virtual Memory Multitasking
Handling I/O operations
Manipulation of the file system
Error Detection and handling
Resource allocation
Information and Resource Protection
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 4
Introduction to Operating System
Unit-1
Classification/Types of Operating System
Serial
Processing OS
Distributed
Batch OS
OS
Network OS Interactive OS
Classification/Types
of OS
Multi-tasking
Real Time OS
OS
Multi-
Time -sharing
Programming
OS
OS
Multi-
Processing OS
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 5
Introduction to Operating System
Unit-1
Serial Processing OS:-In serial processing OS jobs enter in serial
pattern (one-by-one) into the computer memory.
The next job cannot be entered into computer memory until the first
job residing in memory gets executed completely.
Advantage:-
It develops programs directly by converting instructions into
binary code.
It controls I/O
Batch Operating System :- In the 1970s, Batch processing was
viral. In this technique, similar types of jobs were batched together and
executed in time. People were used to having a single computer, which
was called a mainframe.
In the Batch operating system, access is given to more than one person;
they submit their respective jobs to the system for execution.
The system puts all of the jobs in a queue on the basis of first come, first
serves and then executes the jobs one by one. The users collect their
respective output when all the jobs get executed.
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 6
Introduction to Operating System
Unit-1
Advantages of Batch OS
o It has increased efficiency, like a resident monitor that eliminates
CPU idle time between jobs to enable it to smoothen the switching
of tasks.
o The automatic handling of the processing of jobs means that users
should not take control to intervene in whatever is going on while
running or executing tasks.
o The resources, such as the CPU and the memory, are utilized and
not left idle.
o It goes well with the payroll as well because it keeps processing
jobs in batches without any time wastage and hard work.
o It can also perform even very huge complex jobs without any
intermission because it simply streams without any intermission,
even when the task is excessively intensive.
o Group jobs as 'batches' remove most of the manual setup that had
to be done in between individual tasks, thereby saving time.
o It logs and deals with errors at the time when the batch is over.
This allows the system to run even without intermissions.
Disadvantages of Batch OS
Not Interactive
Delayed Output
Difficult to Debug
It Requires Knowledge of Job Scheduling
Large Jobs Cause Delays
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 7
Introduction to Operating System
Unit-1
Multiprogramming Operating System
Multiprogramming is an extension to batch processing where the CPU is
always kept busy. Each process needs two types of system time: CPU
time and IO time.
In a multiprogramming environment, when a process does its I/O, The
CPU can start the execution of other processes. Therefore,
multiprogramming improves the efficiency of the system.
Advantages of Multiprogramming OS
o Throughout the system, it increased as the CPU always had one
program to execute.
o Response time can also be reduced.
o Multiprogramming maximizes the utilization of resources like
memory, I/O devices, and processing power since more than one
program can be kept alive at any time.
o Since several jobs are being processed in parallel, significantly
more tasks could be completed within a certain amount of time,
thus enhancing the overall throughput of the system.
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 8
Introduction to Operating System
Unit-1
o During times when a program is waiting for I/O operations, the
processor does not go idle since it jumps on to another task to
continue processing.
o The system can support both short and long tasks to be executed in
parallel, which makes for a more dynamic and productive
processing environment.
Disadvantages of Multiprogramming OS
o Multiprogramming systems provide an environment
in which various systems resources are used
efficiently, but they do not provide any user
interaction with the computer system.
o Multiple programs increase system complexity, as
the operating system needs to manage multiple
processes, memory management, and scheduling.
o It requires more memory compared to less
sophisticated operating systems because multiple
programs run in memory simultaneously.
o The operating system has to switch between the
running processes continuously, and this leads to
scheduling overhead and reduces performance.
o As several concurrent operations access shared
resources simultaneously, the system is likely to
experience deadlocks: two or more processes waiting
for each other for further actions.
o Resource contention due to competition for scarce
resources could degrade performance.
Multiprocessing Operating System
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 9
Introduction to Operating System
Unit-1
In Multiprocessing, Parallel computing is achieved. There are more
than one processors present in the system which can execute more
than one process at the same time. This will increase the
throughput of the system
Advantages of Multiprocessing Operating System:
o Increased Reliability: Because multiple processors are present, if
one fails, others may take over it, thus stabilizing the system.
o Increased Throughput: More jobs can be processed at the same
time by these multiple processors than by a single processor,
thereby increasing the speed of execution.
o Efficient Resource Utilization: It acts more productively upon the
utilization of resources like CPU, memory, and I/O devices.
o Parallelism: Many processes can run parallel, which increases the
speed of execution to a large extent.
o Scalability: As the workload increases, more processors can be
added to enhance performance.
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 10
Introduction to Operating System
Unit-1
Disadvantages of Multiprocessing Operating System:
o Complexity: There is a rise in the complexity of the system while
dealing with a number of processors and proper distribution of
tasks.
o Increased Cost: Hardware equipment added in multiprocessing
systems increases their cost
o Communication Overhead: Generally, communication among
processors results in overhead and provides a slight reduction in
efficiency.
o Software Compatibility Problems: Generally, most software is
not designed to operate properly with multiprocessing systems.
Multitasking Operating System
Multiprogramming extended the multitasking operating system concept,
which enabled various programs to run simultaneously. It provided a
user with the ability to do more than one task on the same system at a
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 11
Introduction to Operating System
Unit-1
given time by sharing various system resources like CPU time among
different processes. This assures efficient use of the CPU because it
shifts between tasks quickly; hence, it seems that they are running
parallel.
There are multitasking systems in almost all personal computers where,
for example, a user might run a web browser, a music player, and a
document editor all at once.
Advantages of the Multitasking Operating System:
o This system can handle multiple users or tasks at once; therefore, it
is best utilized in multi-user environments.
o The memory is allocated dynamically and efficiently to various
tasks so that there is optimal usage of system resources.
o More applications can be run at the same time, which increases
productivity because tasks are executed concurrently.
o It provides for rapid shifts between tasks, therefore, shortening the
response time for the user.
o Because the system keeps running by switching between tasks,
CPU time and other system resources are consumed more
effectively.
Disadvantages of Multitasking Operating System:
o The multitasking environment makes a number of processors
busier at the same time; that is, the CPU generates more heat.
o The managing of different tasks all together requires a more
sophisticated algorithm, which becomes complex to administer.
o Running too many applications at the same time can stress the
system to a point where performance degrades.
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 12
Introduction to Operating System
Unit-1
o In this scenario, multiple tasks will be competing for the same
resources, thereby delaying them.
o Multitasking systems usually require more powerful hardware,
especially in terms of memory and processing power, to run
without a hitch.
Network Operating System
NOS allows devices not only to communicate but also to share
software applications, files, and hardware so everyone in the
network can have what they need without a complicated setup.
Examples of network operating systems are Microsoft Windows
Server, Linux, and Novell NetWare.
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 13
Introduction to Operating System
Unit-1
Advantages of Network Operating Systems
o Since network applications are split between the clients and the
servers, this minimizes the total number of communications on the
network, thus increasing performance.
o Configuring as well as maintaining an NOS is less expensive than
other elaborate systems since shared resources reduce duplication
needed.
o A NOS grants centralized control over data, security, and resource
management. That means that administrations may easily manage
a large network.
o Scaling of the systems can be made easily in terms of organization
growth. Easly, new clients or servers can be added without
reconfiguring the system.
o It shares resources like printers, files, and applications, which
reduces hardware and software redundancy.
Disadvantage of Network Operating System
o If one node or server fails, it affects the whole system, and network
functions will be interrupted. Hence, reliability is important.
o Security needs to be robust so that unauthorized access is
restricted. Complex security measures demand constant monitoring
and updating.
o The skilled network administrators involved will handle system
performance, security configurations, and troubleshooting.
o When the network size is too large, and traffic is heavy, it degrades
with time if it's not monitored and maintained, which is constantly
demanding attention.
o This is because an attacker, once able to gain access to one server,
comes close to achieving his goal for multiple resources contained
in the entire network.
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 14
Introduction to Operating System
Unit-1
Real Time Operating System
A Real-Time Operating System is conceived as a design for tasks that
need to be completed under very strict time constraints. In such systems,
each task has a clear deadline; failing to achieve completion by that
deadline can, in turn, bring about significant consequences. Completion
by the deadline may result in either a critical failure or something no
longer of relevance, again depending on the application, thus leading to
inefficiencies or even dangers in its application.
Real-time systems are widely used in areas where timing is the issue, for
example, the manufacturing of medical equipment, automotive controls,
or even industrial automation. For instance, in an anti-lock braking
system (ABS) in a car, the response must come in milliseconds in order
to assure safety.
Advantages of Real-Time Operating System:
o Real-time applications are quite easy to design, develop, and
implement under a real-time operating system.
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 15
Introduction to Operating System
Unit-1
o Maximum utilization of devices and systems in a Real-Time
Operating System.
o Fast response to events.
o High reliability in the performance of time-critical operations.
o Strict scheduling ensures the predictable execution of tasks.
Disadvantages of Real-Time Operating System:
o Real-time operating systems are very expensive to design.
o Real-time operating systems are very resource-intensive and
consume critical CPU cycles.
o Less multitasking support.
o Lacks adaptability to new functions.
o At times, it demands specific hardware.
Time-Sharing Operating System
A Time-Sharing Operating System allows multiple users to access the
system concurrently, and this occurs by allocating a small time slice or
quantum to each task. The CPU switches between the tasks so rapidly
that the users feel their programs have been running concurrently. This
kind of operating system is most effective in systems where multiple
users require access to the central system in real-time or near real-time.
Advantages of Time-Sharing Operating System
o The time-sharing operating system facilitates effective utilization
and sharing of resources.
o This system helps decrease CPU idle and response time.
o It allows various users to access and interact with their programs at
the same time, and it leads to greater productivity.
o Time-sharing assures better memory management because it swaps
programs into and out of main memory efficiently.
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 16
Introduction to Operating System
Unit-1
o An interactive computing environment provides users with real-
time access to their programs and files.
Disadvantages of Time-Sharing Operating System
o Data transmission rates compared to others are very high
o The integrity and security of the user programs loaded in memory
and data have to be ensured since many users access the system
concurrently.
o Implementation as well as management of time-sharing systems is
more complicated than others since there is a tendency for task
scheduling and memory management.
o Since more and more users get hooked to the system, it degrades
due to resource contention.
o However, with time, context switches between tasks will incur
overheads, thereby impacting the overall efficiency of the system.
Distributed Operating System
The Distributed Operating system is not installed on a single machine; it
is divided into parts, and these parts are loaded on different machines. A
part of the distributed Operating system is installed on each machine to
make their communication possible. Distributed Operating systems are
much more complex, large, and sophisticated than Network operating
systems because they also have to take care of varying networking
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 17
Introduction to Operating System
Unit-1
protocols.
Advantages of Distributed Operating System
o The distributed operating system offers resource sharing.
o This is a fault-tolerant system.
o Scalability is achieved and easily new nodes can be added to the
system.
o Distributed task execution improves its performance.
o Parallel processing helps in increasing the speed of job execution
and enhances efficiency in getting results.
Disadvantages of Distributed Operating System
o Protocol overhead might control computation costs.
o The managing of the system is complex as it works in distributed.
o Security may prove difficult on multiple nodes.
o The system highly depends on network stability for it to run
without hassles.
Operating System Structure-Layered Structure
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 18
Introduction to Operating System
Unit-1
The layered structure of the operating system is a successor to the early
monolithic operating system. In it, the whole working of an operating
system is split into various simpler layers and all of these layers handle
some specific type of task (functionality) to be performed for executing
a job. There are certain rules that we must need to consider while
designing a layered structure of an operating system. These are as
follows:
The outermost layer should be the user interface layer.
The innermost layer should be the Hardware layer.
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 19
Introduction to Operating System
Unit-1
Advantages of Layered Structure
Modularity- There is a limitation to every layer as each layer will
do its task only that it is designed for.
Easy debugging- Since the tasks are specific for every layer, it is
easy to debug.
Easy update- Since all the layers are limited to themselves only,
updating is easy as it does not affect any other layers near it.
No direct access to hardware- If we want to access the hardware
directly, it is not possible in the layers structure design. The
process needs to travel through each layer one by one before
reaching the hardware layer
Abstraction- Each layer of the layered structure has its function so
here we can see abstraction.
Disadvantages of Layered Structure
Complex and careful implementation- In this structure, a
particular layer can access the service of a layer that is below it, so
the placement and arrangement of the layers should be done
precisely so that a task can execute in a good flow throughout the
layers.
Slower execution- In this structure, we cannot access a layer
directly that is away from a particular layer. There is a request
generated that allows the process to travel from one layer to
another layer. So, the execution takes time in this structure. The
response time increased here which is not seen in earlier
monolithic systems.
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 20
Introduction to Operating System
Unit-1
Kernal
Kernel is the important part of an Operating System. The kernel is the
first program that is loaded after the boot loader whenever we start a
system. The Kernel is present in the memory until the Operating System
is shut-down.
Kernel provides an interface between the user and the hardware
components of the system. When a process makes a request to the
Kernel, then it is called System Call.
Functions of Kernal
The functions of the kernel are as follows −
Process management
Access computer resources
Device management
Memory management
Interrupt handling
I/O communication
File system...etc.
Types of Kernal
Reentrant Kernal
A reentrant kernel allows multiple processes to execute kernel code concurrently,
enabling the system to remain responsive and efficient, especially when dealing with
I/O operations.
A reentrant kernel is a kernel design that allows multiple processes to
be in kernel mode (executing kernel code) simultaneously.
Key Features:
Concurrency: Processes can give up the CPU while in kernel mode,
allowing other processes to enter kernel mode and execute kernel code.
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 21
Introduction to Operating System
Unit-1
No Contention: There's no contention for the kernel itself, as multiple
processes can access it without blocking each other.
Improved Performance: This concurrency leads to better system
responsiveness and reduced CPU time wasted on I/O wait.
Advantages of Reentrant Kernels:
Improved CPU Utilization:
Reentrant kernels allow the CPU to be used more effectively by
allowing multiple processes to be in kernel mode concurrently, rather
than having one process block the entire kernel.
Enhanced Responsiveness:
By allowing processes to enter and exit kernel mode quickly, reentrant
kernels contribute to a more responsive system, as processes don't have
to wait for the kernel to complete its current task before accessing
system resources.
Simplified Kernel Design:
Reentrant kernels can simplify the kernel design by allowing for more
flexible and modular code, as different parts of the kernel can be used
by multiple processes without requiring complex locking mechanisms.
Better Support for Multithreading:
Reentrant kernels are well-suited for operating systems that support
multithreading, as multiple threads can execute kernel code
concurrently without conflicts.
Disadvantages of Reentrant Kernels:
Increased Complexity:
Implementing a reentrant kernel can be more complex than
implementing a non-reentrant kernel, as it requires careful management
of shared resources and potential race conditions.
Potential Overhead:
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 22
Introduction to Operating System
Unit-1
The overhead associated with managing shared resources and context
switching can be higher in reentrant kernels, potentially leading to
performance bottlenecks.
Debugging Challenges:
Debugging reentrant kernels can be more challenging, as concurrency
issues can be difficult to identify and resolve.
Increased Memory Usage:
Reentrant kernels may require more memory to store the state of
multiple processes that are in kernel mode concurrently.
Monolithic Kernel
The monolithic kernel manages the system's resources between the
system application and the system hardware. Unlike the microkernel,
user and kernel services are run in the same address space. It increases
the kernel size and also increases the size of the OS.
The monolithic kernel offers CPU scheduling, device management, file
management, memory management, process management, and other OS
services via the system calls. All of these components, including file
management and memory management, are located within the kernel.
The user and kernel services use the same address space, resulting in a
fast-executing operating system. One drawback of this kernel is that if
anyone process or service of the system fails, the complete system
crashes. The entire operating system must be modified to add a new
service to a monolithic kernel.
Advantages
1. The monolithic kernel runs quickly because of memory
management, file management, process scheduling, etc.
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 23
Introduction to Operating System
Unit-1
2. All of the components may interact directly with each other's and
also with the kernel.
3. It is a single huge process that executes completely within a single
address space.
4. Its structures are easy and simple. The kernel contains all of the
components required for processing.
Disadvantages
1. If the user needs to add a new service, the user requires to modify
the complete operating system.
2. It isn't easy to port code written in the monolithic operating
system.
3. If any of the services fails, the entire system fails.
Microkernel
The microkernel is a type of kernel that permits the customization of the
OS. It is privileged and provides low-level address space management as
well as Inter-Process Communication (IPC). Furthermore, OS
functions like the virtual memory manager, file system, and CPU
scheduler are built on top of the microkernel. Every service has its
address space to make them secure. Moreover, every application has its
address space. As a result, there is protection between applications, OS
Services, and the kernel.
When an application requests a service from the OS services, the OS
services communicate with one another in order to provide the requested
service to the application. Inter-Process Communication (IPC) can assist
in establishing this communication. Overall, microkernel-based
operating systems offer a high level of extensibility. It is also possible to
customize the operating system's services to meet the needs of the
application.
Advantages
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 24
Introduction to Operating System
Unit-1
1. These are modular, and several modules may be modified,
reloaded, replaced without modifying the kernel.
2. The architecture of the microkernel is small and isolated, but it
may work better.
3. The Microkernel system is a versatile technique in which the APIs
implemented by several servers may coexist.
4. The system can be expanded more easily because it may be added
to the system application without interrupting the kernel.
5. It adds new features without recompiling.
6. When compared to monolithic systems, there are fewer system
crashes.
Disadvantages
1. A context switch is required in the microkernel when the drivers
are run as processes.
2. The microkernel system performance might be variable and cause
issues.
3. Microkernel services are more expensive than in a traditional
monolithic system.
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 25
Introduction to Operating System
Unit-1
Comparison between the Microkernel and Monolithic Kernel
Definition It is a kernel type that It is a type of kernel in which the
implements an operating complete operating system runs at
system by providing low-
level address space the kernel speed.
management, IPC, and
thread management.
Size It is smaller in size. It is bigger than the microkernel.
Speed Its process execution is Its process execution is faster.
slower.
Basic It implements kernel and It implements both user and kernel
user services in different
address spaces. Services in the same address space.
Security It is more secure than the It is less secure than the microkerne
monolithic kernel.
Stability A single process failure does In a monolithic kernel, if a service
not affect other processes.
fails,
the entire system fails.
Extendible It is easy to extend. It is hard to extend.
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 26
Introduction to Operating System
Unit-1
Code More code is necessary to Less code is necessary to write a
write a microkernel.
Monolithic kernel.
Inter- Communication The monolithic kernels use signals
Process Microkernels use the
messaging queues to achieve and
IPC.
Sockets to achieve IPC.
Maintainabi Maintenance takes extra
lity It is time and resources.
easily
maintainabl
e.
Debug It is easy to debug. It is hard to debug.
Example Symbian, L4Linux, K42, Linux, BSDs, Solaris, OS-9, DOS,
Mac OS X, PikeOS, HURD,
etc. OpenVMS, etc.
Prepared by: Mrs Ankita Tripathi[Asst. Professor,KCNIT College of Education,Banda] Page 27