SlideShare a Scribd company logo
Operating System
Assignment
On
Submitted To :
Sir JUBAYER AL MAHMUD
Lecturer, Bangladesh University
Department of CSE
Submitted By :
MD. SADIQUR RAHMAN
ID : 201531043092
Batch No : 43
Department of CSE
BANGLADESH UNIVERSITY
15/1, Iqbal Road, Mohammadpur, Dhaka-1207
1
 What Is Kernel ?
The kernel is the central module of an operating system (OS).
It is the part of the operating system that loads first, and it
remains in main memory. Because it stays in memory, it is
important for the kernel to be as small as possible while still
providing all the essential services required by other parts of
the operating system and applications. The kernel code is
usually loaded into a protected area of memory to prevent it
from being overwritten by programs or other parts of the
operating system.
A kernel connects the application software to the hardware of a computer.
Typically, the kernel is responsible for memory management,
process and task management, and disk management. The
kernel connects the system hardware to the application
software. Every operating system has a kernel. For example
the Linux kernel is used numerous operating systems
including Linux, FreeBSD, Android and others.
2
 Types Of Kernel
Kernels may be classified mainly in two categories
1. Monolithic
2. Micro Kernel
1. Monolithic Kernel
Earlier in this type of kernel architecture, all the basic system
services like process and memory management, interrupt
handling etc were packaged into a single module in kernel
space. This type of architecture led to some serious
drawbacks like 1) Size of kernel, which was huge. 2) Poor
maintainability, which means bug fixing or addition of new
features resulted in recompilation of the whole kernel which
could consume hours.
In a modern day approach to monolithic architecture, the
kernel consists of different modules which can be
dynamically loaded and un-loaded. This modular approach
allows easy extension of OS's capabilities. With this
approach, maintainability of kernel became very easy as only
the concerned module needs to be loaded and unloaded
every time there is a change or bug fix in a particular
module. So, there is no need to bring down and recompile
the whole kernel for a smallest bit of change. Also, stripping
of kernel for various platforms (say for embedded devices
etc) became very easy as we can easily unload the module
that we do not want.
Linux follows the monolithic modular approach.
3
2. Micro Kernel
This architecture majorly caters to the problem of ever
growing size of kernel code which we could not control in
the monolithic approach. This architecture allows some basic
services like device driver management, protocol stack, file
system etc to run in user space. This reduces the kernel code
size and also increases the security and stability of OS as we
have the bare minimum code running in kernel. So, if
suppose a basic service like network service crashes due to
buffer overflow, then only the networking service's memory
would be corrupted, leaving the rest of the system still
functional.
In this architecture, all the basic OS services which are made
part of user space are made to run as servers which are used
by other programs in the system through inter process
communication (IPC). eg: we have servers for device drivers,
network protocol stacks, file systems, graphics, etc.
4
 Linux Kernel Architecture
The Linux kernel is a monolithic kernel, supporting
true preemptive multitasking (both in user mode and, since
the 2.6 series, in kernel mode), virtual memory, shared
libraries, demand loading, shared copy-on-write executables
(via KSM), memory management, the Internet protocol suite,
and threading.
Device drivers and kernel extensions run in kernel space (ring
0 in many CPU architectures), with full access to the
hardware, although some exceptions run in user space, for
example file systems based on FUSE/CUSE, and parts of
UIO. The graphics system most people use with Linux does
not run within the kernel. Unlike standard monolithic kernels,
device drivers are easily configured as modules, and loaded
or unloaded while the system is running. Also, unlike
standard monolithic kernels, device drivers can be pre-
empted under certain conditions; this feature was added to
handle hardware interrupts correctly, and to better
support symmetric multiprocessing. By choice, the Linux
kernel has no binary kernel interface.
The hardware is also incorporated into the file hierarchy.
Device drivers interface to user applications via an entry in
the /dev or /sys directories. Process information as well is
mapped to the file system through the /proc directory.
5
The following illustration shows the architecture of a
Linux system −
The architecture of a Linux System consists of the
following layers −
 Hardware layer − Hardware consists of all peripheral
devices (RAM/ HDD/ CPU etc).
 Kernel − It is the core component of Operating System,
interacts directly with hardware, provides low level
services to upper layer components.
 Shell − An interface to kernel, hiding complexity of
kernel's functions from users. The shell takes
commands from the user and executes kernel's
functions.
6
 Utilities − Utility programs that provide the user most
of the functionalities of an operating systems.
 Properties of the Linux kernel
When discussing architecture of a large and complex
system, you can view the system from many perspectives.
One goal of an architectural decomposition is to provide
a way to better understand the source, and that's what
we'll do here.
The Linux kernel implements a number of important
architectural attributes. At a high level, and at lower
levels, the kernel is layered into a number of distinct
subsystems. Linux can also be considered monolithic
because it lumps all of the basic services into the kernel.
This differs from a microkernel architecture where the
kernel provides basic services such as communication,
I/O, and memory and process management, and more
specific services are plugged in to the microkernel layer.
Each has its own advantages, but I'll steer clear of that
debate.
Over time, the Linux kernel has become efficient in terms
of both memory and CPU usage, as well as extremely
stable. But the most interesting aspect of Linux, given its
size and complexity, is its portability. Linux can be
compiled to run on a huge number of processors and
platforms with different architectural constraints and
needs. One example is the ability for Linux to run on a
process with a memory management unit (MMU), as well
7
as those that provide no MMU. The uClinux port of the
Linux kernel provides for non-MMU support.
 Major subsystems of the Linux kernel
Let's look at some of the major components of the Linux
kernel using the breakdown shown in the Figure as a
guide.
 System Call Interface
The SCI is a thin layer that provides the means to
perform function calls from user space into the kernel. As
discussed previously, this interface can be architecture
dependent, even within the same processor family. The
SCI is actually an interesting function-call multiplexing
and demultiplexing service. You can find the SCI
implementation in ./linux/kernel, as well as architecture-
dependent portions in ./linux/arch.
8
 Process Management
Process management is focused on the execution of
processes. In the kernel, these are called threads and
represent an individual virtualization of the processor
(thread code, data, stack, and CPU registers). In user
space, the term process is typically used, though the
Linux implementation does not separate the two
concepts (processes and threads). The kernel provides an
application program interface (API) through the SCI to
create a new process (fork, exec, or Portable Operating
System Interface [POSIX] functions), stop a process (kill,
exit), and communicate and synchronize between them
(signal, or POSIX mechanisms).
Also in process management is the need to share the
CPU between the active threads. The kernel implements
a novel scheduling algorithm that operates in constant
time, regardless of the number of threads vying for the
CPU. This is called the O(1) scheduler, denoting that the
same amount of time is taken to schedule one thread as
it is to schedule many. The O(1) scheduler also supports
multiple processors (called Symmetric MultiProcessing,
or SMP). You can find the process management sources
in ./linux/kernel and architecture-dependent sources in
./linux/arch).
9
 Memory Management
Another important resource that's managed by the
kernel is memory. For efficiency, given the way that the
hardware manages virtual memory, memory is managed
in what are called pages (4KB in size for most
architectures). Linux includes the means to manage the
available memory, as well as the hardware mechanisms
for physical and virtual mappings.
But memory management is much more than managing
4KB buffers. Linux provides abstractions over 4KB buffers,
such as the slab allocator. This memory management
scheme uses 4KB buffers as its base, but then allocates
structures from within, keeping track of which pages are
full, partially used, and empty. This allows the scheme to
dynamically grow and shrink based on the needs of the
greater system.
Supporting multiple users of memory, there are times
when the available memory can be exhausted. For this
reason, pages can be moved out of memory and onto
the disk. This process is called swapping because the
pages are swapped from memory onto the hard disk.
You can find the memory management sources in
./linux/mm.
10
 File Systems
The term filesystem has two somewhat different
meanings, both of which are commonly used. This can be
confusing to novices, but after a while the meaning is
usually clear from the context.
One meaning is the entire hierarchy of directories (also
referred to as the directory tree) that is used to organize
files on a computer system. On Linux and Unix, the
directories start with the root directory (designated by a
forward slash), which contains a series of subdirectories,
each of which, in turn, contains further subdirectories,
etc.
A variant of this definition is the part of the entire
hierarchy of directories or of the directory tree that is
located on a single partition or disk. (A partition is a
section of a hard disk that contains a single type of
filesystem.)
The second meaning is the type of filesystem, that is,
]how the storage of data (i.e., files, folders, etc.) is
organized on a computer disk (hard disk, floppy disk,
CDROM, etc.) or on a partition on a hard disk. Each type
of filesystem has its own set of rules for controlling the
allocation of disk space to files and for associating data
about each file (referred to as meta data) with that file,
11
such as its filename, the directory in which it is located,
its permissions and its creation date.
An example of a sentence using the word filesystem in
the first sense is: "Alice installed Linux with the filesystem
spread over two hard disks rather than on a single hard
disk." This refers to the fact that [ the entire hierarchy of
directories of ] Linux can be installed on a single disk or
spread over multiple disks, including disks on different
computers (or even disks on computers at different
locations).
An example of a sentence using the second meaning is:
"Bob installed Linux using only the ext3 filesystem
instead of using both the ext2 and ext3 filesystems." This
refers to the fact that a single Linux installation can
contain one or multiple types of filesystems. One hard
disk can contain one or multiple types of filesystems
(each z can be spread across multiple hard disks.
 Virtual file system
The virtual file system (VFS) is an interesting aspect of the
Linux kernel because it provides a common interface
abstraction for file systems. The VFS provides a switching
layer between the SCI and the file systems supported by
the kernel (see the Figure).
12
Figure. The VFS provides a switching fabric between users and file systems
At the top of the VFS is a common API abstraction of
functions such as open, close, read, and write. At the
bottom of the VFS are the file system abstractions that
define how the upper-layer functions are implemented.
These are plug-ins for the given file system (of which
over 50 exist). You can find the file system sources in
./linux/fs.
Below the file system layer is the buffer cache, which
provides a common set of functions to the file system
layer (independent of any particular file system). This
caching layer optimizes access to the physical devices by
keeping data around for a short time (or speculatively
read ahead so that the data is available when needed).
Below the buffer cache are the device drivers, which
implement the interface for the particular physical device.
13
 Network stack
The network stack, by design, follows a layered
architecture modeled after the protocols themselves.
Recall that the Internet Protocol (IP) is the core network
layer protocol that sits below the transport protocol
(most commonly the Transmission Control Protocol, or
TCP). Above TCP is the sockets layer, which is invoked
through the SCI.
The sockets layer is the standard API to the networking
subsystem and provides a user interface to a variety of
networking protocols. From raw frame access to IP
protocol data units (PDUs) and up to TCP and the User
Datagram Protocol (UDP), the sockets layer provides a
standardized way to manage connections and move data
between endpoints. You can find the networking sources
in the kernel at ./linux/net.
 Device drivers
The vast majority of the source code in the Linux kernel
exists in device drivers that make a particular hardware
device usable. The Linux source tree provides a drivers
subdirectory that is further divided by the various
devices that are supported, such as Bluetooth, I2C, serial,
and so on. You can find the device driver sources in
./linux/drivers.
14
 Conclusion
The Linux kernel is one layer in the architecture of the
entire Linux system. The kernel is conceptually composed
of five major subsystems: the process scheduler, the
memory manager, the virtual file system, the network
interface, and the inter-process communication interface.
These subsystems interact with each other using function
calls and shared data structures.
The conceptual architecture of the Linux kernel has
proved its success; essential factors for this success were
the provision for the organization of developers, and the
provision for system extensibility. The Linux kernel
architecture was required to support a large number of
independent volunteer developers. This requirement
suggested that the system portions that require the most
development -- the hardware device drivers and the file
and network protocols -- be implemented in an
extensible fashion. The Linux architect chose to make
these systems be extensible using a data abstraction
technique: each hardware device driver is implemented
as a separate module that supports a common interface.
In this way, a single developer can add a new device
driver, with minimal interaction required with other
developers of the Linux kernel. The success of the kernel
implementation by a large number of volunteer
developers proves the correctness of this strategy.
15
Source links:
https://www.webopedia.com/TERM/K/kernel.html
https://github.com/nu11secur1ty/Kernel-and-Types-of-
kernels/blob/master/Kernel%20and%20Types%20of%20kernels.md
https://en.wikipedia.org/wiki/Linux_kernel
https://www.ibm.com/developerworks/library/l-linux-kernel/index.html
http://docs.huihoo.com/linux/kernel/a1/index.html

More Related Content

What's hot

Embedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernelEmbedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernel
Emertxe Information Technologies Pvt Ltd
 
Linux kernel
Linux kernelLinux kernel
Linux basics
Linux basicsLinux basics
Linux basics
Santosh Khadsare
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
mukul bhardwaj
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
mcganesh
 
Memory management in linux
Memory management in linuxMemory management in linux
Memory management in linux
Dr. C.V. Suresh Babu
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
guest547d74
 
Project ACRN: SR-IOV implementation
Project ACRN: SR-IOV implementationProject ACRN: SR-IOV implementation
Project ACRN: SR-IOV implementation
Geoffroy Van Cutsem
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
anandvaidya
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Device tree support on arm linux
Device tree support on arm linuxDevice tree support on arm linux
Device tree support on arm linux
Chih-Min Chao
 
Introduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra SolutionsIntroduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra Solutions
QUONTRASOLUTIONS
 
X / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural OverviewX / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural Overview
Moriyoshi Koizumi
 
SR-IOV Introduce
SR-IOV IntroduceSR-IOV Introduce
SR-IOV Introduce
Lingfei Kong
 
Operating system kernal
Operating system kernalOperating system kernal
Operating system kernal
Sumit Rajpal
 
Linux Internals - Interview essentials - 1.0
Linux Internals - Interview essentials - 1.0Linux Internals - Interview essentials - 1.0
Linux Internals - Interview essentials - 1.0
Emertxe Information Technologies Pvt Ltd
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt
onu9
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
Stephen Ahiante
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
Tushar B Kute
 
Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0
Emertxe Information Technologies Pvt Ltd
 

What's hot (20)

Embedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernelEmbedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernel
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Linux basics
Linux basicsLinux basics
Linux basics
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Memory management in linux
Memory management in linuxMemory management in linux
Memory management in linux
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
 
Project ACRN: SR-IOV implementation
Project ACRN: SR-IOV implementationProject ACRN: SR-IOV implementation
Project ACRN: SR-IOV implementation
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
Device tree support on arm linux
Device tree support on arm linuxDevice tree support on arm linux
Device tree support on arm linux
 
Introduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra SolutionsIntroduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra Solutions
 
X / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural OverviewX / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural Overview
 
SR-IOV Introduce
SR-IOV IntroduceSR-IOV Introduce
SR-IOV Introduce
 
Operating system kernal
Operating system kernalOperating system kernal
Operating system kernal
 
Linux Internals - Interview essentials - 1.0
Linux Internals - Interview essentials - 1.0Linux Internals - Interview essentials - 1.0
Linux Internals - Interview essentials - 1.0
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 
Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0
 

Similar to Linux kernel Architecture and Properties

In a monolithic kerne1
In a monolithic kerne1In a monolithic kerne1
In a monolithic kerne1
Teja Bheemanapally
 
In a monolithic kerne1
In a monolithic kerne1In a monolithic kerne1
In a monolithic kerne1
Teja Bheemanapally
 
Kernel (computing)
Kernel (computing)Kernel (computing)
Kernel (computing)
Teja Bheemanapally
 
Kernel (computing)
Kernel (computing)Kernel (computing)
Kernel (computing)
Teja Bheemanapally
 
In a monolithic kernel
In a monolithic kernelIn a monolithic kernel
In a monolithic kernel
Teja Bheemanapally
 
Walking around linux kernel
Walking around linux kernelWalking around linux kernel
Walking around linux kernel
Dharshana Kasun Warusavitharana
 
MIcrokernel
MIcrokernelMIcrokernel
MIcrokernel
Abu Azzam
 
ITT Project Information Technology Basic
ITT Project Information Technology BasicITT Project Information Technology Basic
ITT Project Information Technology Basic
Mayank Garg
 
Kernel. Operating System
Kernel. Operating SystemKernel. Operating System
Kernel. Operating System
pratikkadam78
 
Os Ds Arch
Os Ds ArchOs Ds Arch
Os Ds Arch
harinder singh
 
Ap 06 4_10_simek
Ap 06 4_10_simekAp 06 4_10_simek
Ap 06 4_10_simek
Nguyen Vinh
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
mcganesh
 
Linux internal
Linux internalLinux internal
Linux internal
mcganesh
 
Operating system 15 micro kernel based os
Operating system 15 micro kernel based osOperating system 15 micro kernel based os
Operating system 15 micro kernel based os
Vaibhav Khanna
 
KERNEL.pptx
KERNEL.pptxKERNEL.pptx
KERNEL.pptx
codebyraza
 
Studies
StudiesStudies
UNIX INTERNALS UNIT-I
UNIX INTERNALS UNIT-IUNIX INTERNALS UNIT-I
UNIX INTERNALS UNIT-I
JK Knowledge
 
Symmetric multiprocessing and Microkernel
Symmetric multiprocessing and MicrokernelSymmetric multiprocessing and Microkernel
Symmetric multiprocessing and Microkernel
Manoraj Pannerselum
 
Ubuntu
UbuntuUbuntu
Hybrid kernel
Hybrid kernelHybrid kernel
Hybrid kernel
Abu Azzam
 

Similar to Linux kernel Architecture and Properties (20)

In a monolithic kerne1
In a monolithic kerne1In a monolithic kerne1
In a monolithic kerne1
 
In a monolithic kerne1
In a monolithic kerne1In a monolithic kerne1
In a monolithic kerne1
 
Kernel (computing)
Kernel (computing)Kernel (computing)
Kernel (computing)
 
Kernel (computing)
Kernel (computing)Kernel (computing)
Kernel (computing)
 
In a monolithic kernel
In a monolithic kernelIn a monolithic kernel
In a monolithic kernel
 
Walking around linux kernel
Walking around linux kernelWalking around linux kernel
Walking around linux kernel
 
MIcrokernel
MIcrokernelMIcrokernel
MIcrokernel
 
ITT Project Information Technology Basic
ITT Project Information Technology BasicITT Project Information Technology Basic
ITT Project Information Technology Basic
 
Kernel. Operating System
Kernel. Operating SystemKernel. Operating System
Kernel. Operating System
 
Os Ds Arch
Os Ds ArchOs Ds Arch
Os Ds Arch
 
Ap 06 4_10_simek
Ap 06 4_10_simekAp 06 4_10_simek
Ap 06 4_10_simek
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Linux internal
Linux internalLinux internal
Linux internal
 
Operating system 15 micro kernel based os
Operating system 15 micro kernel based osOperating system 15 micro kernel based os
Operating system 15 micro kernel based os
 
KERNEL.pptx
KERNEL.pptxKERNEL.pptx
KERNEL.pptx
 
Studies
StudiesStudies
Studies
 
UNIX INTERNALS UNIT-I
UNIX INTERNALS UNIT-IUNIX INTERNALS UNIT-I
UNIX INTERNALS UNIT-I
 
Symmetric multiprocessing and Microkernel
Symmetric multiprocessing and MicrokernelSymmetric multiprocessing and Microkernel
Symmetric multiprocessing and Microkernel
 
Ubuntu
UbuntuUbuntu
Ubuntu
 
Hybrid kernel
Hybrid kernelHybrid kernel
Hybrid kernel
 

Recently uploaded

Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
Pravash Chandra Das
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
saastr
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
GDSC PJATK
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
flufftailshop
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 

Recently uploaded (20)

Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 

Linux kernel Architecture and Properties

  • 1. Operating System Assignment On Submitted To : Sir JUBAYER AL MAHMUD Lecturer, Bangladesh University Department of CSE Submitted By : MD. SADIQUR RAHMAN ID : 201531043092 Batch No : 43 Department of CSE BANGLADESH UNIVERSITY 15/1, Iqbal Road, Mohammadpur, Dhaka-1207
  • 2. 1  What Is Kernel ? The kernel is the central module of an operating system (OS). It is the part of the operating system that loads first, and it remains in main memory. Because it stays in memory, it is important for the kernel to be as small as possible while still providing all the essential services required by other parts of the operating system and applications. The kernel code is usually loaded into a protected area of memory to prevent it from being overwritten by programs or other parts of the operating system. A kernel connects the application software to the hardware of a computer. Typically, the kernel is responsible for memory management, process and task management, and disk management. The kernel connects the system hardware to the application software. Every operating system has a kernel. For example the Linux kernel is used numerous operating systems including Linux, FreeBSD, Android and others.
  • 3. 2  Types Of Kernel Kernels may be classified mainly in two categories 1. Monolithic 2. Micro Kernel 1. Monolithic Kernel Earlier in this type of kernel architecture, all the basic system services like process and memory management, interrupt handling etc were packaged into a single module in kernel space. This type of architecture led to some serious drawbacks like 1) Size of kernel, which was huge. 2) Poor maintainability, which means bug fixing or addition of new features resulted in recompilation of the whole kernel which could consume hours. In a modern day approach to monolithic architecture, the kernel consists of different modules which can be dynamically loaded and un-loaded. This modular approach allows easy extension of OS's capabilities. With this approach, maintainability of kernel became very easy as only the concerned module needs to be loaded and unloaded every time there is a change or bug fix in a particular module. So, there is no need to bring down and recompile the whole kernel for a smallest bit of change. Also, stripping of kernel for various platforms (say for embedded devices etc) became very easy as we can easily unload the module that we do not want. Linux follows the monolithic modular approach.
  • 4. 3 2. Micro Kernel This architecture majorly caters to the problem of ever growing size of kernel code which we could not control in the monolithic approach. This architecture allows some basic services like device driver management, protocol stack, file system etc to run in user space. This reduces the kernel code size and also increases the security and stability of OS as we have the bare minimum code running in kernel. So, if suppose a basic service like network service crashes due to buffer overflow, then only the networking service's memory would be corrupted, leaving the rest of the system still functional. In this architecture, all the basic OS services which are made part of user space are made to run as servers which are used by other programs in the system through inter process communication (IPC). eg: we have servers for device drivers, network protocol stacks, file systems, graphics, etc.
  • 5. 4  Linux Kernel Architecture The Linux kernel is a monolithic kernel, supporting true preemptive multitasking (both in user mode and, since the 2.6 series, in kernel mode), virtual memory, shared libraries, demand loading, shared copy-on-write executables (via KSM), memory management, the Internet protocol suite, and threading. Device drivers and kernel extensions run in kernel space (ring 0 in many CPU architectures), with full access to the hardware, although some exceptions run in user space, for example file systems based on FUSE/CUSE, and parts of UIO. The graphics system most people use with Linux does not run within the kernel. Unlike standard monolithic kernels, device drivers are easily configured as modules, and loaded or unloaded while the system is running. Also, unlike standard monolithic kernels, device drivers can be pre- empted under certain conditions; this feature was added to handle hardware interrupts correctly, and to better support symmetric multiprocessing. By choice, the Linux kernel has no binary kernel interface. The hardware is also incorporated into the file hierarchy. Device drivers interface to user applications via an entry in the /dev or /sys directories. Process information as well is mapped to the file system through the /proc directory.
  • 6. 5 The following illustration shows the architecture of a Linux system − The architecture of a Linux System consists of the following layers −  Hardware layer − Hardware consists of all peripheral devices (RAM/ HDD/ CPU etc).  Kernel − It is the core component of Operating System, interacts directly with hardware, provides low level services to upper layer components.  Shell − An interface to kernel, hiding complexity of kernel's functions from users. The shell takes commands from the user and executes kernel's functions.
  • 7. 6  Utilities − Utility programs that provide the user most of the functionalities of an operating systems.  Properties of the Linux kernel When discussing architecture of a large and complex system, you can view the system from many perspectives. One goal of an architectural decomposition is to provide a way to better understand the source, and that's what we'll do here. The Linux kernel implements a number of important architectural attributes. At a high level, and at lower levels, the kernel is layered into a number of distinct subsystems. Linux can also be considered monolithic because it lumps all of the basic services into the kernel. This differs from a microkernel architecture where the kernel provides basic services such as communication, I/O, and memory and process management, and more specific services are plugged in to the microkernel layer. Each has its own advantages, but I'll steer clear of that debate. Over time, the Linux kernel has become efficient in terms of both memory and CPU usage, as well as extremely stable. But the most interesting aspect of Linux, given its size and complexity, is its portability. Linux can be compiled to run on a huge number of processors and platforms with different architectural constraints and needs. One example is the ability for Linux to run on a process with a memory management unit (MMU), as well
  • 8. 7 as those that provide no MMU. The uClinux port of the Linux kernel provides for non-MMU support.  Major subsystems of the Linux kernel Let's look at some of the major components of the Linux kernel using the breakdown shown in the Figure as a guide.  System Call Interface The SCI is a thin layer that provides the means to perform function calls from user space into the kernel. As discussed previously, this interface can be architecture dependent, even within the same processor family. The SCI is actually an interesting function-call multiplexing and demultiplexing service. You can find the SCI implementation in ./linux/kernel, as well as architecture- dependent portions in ./linux/arch.
  • 9. 8  Process Management Process management is focused on the execution of processes. In the kernel, these are called threads and represent an individual virtualization of the processor (thread code, data, stack, and CPU registers). In user space, the term process is typically used, though the Linux implementation does not separate the two concepts (processes and threads). The kernel provides an application program interface (API) through the SCI to create a new process (fork, exec, or Portable Operating System Interface [POSIX] functions), stop a process (kill, exit), and communicate and synchronize between them (signal, or POSIX mechanisms). Also in process management is the need to share the CPU between the active threads. The kernel implements a novel scheduling algorithm that operates in constant time, regardless of the number of threads vying for the CPU. This is called the O(1) scheduler, denoting that the same amount of time is taken to schedule one thread as it is to schedule many. The O(1) scheduler also supports multiple processors (called Symmetric MultiProcessing, or SMP). You can find the process management sources in ./linux/kernel and architecture-dependent sources in ./linux/arch).
  • 10. 9  Memory Management Another important resource that's managed by the kernel is memory. For efficiency, given the way that the hardware manages virtual memory, memory is managed in what are called pages (4KB in size for most architectures). Linux includes the means to manage the available memory, as well as the hardware mechanisms for physical and virtual mappings. But memory management is much more than managing 4KB buffers. Linux provides abstractions over 4KB buffers, such as the slab allocator. This memory management scheme uses 4KB buffers as its base, but then allocates structures from within, keeping track of which pages are full, partially used, and empty. This allows the scheme to dynamically grow and shrink based on the needs of the greater system. Supporting multiple users of memory, there are times when the available memory can be exhausted. For this reason, pages can be moved out of memory and onto the disk. This process is called swapping because the pages are swapped from memory onto the hard disk. You can find the memory management sources in ./linux/mm.
  • 11. 10  File Systems The term filesystem has two somewhat different meanings, both of which are commonly used. This can be confusing to novices, but after a while the meaning is usually clear from the context. One meaning is the entire hierarchy of directories (also referred to as the directory tree) that is used to organize files on a computer system. On Linux and Unix, the directories start with the root directory (designated by a forward slash), which contains a series of subdirectories, each of which, in turn, contains further subdirectories, etc. A variant of this definition is the part of the entire hierarchy of directories or of the directory tree that is located on a single partition or disk. (A partition is a section of a hard disk that contains a single type of filesystem.) The second meaning is the type of filesystem, that is, ]how the storage of data (i.e., files, folders, etc.) is organized on a computer disk (hard disk, floppy disk, CDROM, etc.) or on a partition on a hard disk. Each type of filesystem has its own set of rules for controlling the allocation of disk space to files and for associating data about each file (referred to as meta data) with that file,
  • 12. 11 such as its filename, the directory in which it is located, its permissions and its creation date. An example of a sentence using the word filesystem in the first sense is: "Alice installed Linux with the filesystem spread over two hard disks rather than on a single hard disk." This refers to the fact that [ the entire hierarchy of directories of ] Linux can be installed on a single disk or spread over multiple disks, including disks on different computers (or even disks on computers at different locations). An example of a sentence using the second meaning is: "Bob installed Linux using only the ext3 filesystem instead of using both the ext2 and ext3 filesystems." This refers to the fact that a single Linux installation can contain one or multiple types of filesystems. One hard disk can contain one or multiple types of filesystems (each z can be spread across multiple hard disks.  Virtual file system The virtual file system (VFS) is an interesting aspect of the Linux kernel because it provides a common interface abstraction for file systems. The VFS provides a switching layer between the SCI and the file systems supported by the kernel (see the Figure).
  • 13. 12 Figure. The VFS provides a switching fabric between users and file systems At the top of the VFS is a common API abstraction of functions such as open, close, read, and write. At the bottom of the VFS are the file system abstractions that define how the upper-layer functions are implemented. These are plug-ins for the given file system (of which over 50 exist). You can find the file system sources in ./linux/fs. Below the file system layer is the buffer cache, which provides a common set of functions to the file system layer (independent of any particular file system). This caching layer optimizes access to the physical devices by keeping data around for a short time (or speculatively read ahead so that the data is available when needed). Below the buffer cache are the device drivers, which implement the interface for the particular physical device.
  • 14. 13  Network stack The network stack, by design, follows a layered architecture modeled after the protocols themselves. Recall that the Internet Protocol (IP) is the core network layer protocol that sits below the transport protocol (most commonly the Transmission Control Protocol, or TCP). Above TCP is the sockets layer, which is invoked through the SCI. The sockets layer is the standard API to the networking subsystem and provides a user interface to a variety of networking protocols. From raw frame access to IP protocol data units (PDUs) and up to TCP and the User Datagram Protocol (UDP), the sockets layer provides a standardized way to manage connections and move data between endpoints. You can find the networking sources in the kernel at ./linux/net.  Device drivers The vast majority of the source code in the Linux kernel exists in device drivers that make a particular hardware device usable. The Linux source tree provides a drivers subdirectory that is further divided by the various devices that are supported, such as Bluetooth, I2C, serial, and so on. You can find the device driver sources in ./linux/drivers.
  • 15. 14  Conclusion The Linux kernel is one layer in the architecture of the entire Linux system. The kernel is conceptually composed of five major subsystems: the process scheduler, the memory manager, the virtual file system, the network interface, and the inter-process communication interface. These subsystems interact with each other using function calls and shared data structures. The conceptual architecture of the Linux kernel has proved its success; essential factors for this success were the provision for the organization of developers, and the provision for system extensibility. The Linux kernel architecture was required to support a large number of independent volunteer developers. This requirement suggested that the system portions that require the most development -- the hardware device drivers and the file and network protocols -- be implemented in an extensible fashion. The Linux architect chose to make these systems be extensible using a data abstraction technique: each hardware device driver is implemented as a separate module that supports a common interface. In this way, a single developer can add a new device driver, with minimal interaction required with other developers of the Linux kernel. The success of the kernel implementation by a large number of volunteer developers proves the correctness of this strategy.