0% found this document useful (0 votes)
6 views43 pages

Operating System Notes

The document outlines the fundamentals of operating systems, detailing their role as intermediaries between users and computer hardware, and their functionalities such as resource, process, memory, and storage management. It also discusses the goals of operating systems, characteristics, common types, and their historical evolution. Furthermore, it emphasizes the importance of device management and file system management in ensuring efficient operation and user convenience.

Uploaded by

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

Operating System Notes

The document outlines the fundamentals of operating systems, detailing their role as intermediaries between users and computer hardware, and their functionalities such as resource, process, memory, and storage management. It also discusses the goals of operating systems, characteristics, common types, and their historical evolution. Furthermore, it emphasizes the importance of device management and file system management in ensuring efficient operation and user convenience.

Uploaded by

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

OPERATING SYSTEM- BCS-401 2024-25

Subject: operating SyStem

Subject code: bcS 401

author’S name: mr. madhav praSad


(ph.d*, m.tech., b.tech.)

prepared at: iec group of inStitutionS

iec college

of

engineering &technology

greater noida

addreSS: plot no:-4, Knowledge parK-


1, inStitutional area, Surajpur KaSna
road, greater noida, diStrict:-
gautam budh nagar, uttar pradeSh-
201310, (india)

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

Unit-01
Introduction: An operating system acts as an intermediary between the user of a
computer and computer hardware. In short its an interface between computer
hardware and user.
• The purpose of an operating system is to provide an environment in
which a user can execute programs conveniently and efficiently.
• An operating system is software that manages computer hardware and
software. The hardware must provide appropriate mechanisms to ensure
the correct operation of the computer system and to prevent user
programs from interfering with the proper operation of the system.
• The operating system (OS) is a program that runs at all times on a
computer. All other programs, including application programs, run on top
of the operating system.
• It does assignment of resources like memory, processors and input /
output devices to different processes that need the resources. The
assignment of resources has to be fair and secure.
Functionalities of Operating System
• Resource Management: When multiple processes run on the system
and need different resources like memory, input/output devices, the OS
works as Resource Manager, Its responsibility is to provide hardware to
the user. It decreases the load in the system.
• Process Management: It includes various tasks like scheduling and
synchronization of processes. Process scheduling is done with the help
of CPU Scheduling algorithms . Process Synchronization is mainly
required because processes need to communicate with each other. When
processes communicate different problems arise like two processes can
update the same memory location in incorrect order.
• Storage Management: The file system mechanism used for the
management of the secondary storage like Hard
Disk. NIFS, CIFS, CFS, NFS, etc. are some file systems that are used by
operating systems to manage the storage. All the data is stored in various
tracks of Hard disks that are all managed by the storage manager.
• Memory Management: Refers to the management of primary memory,
mainly allocation and de-allocation of memory to processes. The
operating system has to keep track of how much memory has been used
and by which process. It has to decide which process needs memory
space and how much.
• Security/Privacy Management: Privacy is also provided by the
Operating system using passwords so that unauthorized applications
can’t access programs or data. For example, Windows
uses Kerberos authentication to prevent unauthorized access to data.
2

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

The Operating System as a User Interface:


1. User (Interacts with the system)
2. System and application programs (Software tools for the user)
3. Operating system (Manages hardware and software resources)
4. Hardware (Physical computing devices)
Every general-purpose computer consists of hardware, an operating system(s),
system programs and application programs. The hardware consists of memory,
CPU, ALU, I/O devices, peripheral devices and storage devices. The system program
consists of compilers, loaders, editors, OS, etc.

Conceptual View of Computer System

Every computer must have an operating system to run other programs. The
operating system coordinates the use of the hardware among the various system
programs and application programs for various users. It simply provides an
environment within which other programs can do useful work.
An OS is a package of some programs that runs on a computer machine, allowing
it to perform efficiently. It manages the simple tasks of recognizing input from the
keyboard, managing files and directories on disk, displaying output on the screen
and controlling peripheral devices.
Goals of Operating System
Primary Goals
The primary goals of an operating system (OS) are to provide a easy to use and
convenient environment for executing user programs.
1. User Convenience : It should be easy to use, providing a user-friendly
interface and making it simple to interact with the system.
2. Program Execution: It facilitates the execution of user programs,
providing the necessary environment and services for them to run.

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

3. Resource Management: The OS manages and allocates the computer’s


resources, including the CPU, memory, disk storage, and input/output
devices, to ensure fair utilization.
4. Security: The OS protects the system and user data from unauthorized
access, ensuring the confidentiality, integrity, and availability of
information.
Secondary Goals
1. Efficient Resource Utilization: It should aim to maximize the
performance and utilization of computer resources like CPU, Memory and
IO devices, ensuring that the system runs smoothly and efficiently.
2. Reliability: It should be robust and reliable, able to handle errors and
exceptions gracefully, ensuring that the system continues to operate
smoothly. It should be modular in design and easy to debug.
List of Common Operating Systems
There are multiple types of operating systems each having its own unique features:
Windows OS
• Developer : Microsoft
• Key Features : User-friendly interface, software compatibility, hardware
support, Strong gaming support.
• Advantages : Easy to use for most users, Broad support from third-party
applications ,Frequent updates and support.
• Typical Use Cases : Personal computing, Business environment, Gaming.
macOS
• Developer : Apple.
• Key Features : Sleek, intuitive user interface, Strong integration with
other Apple products, Robust security features, High performance and
stability.
• Advantages : Optimized for Apple hardware, Seamless experience
across Apple ecosystem, Superior graphics and multimedia capabilities.
• Typical Use Cases : Creative industries (design, video editing, music
production), Personal computing, Professional environments.
Linux
• Developer : Community-driven (various distributions).
• Key Features : Open-source and highly customizable, Robust security
and stability, Lightweight and can run on older hardware, Large selection
of distributions (e.g., Ubuntu, Fedora, Debian).
• Advantages : Free to use and distribute, Strong community support,
Suitable for servers and development environments.
• Typical Use Cases : Servers and data centers, Development and
programming, Personal computing for tech enthusiasts.
Unix

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

• Developer: Originally AT&T Bell Labs, various commercial and open-


source versions available
• Key Features: Multiuser and multitasking capabilities, Strong security
and stability, Powerful command-line interface, Portability across
different hardware platforms
• Advantages: Reliable and robust performance, Suitable for high-
performance computing and servers, Extensive support for networking
• Typical Use Cases: Servers and workstations, Development
environments, Research and academic settings
History of Operating System
The operating system has been evolving through the years. The following table
shows the history of OS.

Era Key Developments Examples

The first Operating System was GM-NAA


1956 GM-NAA I/O (1956)
I/O in 1956 by General Motors.

IBM developed a time sharing system OS/360, DOS/360


1960s
TSS/360 and TSS/360

Unix popularized simplicity and


Unix (1971), CP/M
1970s multitasking; rise of personal computers
(1974)
with basic OSs.

Apple Macintosh
GUI-based OSs gained traction;
1980s (1984), Windows
networking features became standard.
(1985)

Open-source Linux emerged; GUIs in Linux (1991),


1990s
Windows and Mac OS improved. Windows 95 (1995)

Mobile OSs dominated; cloud and


2000s- iOS (2007), Android
virtualization technologies advanced
Present (2008)
computing.

Characteristics of Operating Systems


Let us now discuss some of the important characteristic features of operating
systems:

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

• Device Management: The operating system keeps track of all the


devices. So, it is also called the Input/Output controller that decides which
process gets the device, when and for how much time.
• File Management: It allocates and de-allocates the resources and also
decides who gets the resource.
• Job Accounting: It keeps track of time and resources used by various
jobs or users.
• Error-detecting Aids: These contain methods that include the
production of dumps, traces, error messages and other debugging and
error-detecting methods.
• Memory Management: It is responsible for managing the primary
memory of a computer, including what part of it are in use by whom also
check how much amount free or used and allocate process
• Processor Management: It allocates the processor to a process and
then de-allocates the processor when it is no longer required or the job is
done.
• Control on System Performance: It records the delays between the
request for a service and the system.
• Security: It prevents unauthorized access to programs and data using
passwords or some kind of protection technique.
• Convenience: An OS makes a computer more convenient to use.
• Efficiency: An OS allows the computer system resources to be used
efficiently.
• Ability to Evolve: An OS should be constructed in such a way as to
permit the effective development, testing and introduction of new system
functions at the same time without interfering with service.
• Throughput: An OS should be constructed so that It can give maximum
throughput (Number of tasks per unit time).

Functions of Operating System


An Operating System acts as a communication interface between the user and computer
hardware. Its purpose is to provide a platform on which a user can execute programs
conveniently and efficiently. The main goal of an operating system is to make the computer
environment more convenient to use and to utilize resources most efficiently.
Operating System handles the following responsibilities:
• Controls all the computer resources.
• Provides valuable services to user programs.
• Coordinates the execution of user programs.
• Provides resources for user programs.
• Provides an interface (virtual machine) to the user.

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

• Hides the complexity of software.


• Supports multiple execution modes.
• Monitors the execution of user programs to prevent errors.
Functions of an Operating System

Function of OS
1. Process Management
Process management in operating system is about managing processes. A Process is a running
program. The life cycle of process is from the moment program start until it finishes. Operating
system makes sure each process:
• gets its turn to use the CPU
• synchronized when needed
• has access to the resources it needs, like memory, files, and input/output devices.
It also handles issues like process coordination and communication, while preventing conflicts
such as deadlocks. This way, the OS ensures smooth multitasking and efficient resource use.

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

Process State Diagram


Core Functions in Process Management:
Process Scheduling
• Allocates CPU time to processes based on scheduling algorithms like Round
Robin or Priority Scheduling.
• Ensures fair distribution of CPU time, avoiding starvation of lower-priority processes.
• Maximizes CPU utilization by determining which process runs at any given time.
Process Synchronization
• Coordinate multiple processes to ensure orderly execution and prevent conflicts.
• Prevents race conditions by ensuring that only one process can access a shared
resource at a time.
• Uses synchronization mechanisms like locks, semaphores, and monitors to coordinate
process access.
Deadlock Handling
• Prevents deadlocks by using strategies like resource allocation graphs or avoiding
circular wait conditions.
• Detects deadlocks when they occur, allowing the system to identify and resolve the
issue.
• Recovers from deadlocks by aborting or rolling back processes to free up resources.
Inter-Process Communication (IPC):

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

• Facilitates communication between processes through shared memory, allowing


processes to exchange data directly.
• Uses message passing to send data between processes in different address spaces.
• Enables efficient data exchange and coordination in a multitasking environment,
improving system performance.
2. Memory Management
Memory management is an essential task of the operating system that handles the storage
and organization of data in both main (primary) memory and secondary storage. The OS
ensures that memory is allocated and deallocated properly to keep programs running
smoothly. It also manages the interaction between volatile main memory and non-volatile
secondary storage.

Memory Management
Key Activities in Memory Management:
Main Memory Management
• Memory Allocation: Assigns memory to processes using techniques
like paging and segmentation.
• Memory Deallocation: Frees memory when no longer needed.
• Memory Protection: Prevents processes from accessing each other’s memory.
• Virtual Memory: Uses disk space as extra memory to run larger processes.
• Fragmentation: Manages wasted memory space (internal/external)
through compaction.

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

Secondary Memory Management


• Disk Space Allocation: Organizes how files are stored on the disk (contiguous, linked,
indexed).
• File System Management: Manages files and directories for efficient data access.
• Free Space Management: Tracks available space on the disk.
• Disk Scheduling: Organizes the order of disk read/write requests.
• Backup and Recovery: Ensures data is backed up and can be restored after failure.
3. File System Management
File management in the operating system ensures the organized storage, access and control
of files. The OS abstracts the physical storage details to present a logical view of files, making
it easier for users to work with data. It manages how files are stored on different types of
storage devices (like hard drives or SSDs) and ensures smooth access through directories and
permissions.

File System Management


File System Management includes managing of:
File Attributes
• File Name: Identifies the file with a name and extension (e.g., .txt, .jpg).
• File Type: Defines the format of the file (e.g., text, image, executable).
• Size: The amount of storage the file occupies.
• Permissions: Determines who can read, write, or execute the file.
File Types

10

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

• Text Files: Contain human-readable content (e.g., .txt, .md).


• Binary Files: Store data in binary format (e.g., .jpg, .mp3).
• Executable Files: Contain program code (e.g., .exe, .out).
Operations on Files
• Create: Allows users to create new files.
• Read: Opens files to read their contents.
• Write: Modifies the contents of a file.
• Delete: Removes a file from the system.
Access Methods
• Sequential Access: Reads data in order, from start to finish.
• Direct Access: Jumps to a specific part of the file.
• Indexed Access: Uses an index for quick data retrieval.
4. Device Management (I/O System)
Device management of an operating system handles the communication between the system
and its hardware devices, like printers, disks or network interfaces. The OS provides device
drivers to control these devices, using techniques like Direct Memory Access (DMA) for
efficient data transfer and strategies like buffering and spooling to ensure smooth operation.

Device Management
Major components in Device Management:
Device Drivers: The operating system uses device drivers to interact with hardware devices.
There are two types of device drivers:

11

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

• Kernel-space drivers run in the OS kernel, offering direct access to hardware.


• User-space drivers run outside the kernel and are more isolated, providing safety but
less performance.
Buffering & Caching:
• Buffering temporarily stores data in memory to manage differences in device speeds.
Block devices (e.g., hard drives) use larger blocks of data for buffering, while character
devices (e.g., keyboards, mice) use smaller, byte-by-byte buffering.
• Caching improves access speed by storing frequently accessed data in a faster storage
medium (like RAM).
Spooling: Spooling manages data waiting to be processed, particularly in devices like printers.
The OS places print jobs in a spool (a temporary storage area), allowing the CPU to continue
other tasks while the printer works through the queue. Other examples include mail spooling
(for managing outgoing email) and batch-job spooling (for managing scheduled tasks).
5. Protection and Security
Protection and security mechanisms in an operating system are designed to safeguard system
resources from unauthorized access or misuse. These mechanisms control which processes or
users can access specific resources (such as memory, files, and CPU time) and ensure that only
authorized users can perform specific actions. While protection ensures proper access control,
security focuses on defending the system against external and internal attacks.

Security
• Access Control: The operating system ensures that processes and users can only
access resources they are authorized to. This is achieved through mechanisms like
memory-addressing hardware (which keeps processes within their own address space)
and timer interrupts (which prevent processes from monopolizing the CPU).

12

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

• User Authentication: A system identifies users through user IDs (UIDs) or Security IDs
(SIDs). During login, the operating system verifies the user’s credentials, ensuring that
only authorized users can access their data or system resources.
• Resource Protection: Mechanisms like file protection (ensuring only authorized users
can access or modify files) and device protection (restricting direct access to device-
control registers) ensure the integrity of system resources, preventing unauthorized or
harmful use.
• Security Against Attacks: Security mechanisms defend against external threats like
viruses, worms, denial-of-service attacks, and identity theft. These attacks can misuse
system resources, steal sensitive data, or disrupt system operation. The OS works to
prevent these threats and minimize damage.
6. Additional Functions of the Operating System
Beyond core tasks like process and memory management, operating systems also focus on
system performance, resource utilization and error detection. These functions ensure smooth
operation, efficient resource allocation and system reliability.
• Control Over System Performance: The OS monitors system performance by recording
delays between service requests and system responses. This helps identify bottlenecks
and optimize resource usage, ensuring efficient system operation.
• Job Accounting: The OS keeps track of time and resources used by various tasks and
users. This information is valuable for auditing, billing, and optimizing resource
allocation among users and applications.
• Error-Detecting Aids: The OS produces dumps, traces, error messages, and other
debugging aids to detect and diagnose errors. This proactive approach helps maintain
system stability and aids in troubleshooting issues.

Classification of Operating System:


Operating Systems can be categorized according to different criteria like
whether an operating system is for mobile devices (examples Android and
iOS) or desktop (examples Windows and Linux).

1. Batch Operating System


This type of operating system does not interact with the computer directly.
There is an operator which takes similar jobs having the same
requirements and groups them into batches. It is the responsibility of the
operator to sort jobs with similar needs. Batch Operating System is
designed to manage and execute a large number of jobs efficiently by
processing them in groups.

13

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

Batch Operating System

Advantages of Batch Operating System


• Multiple users can share the batch systems.
• The idle time for the batch system is very little.
• It is easy to manage large work repeatedly in batch systems.
Disadvantages of Batch Operating System
CPU is not used efficiently. When the current process is doing

IO, the CPU is free and could be utilized by other processes
waiting.
• The other jobs will have to wait for an unknown time if any job
fails.
• In a batch operating system, average response time increases as
all processes are processed one by one.
Examples of Batch Operating Systems: Payroll Systems, Bank
Statements, etc.
2. Multi-Programming Operating System
Multiprogramming Operating Systems can be simply illustrated as more
than one program is present in the main memory and any one of them can
be kept in execution. This is used for better utilization of resources.

14

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

Multi Programming

Advantages of, Multi-Programming Operating System


• CPU is better utilized, and the overall performance of the system
improves.
• It helps in reducing the response time.
Multi-tasking/Time-sharing Operating systems
It is a type of Multiprogramming system with every process running in
round robin manner. Each task is given some time to execute so that all
the tasks work smoothly. Each user gets the time of the CPU as they use
a single system. These systems are also known as Multitasking Systems.
The task can be from a single user or different users. The time that each
task gets to execute is called quantum. After this time interval is over, the
OS switches over to the next task.

15

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

Advantages of Time-Sharing OS
• Each task gets an equal opportunity.
• Fewer chances of duplication of software.
• CPU idle time can be reduced.
• Resource Sharing: Time-sharing systems allow multiple users to
share hardware resources such as the CPU, memory, and
peripherals, reducing the cost of hardware and increasing
efficiency.
• Improved Productivity: Time-sharing allows users to work
concurrently, thereby reducing the waiting time for their turn to
use the computer. This increased productivity translates to more
work getting done in less time.
• Improved User Experience: Time-sharing provides an interactive
environment that allows users to communicate with the computer
in real time, providing a better user experience than batch
processing.
Disadvantages of Time-Sharing OS
• Reliability problem.
• One must take care of the security and integrity of user
programs and data.
• Data communication problem.

16

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

• High Overhead: Time-sharing systems have a higher overhead


than other operating systems due to the need for scheduling,
context switching, and other overheads that come with
supporting multiple users.
• Complexity: Time-sharing systems are complex and require
advanced software to manage multiple users simultaneously.
This complexity increases the chance of bugs and errors.
• Security Risks: With multiple users sharing resources, the risk of
security breaches increases. Time-sharing systems require
careful management of user access, authentication, and
authorization to ensure the security of data and software.
Examples of Time-Sharing OS with explanation
• IBM VM/CMS: IBM VM/CMS is a time-sharing operating system
that was first introduced in 1972. It is still in use today, providing
a virtual machine environment that allows multiple users to run
their instances of operating systems and applications.
• TSO (Time Sharing Option): TSO is a time-sharing operating
system that was first introduced in the 1960s by IBM for the IBM
System/360 mainframe computer. It allowed multiple users to
access the same computer simultaneously, running their
applications.
• Windows Terminal Services: Windows Terminal Services is a
time-sharing operating system that allows multiple users to
access a Windows server remotely. Users can run their
applications and access shared resources, such as printers and
network storage, in real time.
3. Multi-Processing Operating System
A Multi-Processing Operating Systemis a type of Operating System in
which more than one CPU is used for the execution of resources. It betters
the throughput of the System.

17

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

Multiprocessing Operating System

Advantages of a Multi-User Operating System


• It increases the throughput of the system as processes can be
parallelized.
• As it has several processors, so, if one processor fails, we can
proceed with another processor.
4. Multi-User Operating Systems
These systems allow multiple users to be active at the same time. This
system can be either a multiprocessor or a single processor with
interleaving.

18

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

5. Distributed Operating System


These types of operating systems are a recent advancement in the world
of computer technology and are being widely accepted all over the world
and, that too, at a great pace. Various autonomous interconnected
computers communicate with each other using a shared communication
network. Independent systems possess their own memory unit and
CPU. Systems. These systems’ processors differ in size and function. The
major benefit of working with these types of operating systems is that it is
always possible that one user can access the files or software which are
not present on his system but on some other system connected within this
network, i.e., remote access is enabled within the devices connected to that
network.

Distributed OS

Advantages of Distributed Operating System


• Failure of one will not affect the other network communication,
as all systems are independent of each other.
• Electronic mail increases the data exchange speed.
• Since resources are being shared, computation is highly fast and
durable.
• Load on host computer reduces.
• These systems are easily scalable as many systems can be
easily added to the network.
• Delay in data processing reduces.
Disadvantages of Distributed Operating System
• Failure of the main network will stop the entire communication.
• To establish distributed systems, the language is not yet well-
defined.

19

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

• These types of systems are not readily available as they are very
expensive. Not only that the underlying software is highly
complex and not understood well yet.
Examples of Distributed Operating Systems are LOCUS, etc.
Issues With Distributed Operating Systems
• Networking causes delays in the transfer of data between nodes
of a distributed system. Such delays may lead to an inconsistent
view of data located in different nodes and make it difficult to
know the chronological order in which events occurred in the
system.
• Control functions like scheduling, resource allocation, and
deadlock detection have to be performed in several nodes to
achieve computation speedup and provide reliable operation
when computers or networking components fail.
• Messages exchanged by processes present in different nodes
may travel over public networks and pass through computer
systems that are not controlled by the distributed operating
system. An intruder may exploit this feature to tamper with
messages or create fake messages to fool the authentication
procedure and masquerade as a user of the system.
6. Network Operating System
These systems run on a server and provide the capability to manage data,
users, groups, security, applications, and other networking functions.
These types of operating systems allow shared access to files, printers,
security, applications, and other networking functions over a small private
network. One more important aspect of Network Operating Systems is
that all the users are well aware of the underlying configuration, of all
other users within the network, their connections, etc., and that’s why
these computers are popularly known a tightly coupled systems.

20

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

Network Operating System

Advantages of Network Operating System


• Highly stable, centralized servers.
• Security concerns are handled through servers.
• New technologies and hardware upgrades are easily integrated
into the system.
• Server access is possible remotely from different locations and
types of systems.
Disadvantages of Network Operating System
Servers are costly.

• The user has to depend on a central location for most operations.
• Maintenance and updates are required regularly.
Examples of Network Operating Systems are Microsoft Windows Server
2003, Microsoft Windows Server 2008, UNIX, Linux, Mac OS X, Novell
NetWare, BSD, etc.

7. Real-Time Operating System


21

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

These types of OSs serve real-time systems. The time interval required to
process and respond to inputs is very small. This time interval is
called response time. Real-time systems are used when there are time
requirements that are very strict like missile systems, air traffic control
systems, robots, etc.
Types of Real-Time Operating Systems
•Hard Real-Time Systems: Hard Real-Time OSs are meant for
applications where time constraints are very strict, and even the
shortest possible delay is not acceptable. These systems are built
for saving lives like automatic parachutes or airbags which are
required to be readily available in case of an accident. Virtual
memory is rarely found in these systems.
• Soft Real-Time Systems: These OSs are for applications where
time is less strict.
For more, refer to the Difference Between Hard Real-Time OS and Soft
Real-Time OS.

Real-Time Operating System

Advantages of RTOS
• Maximum Consumption: Maximum utilization of devices and
systems, thus more output from all the resources.
• Task Shifting: The time assigned for shifting tasks in these
systems is very less. For example, in older systems, it takes about
10 microseconds to shift from one task to another, and in the
latest systems, it takes 3 microseconds.
• Focus on Application: Focus on running applications and give
less importance to applications that are in the queue.

22

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

• Real-time operating system in the embedded system: Since the


size of programs is small, RTOS can also be used in embedded
systems like in transport and others.
• Error-Free,: These types of systems are error-free.
• Memory Allocation: Memory allocation is best managed in
these types of systems.
Disadvantages of RTOS
• Limited Tasks: Very few tasks run at the same time and their
concentration is very less on a few applications to avoid errors.
• Use heavy system resources: Sometimes the system resources
are not so good and they are expensive as well.
• Complex Algorithms: The algorithms are very complex and
difficult for the designer to write.
• Device driver and interrupt signals: It needs specific device
drivers and interrupt signals to respond earliest to interrupts.
• Thread Priority: It is not good to set thread priority, as these
systems are much less prone to switching tasks.
Examples of Real-Time Operating Systems are Scientific experiments,
medical imaging systems, industrial control systems, weapon systems,
robots, air traffic control systems, etc.
8. Mobile Operating Systems
Mobile operating systems are designed specifically for mobile devices
such as smartphones and tablets. Examples of such operating systems are
Android and iOS. These operating systems manage the hardware and
software resources of the device, providing a platform for running
applications and ensuring a seamless user experience.
Advantages of Mobile Operating Systems
User-Friendly Interfaces: Mobile operating systems are designed to be
intuitive and easy to use, making them accessible to a wide range of users.
Extensive App Ecosystems: The availability of a vast number of
applications allows users to customize their devices to meet their specific
needs.
Connectivity Options: Mobile operating systems support multiple
connectivity options, enabling users to stay connected wherever they go.
Regular Updates: Mobile operating systems receive regular updates,
including new features, security patches, and performance improvements.
Disadvantages Mobile Operating Systems
23

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

Battery Life Constraints: Despite advancements in power management,


battery life remains a challenge for mobile devices, especially with heavy
usage.
Security Risks: Mobile devices are susceptible to various security threats,
such as malware and phishing attacks, which can compromise user data.
Fragmentation: In the case of Android, the wide range of devices and
customizations can lead to fragmentation, making it difficult for developers
to ensure compatibility across all devices.
Limited Hardware Resources: Mobile devices have limited processing
power, memory, and storage compared to desktop computers, which can
affect the performance of resource-intensive applications.

Thread in Operating System


A thread is a single sequence stream within a process. Threads are also
called lightweight processes as they possess some of the properties of
processes. Each thread belongs to exactly one process.
• In an operating system that supports multithreading, the
process can consist of many threads. But threads can be effective
only if the CPU is more than 1 otherwise two threads have to
context switch for that single CPU.
• All threads belonging to the same process share – code section,
data section, and OS resources (e.g. open files and signals)
• But each thread has its own (thread control block) – thread ID,
program counter, register set, and a stack
• Any operating system process can execute a thread. we can say
that single process can have multiple threads.
Why Do We Need Thread?
• Threads run in concurrent manner that improves the application
performance. Each such thread has its own CPU state and stack,
but they share the address space of the process and the
environment. For example, when we work on Microsoft
Word or Google Docs, we notice that while we are typing,
multiple things happen together (formatting is applied, page is
changed and auto save happens).

24

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

• Threads can share common data so they do not need to


use inter-process communication. Like the processes, threads
also have states like ready, executing, blocked, etc.
• Priority can be assigned to the threads just like the process, and
the highest priority thread is scheduled first.
• Each thread has its own Thread Control Block (TCB). Like the
process, a context switch occurs for the thread, and register
contents are saved in (TCB). As threads share the same address
space and resources, synchronization is also required for the
various activities of the thread.
Components of Threads
These are the basic components of the Operating System.
• Stack Space: Stores local variables, function calls, and return
addresses specific to the thread.
• Register Set: Hold temporary data and intermediate results for
the thread’s execution.
• Program Counter: Tracks the current instruction being executed
by the thread.
Types of Thread in Operating System
Threads are of two types. These are described below.
• User Level Thread
• Kernel Level Thread

25

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

Threads

1. User Level Thread


User Level Thread is a type of thread that is not created using system calls.
The kernel has no work in the management of user-level threads. User-
level threads can be easily implemented by the user. In case when user-
level threads are single-handed processes, kernel-level thread manages
them. Let’s look at the advantages and disadvantages of User-Level
Thread.
Advantages of User-Level Threads
• Implementation of the User-Level Thread is easier than Kernel
Level Thread.
• Context Switch Time is less in User Level Thread.
• User-Level Thread is more efficient than Kernel-Level Thread.
• Because of the presence of only Program Counter, Register Set,
and Stack Space, it has a simple representation.
Disadvantages of User-Level Threads

26

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

• The operating system is unaware of user-level threads, so


kernel-level optimizations, like load balancing across CPUs, are
not utilized.
• If a user-level thread makes a blocking system call, the entire
process (and all its threads) is blocked, reducing efficiency.
• User-level thread scheduling is managed by the application,
which can become complex and may not be as optimized as
kernel-level scheduling.
2. Kernel Level Threads
A kernel Level Thread is a type of thread that can recognize the Operating
system easily. Kernel Level Threads has its own thread table where it
keeps track of the system. The operating System Kernel helps in managing
threads. Kernel Threads have somehow longer context switching time.
Kernel helps in the management of threads.
Advantages of Kernel-Level Threads
• Kernel-level threads can run on multiple processors or cores
simultaneously, enabling better utilization of multicore systems.
• The kernel is aware of all threads, allowing it to manage and
schedule them effectively across available resources.
• Applications that block frequency are to be handled by the
Kernel-Level Threads.
• The kernel can distribute threads across CPUs, ensuring optimal
load balancing and system performance.
Disadvantages of Kernel-Level threads
• Context switching between kernel-level threads is slower
compared to user-level threads because it requires mode
switching between user and kernel space.
• Managing kernel-level threads involves frequent system calls
and kernel interactions, leading to increased CPU overhead.
• A large number of threads may overload the kernel scheduler,
leading to potential performance degradation in systems with
many threads.
• Implementation of this type of thread is a little more complex
than a user-level thread.

27

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

Difference Between Process and Thread


The primary difference is that threads within the same process run in a
shared memory space, while processes run in separate memory spaces.
Threads are not independent of one another like processes are, and as a
result, threads share with other threads their code section, data section,
and OS resources (like open files and signals). But, like a process, a thread
has its own program counter (PC), register set, and stack space.
What is Multi-Threading?
A thread is also known as a lightweight process. The idea is to achieve
parallelism by dividing a process into multiple threads. For example, in
a browser, multiple tabs can be different threads. MS Word uses multiple
threads: one thread to format the text, another thread to process inputs,
etc. More advantages of multithreading are discussed below.
Multithreading is a technique used in operating systems to improve the
performance and responsiveness of computer systems. Multithreading
allows multiple threads (i.e., lightweight processes) to share the same
resources of a single process, such as the CPU, memory, and I/O devices.

Single Threaded vs Multi-threaded Process

Multithreading can be done without OS support, as seen in Java’s


multithreading model. In Java, threads are implemented using the Java
Virtual Machine (JVM), which provides its own thread management. These

28

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

threads, also called user-level threads, are managed independently of the


underlying operating system.
Application itself manages the creation, scheduling, and execution of
threads without relying on the operating system’s kernel. The application
contains a threading library that handles thread creation, scheduling, and
context switching. The operating system is unaware of User-Level threads
and treats the entire process as a single-threaded entity.
Benefits of Thread in Operating System
• Responsiveness: If the process is divided into multiple threads,
if one thread completes its execution, then its output can be
immediately returned.
• Faster context switch: Context switch time between threads is
lower compared to the process context switch. Process context
switching requires more overhead from the CPU.
• Effective utilization of multiprocessor system: If we have
multiple threads in a single process, then we can schedule
multiple threads on multiple processors. This will make process
execution faster.
• Resource sharing: Resources like code, data, and files can be
shared among all threads within a process. Note: Stacks and
registers can’t be shared among the threads. Each thread has its
own stack and registers.
• Communication: Communication between multiple threads is
easier, as the threads share a common address space. while in the
process we have to follow some specific communication
techniques for communication between the two processes.
• Enhanced throughput of the system: If a process is divided into
multiple threads, and each thread function is considered as one
job, then the number of jobs completed per unit of time is
increased, thus increasing the throughput of the system.
Operating Systems Structures
The operating system can be implemented with the help of various
structures. The structure of the OS depends mainly on how the various
standard components of the operating system are interconnected and
merge into the kernel. A system structure for an operating system is like

29

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

the blueprint of how an OS is organized and how its different parts interact
with each other.

Types of Operating Systems Structures


1. Simple Structure
Simple structure operating systems do not have well-defined structures
and are small, simple, and limited. The interfaces and levels of
functionality are not well separated. MS-DOS is an example of such an
operating system. In MS-DOS, application programs are able to access the
basic I/O routines. These types of operating systems cause the entire
system to crash if one of the user programs fails.

Simple OS Structure

Advantages of Simple Structure


• It delivers better application performance because of the few
interfaces between the application program and the hardware.
• It is easy for kernel developers to develop such an operating
system.
Disadvantages of Simple Structure

30

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

• The structure is very complicated, as no clear boundaries exist


between modules.
• It does not enforce data hiding in the operating system.
2.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 ). Example – The Windows NT operating
system uses this layered approach as a part of it. Design Analysis : The
whole Operating System is separated into several layers ( from 0 to n ) as
the diagram shows. Each of the layers must have its own specific function
to perform. There are some rules in the implementation of the layers as
follows.
1. The outermost layer must be the User Interface layer.
2. The innermost layer must be the Hardware layer.
3. A particular layer can access all the layers present below it but
it cannot access the layers present above it. That is layer n-1 can
access all the layers from n-2 to 0 but it cannot access the nth
layer.
Thus if the user layer wants to interact with the hardware layer, the
response will be traveled through all the layers from n-1 to 1. Each layer
must be designed and implemented such that it will need only the services
provided by the layers below it.

31

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

Layered OS Design

Advantages :
There are several advantages to this design :
1. Modularity : This design promotes modularity as each layer
performs only the tasks it is scheduled to perform.
2. Easy debugging : As the layers are discrete so it is very easy to
debug. Suppose an error occurs in the CPU scheduling layer, so
the developer can only search that particular layer to debug,
unlike the Monolithic system in which all the services are present
together.
3. Easy update : A modification made in a particular layer will not
affect the other layers.
4. No direct access to hardware : The hardware layer is the
innermost layer present in the design. So a user can use the
services of hardware but cannot directly modify or access it,

32

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

unlike the Simple system in which the user had direct access to
the hardware.
5. Abstraction : Every layer is concerned with its own functions. So
the functions and implementations of the other layers are
abstract to it.
Disadvantages :
Though this system has several advantages over the Monolithic and
Simple design, there are also some disadvantages as follows.
1. Complex and careful implementation : As a layer can access
the services of the layers below it, so the arrangement of the
layers must be done carefully. For example, the backing storage
layer uses the services of the memory management layer. So it
must be kept below the memory management layer. Thus with
great modularity comes complex implementation.
2. Slower in execution : If a layer wants to interact with another
layer, it sends a request that has to travel through all the layers
present in between the two interacting layers. Thus it increases
response time, unlike the Monolithic system which is faster than
this. Thus an increase in the number of layers may lead to a very
inefficient design.
Operating System Services
An operating system is software that acts as an intermediary between the
user and computer hardware. It is a program with the help of which we are
able to run various applications. It is the one program that is running all the
time. Every computer must have an operating system to smoothly execute
other programs.
The OS coordinates the use of the hardware and application programs for
various users. It provides a platform for other application programs to work.
The operating system is a set of special programs that run on a computer
system that allows it to work properly. It controls input-output devices,
execution of programs, managing files, etc.
Services of Operating System
• Program execution
• Input Output Operations
• Communication between Process
• File Management
• Memory Management
33

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

• Process Management
• Security and Privacy
• Resource Management
• User Interface
• Networking
• Error handling
• Time Management
Program Execution
It is the Operating System that manages how a program is going to be
executed. It loads the program into the memory after which it is executed.
The order in which they are executed depends on the CPU Scheduling
Algorithms. A few are FCFS, SJF, etc. When the program is in execution, the
Operating System also handles deadlock i.e. no two processes come for
execution at the same time. The Operating System is responsible for the
smooth execution of both user and system programs. The Operating
System utilizes various resources available for the efficient running of all
types of functionalities.
Input Output Operations
Operating System manages the input-output operations and establishes
communication between the user and device drivers. Device drivers are
software that is associated with hardware that is being managed by the OS
so that the sync between the devices works properly. It also provides access
to input-output devices to a program when needed.
Communication Between Processes
The Operating system manages the communication between processes.
Communication between processes includes data transfer among them. If
the processes are not on the same computer but connected through a
computer network, then also their communication is managed by the
Operating System itself.
File Management
The operating system helps in managing files also. If a program needs
access to a file, it is the operating system that grants access. These
permissions include read-only, read-write, etc. It also provides a platform
for the user to create, and delete files. The Operating System is responsible
for making decisions regarding the storage of all types of data or files,
i.e, floppy disk/hard disk/pen drive, etc. The Operating System decides how
the data should be manipulated and stored.

34

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

Memory Management
Let’s understand memory management by OS in simple way. Imagine a
cricket team with limited number of player . The team manager (OS) decide
whether the upcoming player will be in playing 11 ,playing 15 or will not
be included in team , based on his performance . In the same way, OS first
check whether the upcoming program fulfil all requirement to get memory
space or not ,if all things good, it checks how much memory space will be
sufficient for program and then load the program into memory at certain
location. And thus , it prevents program from using unnecessary memory.
Process Management
Let’s understand the process management in unique way. Imagine, our
kitchen stove as the (CPU) where all cooking(execution) is really happen
and chef as the (OS) who uses kitchen-stove(CPU) to cook different
dishes(program). The chef(OS) has to cook different dishes(programs) so he
ensure that any particular dish(program) does not take long
time(unnecessary time) and all dishes(programs) gets a chance to
cooked(execution) .The chef(OS) basically scheduled time for all
dishes(programs) to run kitchen(all the system) smoothly and thus
cooked(execute) all the different dishes(programs) efficiently.
Security and Privacy
• Security : OS keep our computer safe from an unauthorized user
by adding security layer to it. Basically, Security is nothing but just
a layer of protection which protect computer from bad guys
like viruses and hackers. OS provide us defences like firewalls and
anti-virus software and ensure good safety of computer and
personal information.
• Privacy : OS give us facility to keep our essential information
hidden like having a lock on our door, where only you can enter
and other are not allowed . Basically , it respect our secrets and
provide us facility to keep it safe.
Resource Management
System resources are shared between various processes. It is the Operating
system that manages resource sharing. It also manages the CPU time
among processes using CPU Scheduling Algorithms. It also helps in
the memory management of the system. It also controls input-output
devices. The OS also ensures the proper use of all the resources available
by deciding which resource to be used by whom.

35

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

User Interface
User interface is essential and all operating systems provide it. Users either
interacts with the operating system through the command-line interface or
graphical user interface or GUI. The command interpreter executes the next
user-specified command.
A GUI offers the user a mouse-based window and menu system as an
interface.
Networking
This service enables communication between devices on a network, such as
connecting to the internet, sending and receiving data packets, and
managing network connections.
Error Handling
The Operating System also handles the error occurring in the CPU, in Input-
Output devices, etc. It also ensures that an error does not occur frequently
and fixes the errors. It also prevents the process from coming to a deadlock.
It also looks for any type of error or bugs that can occur while any task. The
well-secured OS sometimes also acts as a countermeasure for preventing
any sort of breach of the Computer System from any external source and
probably handling them.
Time Management
Imagine traffic light as (OS), which indicates all the cars(programs) whether
it should be stop(red)=>(simple queue), start(yellow)=> (ready
queue),move(green)=>(under execution) and this light (control) changes
after a certain interval of time at each side of the road(computer system) so
that the cars(program) from all side of road move smoothly without traffic.
Kernel in Operating System
Last Updated : 24 Jan, 2025
••

A kernel is the core part of an operating system. It acts as a bridge between
software applications and the hardware of a computer.
• The kernel manages system resources, such as the CPU, memory,
and devices, ensuring everything works together smoothly and
efficiently.
• It handles tasks like running programs, accessing files, and
connecting to devices like printers and keyboards.
• An Operating System includes the kernel as its core, but also
provides a user interface, file system management, network
36

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

services, and various utility applications that allow users to


interact with the system

Kernel (Operating System)

• Facilitates communication between hardware and user


applications.
• Ensures efficient and secure multitasking.
• Manages system stability and prevents unauthorized resource
access.
Types of Kernel
The kernel manages the system’s resources and facilitates communication
between hardware and software components. These kernels are of
different types let’s discuss each type along with its advantages and
disadvantages:
1. Monolithic Kernel
It is one of the types of kernel where all operating system services operate
in kernel space. It has dependencies between systems components. It has
huge lines of code which is complex.
Example:
Unix, Linux, Open VMS, XTS-400 etc.
Advantages
• Efficiency: Monolithic kernels are generally faster than other
types of kernels because they don’t have to switch between user
and kernel modes for every system call, which can cause overhead.

37

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

• Tight Integration: Since all the operating system services are


running in kernel space, they can communicate more efficiently
with each other, making it easier to implement complex
functionalities and optimizations.
• Simplicity: Monolithic kernels are simpler to design, implement,
and debug than other types of kernels because they have a unified
structure that makes it easier to manage the code.
• Lower latency: Monolithic kernels have lower latency than other
types of kernels because system calls and interrupts can be
handled directly by the kernel.
Disadvantages
• Stability Issues: Monolithic kernels can be less stable than other
types of kernels because any bug or security vulnerability in a
kernel service can affect the entire system.
• Security Vulnerabilities: Since all the operating system services
are running in kernel space, any security vulnerability in one of the
services can compromise the entire system.
• Maintenance Difficulties: Monolithic kernels can be more difficult
to maintain than other types of kernels because any change in one
of the services can affect the entire system.
• Limited Modularity: Monolithic kernels are less modular than
other types of kernels because all the operating system services
are tightly integrated into the kernel space. This makes it harder to
add or remove functionality without affecting the entire system.
2. Micro Kernel
It is kernel types which has minimalist approach. It has virtual memory and
thread scheduling. Micro Kernel is more stable with less services in kernel
space. It puts rest in user space. It is use in small os.
Example :
Mach, L4, AmigaOS, Minix, K42 etc.
Advantages
• Reliability: Microkernel architecture is designed to be more
reliable than monolithic kernels. Since most of the operating
system services run outside the kernel space, any bug or security
vulnerability in a service won’t affect the entire system.
• Flexibility : Microkernel architecture is more flexible than
monolithic kernels because it allows different operating system

38

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

services to be added or removed without affecting the entire


system.
• Modularity: Microkernel architecture is more modular than
monolithic kernels because each operating system service runs
independently of the others. This makes it easier to maintain and
debug the system.
• Portability: Microkernel architecture is more portable than
monolithic kernels because most of the operating system services
run outside the kernel space. This makes it easier to port the
operating system to different hardware architectures.
Disadvantages
• Performance: Microkernel architecture can be slower than
monolithic kernels because it requires more context switches
between user space and kernel space.
• Complexity: Microkernel architecture can be more complex than
monolithic kernels because it requires more communication
and synchronization mechanisms between the different operating
system services.
• Development Difficulty: Developing operating systems based on
microkernel architecture can be more difficult than developing
monolithic kernels because it requires more attention to detail in
designing the communication and synchronization mechanisms
between the different services.
• Higher Resource Usage: Microkernel architecture can use more
system resources, such as memory and CPU, than monolithic
kernels because it requires more communication and
synchronization mechanisms between the different operating
system services.
3. Hybrid Kernel
It is the combination of both monolithic kernel and microkernel. It has speed
and design of monolithic kernel and modularity and stability of microkernel.
Example :
Windows NT, Netware, BeOS etc.
Advantages
• Performance: Hybrid kernels can offer better performance than
microkernels because they reduce the number of context switches
required between user space and kernel space.

39

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

• Reliability: Hybrid kernels can offer better reliability than


monolithic kernels because they isolate drivers and other kernel
components in separate protection domains.
• Flexibility: Hybrid kernels can offer better flexibility than
monolithic kernels because they allow different operating system
services to be added or removed without affecting the entire
system.
• Compatibility: Hybrid kernels can be more compatible than
microkernels because they can support a wider range of device
drivers.
Disadvantages
• Complexity: Hybrid kernels can be more complex than monolithic
kernels because they include both monolithic and microkernel
components, which can make the design and implementation more
difficult.
• Security: Hybrid kernels can be less secure than microkernels
because they have a larger attack surface due to the inclusion of
monolithic components.
• Maintenance: Hybrid kernels can be more difficult to maintain
than microkernels because they have a more complex design and
implementation.
• Resource Usage: Hybrid kernels can use more system resources
than microkernels because they include both monolithic and
microkernel components.
4. Exo Kernel
It is the type of kernel which follows end-to-end principle. It has fewest
hardware abstractions as possible. It allocates physical resources to
applications.
Example :
Nemesis, ExOS etc.
Advantages
• Flexibility: Exokernels offer the highest level of flexibility,
allowing developers to customize and optimize the operating
system for their specific application needs.
• Performance: Exokernels are designed to provide better
performance than traditional kernels because they eliminate

40

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

unnecessary abstractions and allow applications to directly access


hardware resources.
• Security: Exokernels provide better security than traditional
kernels because they allow for fine-grained control over the
allocation of system resources, such as memory and CPU time.
• Modularity: Exokernels are highly modular, allowing for the easy
addition or removal of operating system services.
Disadvantages
• Complexity: Exokernels can be more complex to develop than
traditional kernels because they require greater attention to detail
and careful consideration of system resource allocation.
• Development Difficulty: Developing applications for exokernels
can be more difficult than for traditional kernels because
applications must be written to directly access hardware
resources.
• Limited Support: Exokernels are still an emerging technology
and may not have the same level of support and resources as
traditional kernels.
• Debugging Difficulty: Debugging applications and operating
system services on exokernels can be more difficult than on
traditional kernels because of the direct access to hardware
resources.
5. Nano Kernel
It is the type of kernel that offers hardware abstraction but without system
services. Micro Kernel also does not have system services therefore the
Micro Kernel and Nano Kernel have become analogous.
Example :
EROS etc.
Advantages
• Small Size: Nanokernels are designed to be extremely small,
providing only the most essential functions needed to run the
system. This can make them more efficient and faster than other
kernel types.
• High Modularity: Nanokernels are highly modular, allowing for
the easy addition or removal of operating system services, making
them more flexible and customizable than traditional monolithic
kernels.

41

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

• Security: Nanokernels provide better security than traditional


kernels because they have a smaller attack surface and a reduced
risk of errors or bugs in the code.
• Portability: Nanokernels are designed to be highly portable,
allowing them to run on a wide range of hardware architectures.
Disadvantages
• Limited Functionality: Nanokernels provide only the most
essential functions, making them unsuitable for more complex
applications that require a broader range of services.
• Complexity: Because nanokernels provide only essential
functionality, they can be more complex to develop and maintain
than other kernel types.
• Performance: While nanokernels are designed for efficiency,
their minimalist approach may not be able to provide the same
level of performance as other kernel types in certain situations.
• Compatibility: Because of their minimalist design, nanokernels
may not be compatible with all hardware and software
configurations, limiting their practical use in certain contexts.
Functions of Kernel
The kernel is responsible for various critical functions that ensure the
smooth operation of the computer system. These functions include:
1. Process Management
• Scheduling and execution of processes.
• Context switching between processes.
• Process creation and termination.
2. Memory Management
• Allocation and deallocation of memory space.
• Managing virtual memory.
• Handling memory protection and sharing.
3. Device Management
• Managing input/output devices.
• Providing a unified interface for hardware devices.
• Handling device driver communication.
4. File System Management
• Managing file operations and storage.
• Handling file system mounting and unmounting.
• Providing a file system interface to applications.
42

Computer Science & Engineering, AI&ML, IT


OPERATING SYSTEM- BCS-401 2024-25

5. Resource Management
• Managing system resources (CPU time, disk space, network
bandwidth)
• Allocating and deallocating resources as needed
• Monitoring resource usage and enforcing resource limits
6. Security and Access Control
• Enforcing access control policies.
• Managing user permissions and authentication.
• Ensuring system security and integrity.
7. Inter-Process Communication
• Facilitating communication between processes.
• Providing mechanisms like message passing and shared memory.
Working of Kernel
• A kernel loads first into memory when an operating system is
loaded and remains in memory until the operating system is shut
down again. It is responsible for various tasks such as disk
management , task management, and memory management .
• The kernel has a process table that keeps track of all active
processes
• The process table contains a per-process region table whose
entry points to entries in the region table.
• The kernel loads an executable file into memory during the ‘exec’
system call’.
• It decides which process should be allocated to the processor to
execute and which process should be kept in the main memory to
execute. It basically acts as an interface between user applications
and hardware. The major aim of the kernel is to manage
communication between software i.e. user-level applications and
hardware i.e., CPU and disk memory.
Objectives of Kernel
• To establish communication between user-level applications and
hardware.
• To decide the state of incoming processes.
• To control disk management.
• To control memory management.
• To control task management.

43

Computer Science & Engineering, AI&ML, IT

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy