SlideShare a Scribd company logo
1 of 28
LINUX KERNEL
Presented by:
Rohit Pratap Singh
CS- 05/09
Jorhat Engineering College
Background on Linux
Linus Torvalds
– Creator of Linux
Open Source Operating System
Free Software
Source Code Available
WHAT IS A KERNEL?
CORE OF THE
OPERATING
SYSTEM
KERNEL
Architecture
Monolithic
Contains all
the OS
related stuff
1. Microkernel
Contains only
the OS core
2. Hybrid
Combination
of Monolithic
& Microkernel
3.
Linux Kernel is implemented using Monolithic Architecture
Difference
KERNEL MODULE
 Sections of kernel code that can be compiled, loaded, and
unloaded independent of the rest of the kernel.
 A kernel module may typically implement a device driver, a
file system, or a networking protocol.
 The module interface allows third parties to write and
distribute, on their own terms, device drivers or file systems
that could not be distributed under the GPL.
 Kernel modules allow a Linux system to be set up with a
standard, minimal kernel, without any extra device drivers
built in.
 Three components to Linux module support:
◦ module management
◦ driver registration
◦ conflict resolution
Module Management
 Supports loading modules into memory and letting
them talk to the rest of the kernel.
 Module loading is split into two separate sections:
◦ Managing sections of module code in kernel
memory
◦ Handling symbols that modules are allowed to
reference
 The module requestor manages loading requested,
but currently unloaded, modules; it also regularly
queries the kernel to see whether a dynamically
loaded module is still in use, and will unload it
when it is no longer actively needed.
Driver Registration
 Allows modules to tell the rest of the kernel that a
new driver has become available.
 The kernel maintains dynamic tables of all known
drivers, and provides a set of routines to allow
drivers to be added to or removed from these
tables at any time.
 Registration tables include the following items:
◦ Device drivers
◦ File systems
◦ Network protocols
◦ Binary format
Conflict Resolution
 A mechanism that allows different device drivers to
reserve hardware resources and to protect those
resources from accidental use by another driver
 The conflict resolution module aims to:
◦ Prevent modules from clashing over access to
hardware resources
◦ Prevent auto probes from interfering with existing
device drivers
◦ Resolve conflicts with multiple drivers trying to
access the same hardware
Linux Kernel Functional
Overview
Process Management
Memory Management
Kernel Synchronization
File System Management
Inter-process communication
Device and I/O Management
Network Management
Security
Process Management
Linux
implements the
fork() and exec()
process model.
Process identity consists of-
•Process ID (PID): unique identifier, used to specify the
process to the kernel when an application makes a system
call to signal, modify, or wait for another process.
•Credentials: Each process must have an associated user ID
and one or more group IDs that determine the process’s rights
to access system resources and files.
•Personality: Not traditionally found on UNIX systems, but
under Linux each process has an associated personality
identifier that can slightly modify the semantics of certain
system calls.
Used primarily by emulation libraries to request that system
calls be compatible with certain specific flavors of UNIX.
The process’s environment is inherited from its
parent, and is composed of two null-terminated
vectors:
The argument vector lists the command-line
arguments used to invoke the running program;
conventionally starts with the name of the
program itself
The environment vector is a list of
“NAME=VALUE” pairs that associates named
environment variables with arbitrary textual
values.
Process context: state of the running
program; includes scheduling context,
accounting information, file table, file-system
context, signal-handler table, and virtual
memory context
Memory Management
The Linux kernel
allocates memory to
itself using the buddy
system as well as slab
allocation.
Virtual memory paging
system allocates
memory to processes.
The pageout-policy
algorithm decides which
pages to write out to
disk.
Uses a modified
version of the
second-chance
(clock) algorithm.
Each page has an
age that is
adjusted on each
pass of the clock.
The age value
allows the
algorithm to select
pages on a LRU
policy.
The paging mechanism
actually carries out the
transfer, and pages data
back into physical
memory as needed:
Supports paging
both to dedicated
swap partitions
and to normal files.
Uses a next-fit
algorithm to write
pages to
contiguous disk
blocks.
Splitting of Memory in a Buddy
Heap
Kernel Synchronization
A request for
kernel-mode
execution can
occur in two ways
A running program may
request an operating
system service, either
explicitly via a system
call, or implicitly, for
example, when a page
fault occurs.
A device driver may
deliver a hardware
interrupt that causes the
CPU to start executing a
kernel-defined handler for
that interrupt.
Kernel
synchronization
requires a
framework that
will allow the
kernel’s critical
sections to run
without
interruption by
another critical
section.
Linux introduced
a preemptive
kernel in Version
2.6
Linux provides
semaphores for locking in
the kernel.
Multiprocessor machines
use spinlocks for short
durations; single
processor machines
disable preemption
instead.
File System
 To the user, Linux’s file system appears as a hierarchical
directory tree obeying UNIX semantics.
 Internally, the kernel hides implementation details and
manages the multiple different file systems via an abstraction
layer, that is, the virtual file system (VFS).
 The Linux VFS is designed around object-oriented principles
and is composed of two components:
◦ A set of definitions that define what a file object is allowed
to look like
 The inode-object and the file-object structures represent
individual files
 the file system object represents an entire file system
◦ A layer of software to manipulate those objects.
The Linux Ext2fs File System
 Ext2fs uses a mechanism similar to that of BSD Fast File
System (ffs) for locating data blocks belonging to a specific
file.
 The main differences between ext2fs and ffs concern their
disk allocation policies.
◦ In ffs, the disk is allocated to files in blocks of 8Kb, with
blocks being subdivided into fragments of 1Kb to store
small files or partially filled blocks at the end of a file.
◦ Ext2fs does not use fragments; it performs its allocations in
smaller units. The default block size on ext2fs is 1Kb,
although 2Kb and 4Kb blocks are also supported.
◦ Ext2fs uses allocation policies designed to place logically
adjacent blocks of a file into physically adjacent blocks on
disk, so that it can submit an I/O request for several disk
blocks as a single operation.
Ext2fs Block-Allocation
Policies
More ext standards (the
extended file system)
• Journaling file system: keeps track
of changes to be made in a journal,
which makes the system easier to
restore after a crash
ext3:
• Can pre-allocate on-disk space for a
file
• Provides timestamps measured in
nanoseconds
ext4:
Input and Output
Device drivers appear as normal files.
• Users open an access channel to a device in the
same way they open any other file.
• Devices are protected by the same permission
system as files.
Linux recognizes three classes of devices:
• Block devices: allow random access to independent, fixed-size blocks
of data (e.g. disks, CD-ROMs, flash memory)
• Character devices: sequential access, data not necessarily in blocks
• Network devices: users communicate with network devices through
the kernel’s network subsystem
Interprocess Communication
Linux informs processes
that an event has
occurred via signals.
• There is a limited number of
signals, and they cannot
carry information.
• Communication within the
kernel is accomplished via
scheduling states and wait
queue structures.
Mechanisms for passing
data between processes:
• The pipe mechanism
allows a child process to
inherit a communication
channel to its parent, data
written to one end of the
pipe can be read a the
other.
• Shared memory: any data written
by one process to a shared memory region
can be read immediately by any other
process that has mapped that region into its
address space.
Network Management
Networking is a key area of
functionality for Linux.
• It supports the standard
Internet protocols for
UNIX-to-UNIX
communications.
• It also implements
protocols native to non-
UNIX operating systems,
e.g., Appletalk and IPX.
Networking in the Linux
kernel is implemented by
three software layers:
• Socket interface: works
with network addresses for
a variety of network
protocols
• Protocol drivers:
implements creation and
reassembly of packets,
routing between hosts, etc.
• Network device drivers:
interface with specific
devices
Security
Authentication: no one can access system without entry
rights
• Uses a password file to store encrypted passwords.
• Pluggable authentication modules (PAM): allows on-demand loading of
authentication modules that improve security
Access control: no one can access objects within the
system without access rights
• Files, devices, and other objects share the same access-control system.
• Implemented through numeric identifiers for users (UID) and groups (GID)
• Objects have a protection mask that specifies which access modes (read,
write, or execute) are granted to owner, group, and world.
Linux Source Tree Layout
/usr/src/linuxDocumentation
arch
fs
init kernel
include
ipc
drivers
net
mmlib
scripts
alpha
arm
i386
ia64
m68k
mips
mips64
ppc
s390
sh
sparc
sparc64
acorn
atm
block
cdrom
char
dio
fc4
i2c
i2o
ide
ieee1394
isdn
macintosh
misc
net
…
adfs
affs
autofs
autofs4
bfs
code
cramfs
devfs
devpts
efs
ext2
fat
hfs
hpfs
…
asm-alpha
asm-arm
asm-generic
asm-i386
asm-ia64
asm-m68k
asm-mips
asm-mips64
linux
math-emu
net
pcmcia
scsi
video …
adfs
affs
autofs
autofs4
bfs
code
cramfs
devfs
devpts
efs
ext2
fat
hfs
hpfs …
802
appletalk
atm
ax25
bridge
core
decnet
econet
ethernet
ipv4
ipv6
ipx
irda
khttpd
lapb
…
Linux kernel development
cycle
Linux kernel development
cycle
 Version 0.01 (May 1991) had no networking, ran only on
80386-compatible Intel processors and on PC hardware, had
extremely limited device-drive support, and supported only
the Minix file system.
 Linux 1.0 (March 1994) included these new features:
◦ Support for UNIX’s standard TCP/IP networking protocols
◦ BSD-compatible socket interface for networking
programming
◦ Device-driver support for running IP over an Ethernet
◦ Enhanced file system
◦ Support for a range of SCSI controllers for
high-performance disk access
◦ Extra hardware support
 Version 1.2 (March 1995) was the final PC-only Linux kernel.
Linux 2.0
 Released in June 1996, 2.0 added two major new
capabilities:
◦ Support for multiple architectures, including a fully 64-bit
native Alpha port.
◦ Support for multiprocessor architectures
 Other new features included:
◦ Improved memory-management code
◦ Improved TCP/IP performance
◦ Support for internal kernel threads, for handling
dependencies between loadable modules, and for
automatic loading of modules on demand.
◦ Standardized configuration interface
Conclusion
Stability
Runs on
old
hardware
Free and
opensource
Security
THANK YOU
Contact info – rohitkako@gmail.com
www.facebook.com/rohitkako

More Related Content

What's hot

Linux architecture
Linux architectureLinux architecture
Linux architecturemcganesh
 
Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Pankaj Suryawanshi
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory ManagementNi Zo-Ma
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/CoreShay Cohen
 
Linux operating system
Linux operating systemLinux operating system
Linux operating systemITz_1
 
Linux memory-management-kamal
Linux memory-management-kamalLinux memory-management-kamal
Linux memory-management-kamalKamal Maiti
 
Memory Compaction in Linux Kernel.pdf
Memory Compaction in Linux Kernel.pdfMemory Compaction in Linux Kernel.pdf
Memory Compaction in Linux Kernel.pdfAdrian Huang
 
Linux Operating System
Linux Operating SystemLinux Operating System
Linux Operating SystemKunalKewat1
 
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 SolutionsQUONTRASOLUTIONS
 
Linux kernel architecture
Linux kernel architectureLinux kernel architecture
Linux kernel architectureSHAJANA BASHEER
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linuxsureskal
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingTushar B Kute
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Ahmed El-Arabawy
 
Files and directories in Linux 6
Files and directories  in Linux 6Files and directories  in Linux 6
Files and directories in Linux 6Meenakshi Paul
 

What's hot (20)

Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Linux
Linux Linux
Linux
 
Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
Linux operating system
Linux operating systemLinux operating system
Linux operating system
 
Linux memory-management-kamal
Linux memory-management-kamalLinux memory-management-kamal
Linux memory-management-kamal
 
Ubuntu File System
Ubuntu File SystemUbuntu File System
Ubuntu File System
 
Memory Compaction in Linux Kernel.pdf
Memory Compaction in Linux Kernel.pdfMemory Compaction in Linux Kernel.pdf
Memory Compaction in Linux Kernel.pdf
 
Linux Operating System
Linux Operating SystemLinux Operating System
Linux Operating System
 
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
 
Linux kernel architecture
Linux kernel architectureLinux kernel architecture
Linux kernel architecture
 
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
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1)
 
Os Linux
Os LinuxOs Linux
Os Linux
 
Files and directories in Linux 6
Files and directories  in Linux 6Files and directories  in Linux 6
Files and directories in Linux 6
 
Presentation on linux
Presentation on linuxPresentation on linux
Presentation on linux
 

Similar to linux kernel overview 2013

Similar to linux kernel overview 2013 (20)

Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Mca ii os u-5 unix linux file system
Mca  ii  os u-5 unix linux file systemMca  ii  os u-5 unix linux file system
Mca ii os u-5 unix linux file system
 
Ch22
Ch22Ch22
Ch22
 
OS_Ch20
OS_Ch20OS_Ch20
OS_Ch20
 
OSCh20
OSCh20OSCh20
OSCh20
 
Ch20 OS
Ch20 OSCh20 OS
Ch20 OS
 
Studies
StudiesStudies
Studies
 
Linux os
Linux osLinux os
Linux os
 
Linux@assignment ppt
Linux@assignment pptLinux@assignment ppt
Linux@assignment ppt
 
Driver Programming Report
Driver Programming ReportDriver Programming Report
Driver Programming Report
 
Operating system
Operating systemOperating system
Operating system
 
Chapter 21 - The Linux System
Chapter 21 - The Linux SystemChapter 21 - The Linux System
Chapter 21 - The Linux System
 
Io sy.stemppt
Io sy.stempptIo sy.stemppt
Io sy.stemppt
 
CS8493-OS-Unit-5.pdf
CS8493-OS-Unit-5.pdfCS8493-OS-Unit-5.pdf
CS8493-OS-Unit-5.pdf
 
Cs8493 unit 5
Cs8493 unit 5Cs8493 unit 5
Cs8493 unit 5
 
Ubuntu OS Presentation
Ubuntu OS PresentationUbuntu OS Presentation
Ubuntu OS Presentation
 
Microx - A Unix like kernel for Embedded Systems written from scratch.
Microx - A Unix like kernel for Embedded Systems written from scratch.Microx - A Unix like kernel for Embedded Systems written from scratch.
Microx - A Unix like kernel for Embedded Systems written from scratch.
 
Linux vs windows
Linux vs windowsLinux vs windows
Linux vs windows
 
Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)
 
UNIT I.pptx
UNIT I.pptxUNIT I.pptx
UNIT I.pptx
 

Recently uploaded

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 

Recently uploaded (20)

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 

linux kernel overview 2013

  • 1. LINUX KERNEL Presented by: Rohit Pratap Singh CS- 05/09 Jorhat Engineering College
  • 2. Background on Linux Linus Torvalds – Creator of Linux Open Source Operating System Free Software Source Code Available
  • 3. WHAT IS A KERNEL? CORE OF THE OPERATING SYSTEM
  • 4. KERNEL Architecture Monolithic Contains all the OS related stuff 1. Microkernel Contains only the OS core 2. Hybrid Combination of Monolithic & Microkernel 3. Linux Kernel is implemented using Monolithic Architecture
  • 6. KERNEL MODULE  Sections of kernel code that can be compiled, loaded, and unloaded independent of the rest of the kernel.  A kernel module may typically implement a device driver, a file system, or a networking protocol.  The module interface allows third parties to write and distribute, on their own terms, device drivers or file systems that could not be distributed under the GPL.  Kernel modules allow a Linux system to be set up with a standard, minimal kernel, without any extra device drivers built in.  Three components to Linux module support: ◦ module management ◦ driver registration ◦ conflict resolution
  • 7. Module Management  Supports loading modules into memory and letting them talk to the rest of the kernel.  Module loading is split into two separate sections: ◦ Managing sections of module code in kernel memory ◦ Handling symbols that modules are allowed to reference  The module requestor manages loading requested, but currently unloaded, modules; it also regularly queries the kernel to see whether a dynamically loaded module is still in use, and will unload it when it is no longer actively needed.
  • 8. Driver Registration  Allows modules to tell the rest of the kernel that a new driver has become available.  The kernel maintains dynamic tables of all known drivers, and provides a set of routines to allow drivers to be added to or removed from these tables at any time.  Registration tables include the following items: ◦ Device drivers ◦ File systems ◦ Network protocols ◦ Binary format
  • 9. Conflict Resolution  A mechanism that allows different device drivers to reserve hardware resources and to protect those resources from accidental use by another driver  The conflict resolution module aims to: ◦ Prevent modules from clashing over access to hardware resources ◦ Prevent auto probes from interfering with existing device drivers ◦ Resolve conflicts with multiple drivers trying to access the same hardware
  • 10. Linux Kernel Functional Overview Process Management Memory Management Kernel Synchronization File System Management Inter-process communication Device and I/O Management Network Management Security
  • 11. Process Management Linux implements the fork() and exec() process model. Process identity consists of- •Process ID (PID): unique identifier, used to specify the process to the kernel when an application makes a system call to signal, modify, or wait for another process. •Credentials: Each process must have an associated user ID and one or more group IDs that determine the process’s rights to access system resources and files. •Personality: Not traditionally found on UNIX systems, but under Linux each process has an associated personality identifier that can slightly modify the semantics of certain system calls. Used primarily by emulation libraries to request that system calls be compatible with certain specific flavors of UNIX. The process’s environment is inherited from its parent, and is composed of two null-terminated vectors: The argument vector lists the command-line arguments used to invoke the running program; conventionally starts with the name of the program itself The environment vector is a list of “NAME=VALUE” pairs that associates named environment variables with arbitrary textual values. Process context: state of the running program; includes scheduling context, accounting information, file table, file-system context, signal-handler table, and virtual memory context
  • 12. Memory Management The Linux kernel allocates memory to itself using the buddy system as well as slab allocation. Virtual memory paging system allocates memory to processes. The pageout-policy algorithm decides which pages to write out to disk. Uses a modified version of the second-chance (clock) algorithm. Each page has an age that is adjusted on each pass of the clock. The age value allows the algorithm to select pages on a LRU policy. The paging mechanism actually carries out the transfer, and pages data back into physical memory as needed: Supports paging both to dedicated swap partitions and to normal files. Uses a next-fit algorithm to write pages to contiguous disk blocks.
  • 13. Splitting of Memory in a Buddy Heap
  • 14. Kernel Synchronization A request for kernel-mode execution can occur in two ways A running program may request an operating system service, either explicitly via a system call, or implicitly, for example, when a page fault occurs. A device driver may deliver a hardware interrupt that causes the CPU to start executing a kernel-defined handler for that interrupt. Kernel synchronization requires a framework that will allow the kernel’s critical sections to run without interruption by another critical section. Linux introduced a preemptive kernel in Version 2.6 Linux provides semaphores for locking in the kernel. Multiprocessor machines use spinlocks for short durations; single processor machines disable preemption instead.
  • 15. File System  To the user, Linux’s file system appears as a hierarchical directory tree obeying UNIX semantics.  Internally, the kernel hides implementation details and manages the multiple different file systems via an abstraction layer, that is, the virtual file system (VFS).  The Linux VFS is designed around object-oriented principles and is composed of two components: ◦ A set of definitions that define what a file object is allowed to look like  The inode-object and the file-object structures represent individual files  the file system object represents an entire file system ◦ A layer of software to manipulate those objects.
  • 16. The Linux Ext2fs File System  Ext2fs uses a mechanism similar to that of BSD Fast File System (ffs) for locating data blocks belonging to a specific file.  The main differences between ext2fs and ffs concern their disk allocation policies. ◦ In ffs, the disk is allocated to files in blocks of 8Kb, with blocks being subdivided into fragments of 1Kb to store small files or partially filled blocks at the end of a file. ◦ Ext2fs does not use fragments; it performs its allocations in smaller units. The default block size on ext2fs is 1Kb, although 2Kb and 4Kb blocks are also supported. ◦ Ext2fs uses allocation policies designed to place logically adjacent blocks of a file into physically adjacent blocks on disk, so that it can submit an I/O request for several disk blocks as a single operation.
  • 18. More ext standards (the extended file system) • Journaling file system: keeps track of changes to be made in a journal, which makes the system easier to restore after a crash ext3: • Can pre-allocate on-disk space for a file • Provides timestamps measured in nanoseconds ext4:
  • 19. Input and Output Device drivers appear as normal files. • Users open an access channel to a device in the same way they open any other file. • Devices are protected by the same permission system as files. Linux recognizes three classes of devices: • Block devices: allow random access to independent, fixed-size blocks of data (e.g. disks, CD-ROMs, flash memory) • Character devices: sequential access, data not necessarily in blocks • Network devices: users communicate with network devices through the kernel’s network subsystem
  • 20. Interprocess Communication Linux informs processes that an event has occurred via signals. • There is a limited number of signals, and they cannot carry information. • Communication within the kernel is accomplished via scheduling states and wait queue structures. Mechanisms for passing data between processes: • The pipe mechanism allows a child process to inherit a communication channel to its parent, data written to one end of the pipe can be read a the other. • Shared memory: any data written by one process to a shared memory region can be read immediately by any other process that has mapped that region into its address space.
  • 21. Network Management Networking is a key area of functionality for Linux. • It supports the standard Internet protocols for UNIX-to-UNIX communications. • It also implements protocols native to non- UNIX operating systems, e.g., Appletalk and IPX. Networking in the Linux kernel is implemented by three software layers: • Socket interface: works with network addresses for a variety of network protocols • Protocol drivers: implements creation and reassembly of packets, routing between hosts, etc. • Network device drivers: interface with specific devices
  • 22. Security Authentication: no one can access system without entry rights • Uses a password file to store encrypted passwords. • Pluggable authentication modules (PAM): allows on-demand loading of authentication modules that improve security Access control: no one can access objects within the system without access rights • Files, devices, and other objects share the same access-control system. • Implemented through numeric identifiers for users (UID) and groups (GID) • Objects have a protection mask that specifies which access modes (read, write, or execute) are granted to owner, group, and world.
  • 23. Linux Source Tree Layout /usr/src/linuxDocumentation arch fs init kernel include ipc drivers net mmlib scripts alpha arm i386 ia64 m68k mips mips64 ppc s390 sh sparc sparc64 acorn atm block cdrom char dio fc4 i2c i2o ide ieee1394 isdn macintosh misc net … adfs affs autofs autofs4 bfs code cramfs devfs devpts efs ext2 fat hfs hpfs … asm-alpha asm-arm asm-generic asm-i386 asm-ia64 asm-m68k asm-mips asm-mips64 linux math-emu net pcmcia scsi video … adfs affs autofs autofs4 bfs code cramfs devfs devpts efs ext2 fat hfs hpfs … 802 appletalk atm ax25 bridge core decnet econet ethernet ipv4 ipv6 ipx irda khttpd lapb …
  • 25. Linux kernel development cycle  Version 0.01 (May 1991) had no networking, ran only on 80386-compatible Intel processors and on PC hardware, had extremely limited device-drive support, and supported only the Minix file system.  Linux 1.0 (March 1994) included these new features: ◦ Support for UNIX’s standard TCP/IP networking protocols ◦ BSD-compatible socket interface for networking programming ◦ Device-driver support for running IP over an Ethernet ◦ Enhanced file system ◦ Support for a range of SCSI controllers for high-performance disk access ◦ Extra hardware support  Version 1.2 (March 1995) was the final PC-only Linux kernel.
  • 26. Linux 2.0  Released in June 1996, 2.0 added two major new capabilities: ◦ Support for multiple architectures, including a fully 64-bit native Alpha port. ◦ Support for multiprocessor architectures  Other new features included: ◦ Improved memory-management code ◦ Improved TCP/IP performance ◦ Support for internal kernel threads, for handling dependencies between loadable modules, and for automatic loading of modules on demand. ◦ Standardized configuration interface
  • 28. THANK YOU Contact info – rohitkako@gmail.com www.facebook.com/rohitkako