SlideShare a Scribd company logo
© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Linux Kernel Overview
2© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
What to Expect?
W's of Kernel
Linux Architecture
Linux Kernel Startup
Linux Kernel Functionality
Linux Kernel Configuration
Linux Kernel Compilation
3© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
What is a Kernel?
Core of a System
The Operating System
4© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
OS Core
OS Core could be further classified as the
following major functionalities
Inter Process Communication
Minimal Memory Management
Low-level Process Management & Scheduling
Low-level Input / Output
5© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Types of Kernels
Micro kernel
Also called the Modular kernel
Contains only the OS Core
Other OS stuff are typically provided as services
Examples: Amoeba, Mach, QNX
Monolithic kernel
Contains all the OS related stuff
Either built into it statically or loaded dynamically
Examples: VxWorks, Linux
6© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Micro vs Monolithic Advantages
Micro Kernel
Flexible
Modular
Easy to implement
Monolithic Kernel
Performance
7© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Linux Architecture
User Space
(is the usage platform)
System Call I/F
(the connector)
Kernel Space
(provides functionalities & facilities to use)
Hardware
(is what is to be used)
8© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Linux Architecture Details
User Space
Memory where user processes run
Doing typical computation tasks
And accesses kernel space for privileged tasks
Through System Call interface
Kernel Space
This is protected space
Place of all privileged happening
I/O access, Memory access, … (System Resources access)
Kernel processes can access User processes but not vice versa
These levels are achieved by processor states
How does system call switches user to kernel space?
Check
Which space is executing command from root?
Do we need these levels and system calls if the kernel image and root file system are
read only?
9© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Process vs Thread
Single Process Single Threaded
Single Process Multi-Threaded
Multi-Process Single Threaded
Multi-Process Multi-Threaded
What is Linux User Space?
What about the Kernel Space?
Need for Single vs Multi
10© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Linux Kernel Startup
CPU / Platform specific Initialization
CPU Speed Setup
MMU Setup
Board Id Setup
Minimal Driver Initialization: FS specific
Mounting Root File System
Remaining Driver Initialization
Doing Initcall & Freeing Initial Memory
Moving to User Space by
Jumping to the first user process init
11© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Linux Kernel Functional Overview
Process Management
Memory Management
Device Management
Storage Management
Network Management
12© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Linux Kernel Source
Let's get down to the Source Code
13© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Linux Kernel Build System
Key components
Makefile
Kconfig
Configuring the Makefile
Setting up the kernel version (specially for the
Desktops)
For Cross Compilation, need to setup
ARCH
CROSS_COMPILE
Or, invoke make with these options
14© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Linux Kernel Configuration Methods
make config
make menuconfig
make xconfig
Others
make defconfig
make oldconfig
make <board_specific>_defconfig
Check: Where is the menuconfig target?
15© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Linux Kernel Configuration
Code Maturity level Options
General Setup
Loadable Module Support
Block Layer
Networking
Device Drivers
File Systems
Kernel Hacking
Security Options
Cryptographic Options
Library Routines
16© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Linux Kernel Compilation
Cleaning Methods
make clean – Simple clean
make mrproper – Complete sweep clean, incl. Configs
Also called Building the Kernel
After configuring the kernel, we are all set to build it
Build Methods
make vmlinux – To build everything configured for a kernel image
make modules – To build only configured modules
make – To build everything configured (kernel image & modules)
make modules_prepare – To only prepare for building modules
17© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Linux Kernel Images
Kernel Image should be understood by Stage 2 Bootloader
Default kernel compilation builds vmlinux
vmlinux is understood only by the desktop bootloaders
So, for embedded systems, we would typically have to do
the following
Creating linux.bin using <cross>-objcopy
Example: arm-linux-objcopy -O binary vmlinux linux.bin
And then, convert it into the bootloader specific image using
some bootloader utility. For u-boot, it is done using mkimage
Example: mkimage -A arm -O linux -T kernel -C none -a 20008000 -e
20008000 -n “Custom” -d linux.bin uImage.arm
18© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Linux Kernel Arguments
console
root
initrd
mem
resume
...
19© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
What all have we learnt?
W's of Kernel
Linux Architecture
Linux Kernel Startup
Linux Kernel Functionality
Linux Kernel Configuration
Linux Kernel Compilation
20© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Any Queries?

More Related Content

What's hot

Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
Emertxe Information Technologies Pvt Ltd
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
Shay Cohen
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
guest547d74
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
RuggedBoardGroup
 
Root file system for embedded systems
Root file system for embedded systemsRoot file system for embedded systems
Root file system for embedded systems
alok pal
 
linux device driver
linux device driverlinux device driver
linux device driver
Rahul Batra
 
Pthread
PthreadPthread
Pthread
Gopi Saiteja
 
Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and Properties
Saadi Rahman
 
Linux Programming
Linux ProgrammingLinux Programming
Toolchain
ToolchainToolchain
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
Adrian Huang
 
Linux kernel architecture
Linux kernel architectureLinux kernel architecture
Linux kernel architecture
SHAJANA BASHEER
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
National Cheng Kung University
 
Memory management in linux
Memory management in linuxMemory management in linux
Memory management in linux
Dr. C.V. Suresh Babu
 
Linux device drivers
Linux device drivers Linux device drivers
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
mukul bhardwaj
 
SFO15-TR9: PSCI, ACPI (and UEFI to boot)
SFO15-TR9: PSCI, ACPI (and UEFI to boot)SFO15-TR9: PSCI, ACPI (and UEFI to boot)
SFO15-TR9: PSCI, ACPI (and UEFI to boot)
Linaro
 
Process scheduling linux
Process scheduling linuxProcess scheduling linux
Process scheduling linux
Dr. C.V. Suresh Babu
 
QEMU - Binary Translation
QEMU - Binary Translation QEMU - Binary Translation
QEMU - Binary Translation
Jiann-Fuh Liaw
 
Debugging linux kernel tools and techniques
Debugging linux kernel tools and  techniquesDebugging linux kernel tools and  techniques
Debugging linux kernel tools and techniques
Satpal Parmar
 

What's hot (20)

Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
 
Root file system for embedded systems
Root file system for embedded systemsRoot file system for embedded systems
Root file system for embedded systems
 
linux device driver
linux device driverlinux device driver
linux device driver
 
Pthread
PthreadPthread
Pthread
 
Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and Properties
 
Linux Programming
Linux ProgrammingLinux Programming
Linux Programming
 
Toolchain
ToolchainToolchain
Toolchain
 
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
 
Linux kernel architecture
Linux kernel architectureLinux kernel architecture
Linux kernel architecture
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
Memory management in linux
Memory management in linuxMemory management in linux
Memory management in linux
 
Linux device drivers
Linux device drivers Linux device drivers
Linux device drivers
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
SFO15-TR9: PSCI, ACPI (and UEFI to boot)
SFO15-TR9: PSCI, ACPI (and UEFI to boot)SFO15-TR9: PSCI, ACPI (and UEFI to boot)
SFO15-TR9: PSCI, ACPI (and UEFI to boot)
 
Process scheduling linux
Process scheduling linuxProcess scheduling linux
Process scheduling linux
 
QEMU - Binary Translation
QEMU - Binary Translation QEMU - Binary Translation
QEMU - Binary Translation
 
Debugging linux kernel tools and techniques
Debugging linux kernel tools and  techniquesDebugging linux kernel tools and  techniques
Debugging linux kernel tools and techniques
 

Viewers also liked

BeagleBoard-xM Bootloaders
BeagleBoard-xM BootloadersBeagleBoard-xM Bootloaders
BeagleBoard-xM Bootloaders
SysPlay eLearning Academy for You
 
Linux Porting
Linux PortingLinux Porting
Linux Porting
Anil Kumar Pugalia
 
File Systems
File SystemsFile Systems
File Systems
Anil Kumar Pugalia
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
SysPlay eLearning Academy for You
 
I2C Drivers
I2C DriversI2C Drivers
File System Modules
File System ModulesFile System Modules
File System Modules
Anil Kumar Pugalia
 
Platform Drivers
Platform DriversPlatform Drivers
Serial Drivers
Serial DriversSerial Drivers
SPI Drivers
SPI DriversSPI Drivers
Block Drivers
Block DriversBlock Drivers
Block Drivers
Anil Kumar Pugalia
 
USB Drivers
USB DriversUSB Drivers
USB Drivers
Anil Kumar Pugalia
 
References
ReferencesReferences
References
Anil Kumar Pugalia
 
Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
Anil Kumar Pugalia
 
Interrupts
InterruptsInterrupts
Interrupts
Anil Kumar Pugalia
 
Introduction to Linux Drivers
Introduction to Linux DriversIntroduction to Linux Drivers
Introduction to Linux Drivers
Anil Kumar Pugalia
 
Character Drivers
Character DriversCharacter Drivers
Character Drivers
Anil Kumar Pugalia
 
BeagleBone Black Booting Process
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting Process
SysPlay eLearning Academy for You
 
Arduino Robotics workshop Day1
Arduino Robotics workshop Day1Arduino Robotics workshop Day1
Arduino Robotics workshop Day1
Sudar Muthu
 
Arduino Robotics workshop day2
Arduino Robotics workshop day2Arduino Robotics workshop day2
Arduino Robotics workshop day2
Sudar Muthu
 
Introduction to BeagleBone Black
Introduction to BeagleBone BlackIntroduction to BeagleBone Black
Introduction to BeagleBone Black
SysPlay eLearning Academy for You
 

Viewers also liked (20)

BeagleBoard-xM Bootloaders
BeagleBoard-xM BootloadersBeagleBoard-xM Bootloaders
BeagleBoard-xM Bootloaders
 
Linux Porting
Linux PortingLinux Porting
Linux Porting
 
File Systems
File SystemsFile Systems
File Systems
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
 
I2C Drivers
I2C DriversI2C Drivers
I2C Drivers
 
File System Modules
File System ModulesFile System Modules
File System Modules
 
Platform Drivers
Platform DriversPlatform Drivers
Platform Drivers
 
Serial Drivers
Serial DriversSerial Drivers
Serial Drivers
 
SPI Drivers
SPI DriversSPI Drivers
SPI Drivers
 
Block Drivers
Block DriversBlock Drivers
Block Drivers
 
USB Drivers
USB DriversUSB Drivers
USB Drivers
 
References
ReferencesReferences
References
 
Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
 
Interrupts
InterruptsInterrupts
Interrupts
 
Introduction to Linux Drivers
Introduction to Linux DriversIntroduction to Linux Drivers
Introduction to Linux Drivers
 
Character Drivers
Character DriversCharacter Drivers
Character Drivers
 
BeagleBone Black Booting Process
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting Process
 
Arduino Robotics workshop Day1
Arduino Robotics workshop Day1Arduino Robotics workshop Day1
Arduino Robotics workshop Day1
 
Arduino Robotics workshop day2
Arduino Robotics workshop day2Arduino Robotics workshop day2
Arduino Robotics workshop day2
 
Introduction to BeagleBone Black
Introduction to BeagleBone BlackIntroduction to BeagleBone Black
Introduction to BeagleBone Black
 

Similar to Linux Kernel Overview

Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
Anil Kumar Pugalia
 
Slim Server Theory
Slim Server TheorySlim Server Theory
Slim Server Theory
Gaurav Paliwal
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
Anil Kumar Pugalia
 
Introduction To Linux Kernel Modules
Introduction To Linux Kernel ModulesIntroduction To Linux Kernel Modules
Introduction To Linux Kernel Modules
dibyajyotig
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
Anil Kumar Pugalia
 
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
Anil Kumar Pugalia
 
LSA2 - 02 Namespaces
LSA2 - 02  NamespacesLSA2 - 02  Namespaces
LSA2 - 02 Namespaces
Marian Marinov
 
Visão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
Visão geral do hardware do servidor System z e Linux on z - Concurso MainframeVisão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
Visão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
Anderson Bassani
 
Nim
NimNim
.ppt
.ppt.ppt
the NML project
the NML projectthe NML project
the NML project
Lei Yang
 
System Calls
System CallsSystem Calls
System Calls
Anil Kumar Pugalia
 
Unix nim-presentation
Unix nim-presentationUnix nim-presentation
Unix nim-presentation
Rajeev Ghosh
 
Linux scheduler
Linux schedulerLinux scheduler
Linux scheduler
Liran Ben Haim
 
Operating system Definition Structures
Operating  system Definition  StructuresOperating  system Definition  Structures
Operating system Definition Structures
anair23
 
docslide-3df5a529-2ffd-ef23.ppt
docslide-3df5a529-2ffd-ef23.pptdocslide-3df5a529-2ffd-ef23.ppt
docslide-3df5a529-2ffd-ef23.ppt
PrasannaDeSilva7
 
Practical Introduction To Linux
Practical Introduction To LinuxPractical Introduction To Linux
Practical Introduction To Linux
Zeeshan Rizvi
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Tushar B Kute
 
Interview Questions
Interview QuestionsInterview Questions
Interview Questions
rajusandeep12
 
Walking around linux kernel
Walking around linux kernelWalking around linux kernel
Walking around linux kernel
Dharshana Kasun Warusavitharana
 

Similar to Linux Kernel Overview (20)

Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
Slim Server Theory
Slim Server TheorySlim Server Theory
Slim Server Theory
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
Introduction To Linux Kernel Modules
Introduction To Linux Kernel ModulesIntroduction To Linux Kernel Modules
Introduction To Linux Kernel Modules
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
 
LSA2 - 02 Namespaces
LSA2 - 02  NamespacesLSA2 - 02  Namespaces
LSA2 - 02 Namespaces
 
Visão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
Visão geral do hardware do servidor System z e Linux on z - Concurso MainframeVisão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
Visão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
 
Nim
NimNim
Nim
 
.ppt
.ppt.ppt
.ppt
 
the NML project
the NML projectthe NML project
the NML project
 
System Calls
System CallsSystem Calls
System Calls
 
Unix nim-presentation
Unix nim-presentationUnix nim-presentation
Unix nim-presentation
 
Linux scheduler
Linux schedulerLinux scheduler
Linux scheduler
 
Operating system Definition Structures
Operating  system Definition  StructuresOperating  system Definition  Structures
Operating system Definition Structures
 
docslide-3df5a529-2ffd-ef23.ppt
docslide-3df5a529-2ffd-ef23.pptdocslide-3df5a529-2ffd-ef23.ppt
docslide-3df5a529-2ffd-ef23.ppt
 
Practical Introduction To Linux
Practical Introduction To LinuxPractical Introduction To Linux
Practical Introduction To Linux
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
 
Interview Questions
Interview QuestionsInterview Questions
Interview Questions
 
Walking around linux kernel
Walking around linux kernelWalking around linux kernel
Walking around linux kernel
 

More from Anil Kumar Pugalia

File System Modules
File System ModulesFile System Modules
File System Modules
Anil Kumar Pugalia
 
Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
Anil Kumar Pugalia
 
Processes
ProcessesProcesses
System Calls
System CallsSystem Calls
System Calls
Anil Kumar Pugalia
 
Embedded C
Embedded CEmbedded C
Embedded C
Anil Kumar Pugalia
 
Embedded Software Design
Embedded Software DesignEmbedded Software Design
Embedded Software Design
Anil Kumar Pugalia
 
Playing with R L C Circuits
Playing with R L C CircuitsPlaying with R L C Circuits
Playing with R L C Circuits
Anil Kumar Pugalia
 
Audio Drivers
Audio DriversAudio Drivers
Audio Drivers
Anil Kumar Pugalia
 
Video Drivers
Video DriversVideo Drivers
Video Drivers
Anil Kumar Pugalia
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
Anil Kumar Pugalia
 
Functional Programming with LISP
Functional Programming with LISPFunctional Programming with LISP
Functional Programming with LISP
Anil Kumar Pugalia
 
Power of vi
Power of viPower of vi
Power of vi
Anil Kumar Pugalia
 
gcc and friends
gcc and friendsgcc and friends
gcc and friends
Anil Kumar Pugalia
 
"make" system
"make" system"make" system
"make" system
Anil Kumar Pugalia
 
Hardware Design for Software Hackers
Hardware Design for Software HackersHardware Design for Software Hackers
Hardware Design for Software Hackers
Anil Kumar Pugalia
 
RPM Building
RPM BuildingRPM Building
RPM Building
Anil Kumar Pugalia
 
Linux User Space Debugging & Profiling
Linux User Space Debugging & ProfilingLinux User Space Debugging & Profiling
Linux User Space Debugging & Profiling
Anil Kumar Pugalia
 
Linux Network Management
Linux Network ManagementLinux Network Management
Linux Network Management
Anil Kumar Pugalia
 
Timers
TimersTimers
Threads
ThreadsThreads

More from Anil Kumar Pugalia (20)

File System Modules
File System ModulesFile System Modules
File System Modules
 
Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
 
Processes
ProcessesProcesses
Processes
 
System Calls
System CallsSystem Calls
System Calls
 
Embedded C
Embedded CEmbedded C
Embedded C
 
Embedded Software Design
Embedded Software DesignEmbedded Software Design
Embedded Software Design
 
Playing with R L C Circuits
Playing with R L C CircuitsPlaying with R L C Circuits
Playing with R L C Circuits
 
Audio Drivers
Audio DriversAudio Drivers
Audio Drivers
 
Video Drivers
Video DriversVideo Drivers
Video Drivers
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
 
Functional Programming with LISP
Functional Programming with LISPFunctional Programming with LISP
Functional Programming with LISP
 
Power of vi
Power of viPower of vi
Power of vi
 
gcc and friends
gcc and friendsgcc and friends
gcc and friends
 
"make" system
"make" system"make" system
"make" system
 
Hardware Design for Software Hackers
Hardware Design for Software HackersHardware Design for Software Hackers
Hardware Design for Software Hackers
 
RPM Building
RPM BuildingRPM Building
RPM Building
 
Linux User Space Debugging & Profiling
Linux User Space Debugging & ProfilingLinux User Space Debugging & Profiling
Linux User Space Debugging & Profiling
 
Linux Network Management
Linux Network ManagementLinux Network Management
Linux Network Management
 
Timers
TimersTimers
Timers
 
Threads
ThreadsThreads
Threads
 

Recently uploaded

HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
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
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
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
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
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
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
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
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
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
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 

Recently uploaded (20)

HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
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
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
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
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
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
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
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
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
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
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 

Linux Kernel Overview

  • 1. © 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Overview
  • 2. 2© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. What to Expect? W's of Kernel Linux Architecture Linux Kernel Startup Linux Kernel Functionality Linux Kernel Configuration Linux Kernel Compilation
  • 3. 3© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. What is a Kernel? Core of a System The Operating System
  • 4. 4© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. OS Core OS Core could be further classified as the following major functionalities Inter Process Communication Minimal Memory Management Low-level Process Management & Scheduling Low-level Input / Output
  • 5. 5© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Types of Kernels Micro kernel Also called the Modular kernel Contains only the OS Core Other OS stuff are typically provided as services Examples: Amoeba, Mach, QNX Monolithic kernel Contains all the OS related stuff Either built into it statically or loaded dynamically Examples: VxWorks, Linux
  • 6. 6© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Micro vs Monolithic Advantages Micro Kernel Flexible Modular Easy to implement Monolithic Kernel Performance
  • 7. 7© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Architecture User Space (is the usage platform) System Call I/F (the connector) Kernel Space (provides functionalities & facilities to use) Hardware (is what is to be used)
  • 8. 8© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Architecture Details User Space Memory where user processes run Doing typical computation tasks And accesses kernel space for privileged tasks Through System Call interface Kernel Space This is protected space Place of all privileged happening I/O access, Memory access, … (System Resources access) Kernel processes can access User processes but not vice versa These levels are achieved by processor states How does system call switches user to kernel space? Check Which space is executing command from root? Do we need these levels and system calls if the kernel image and root file system are read only?
  • 9. 9© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Process vs Thread Single Process Single Threaded Single Process Multi-Threaded Multi-Process Single Threaded Multi-Process Multi-Threaded What is Linux User Space? What about the Kernel Space? Need for Single vs Multi
  • 10. 10© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Startup CPU / Platform specific Initialization CPU Speed Setup MMU Setup Board Id Setup Minimal Driver Initialization: FS specific Mounting Root File System Remaining Driver Initialization Doing Initcall & Freeing Initial Memory Moving to User Space by Jumping to the first user process init
  • 11. 11© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Functional Overview Process Management Memory Management Device Management Storage Management Network Management
  • 12. 12© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Source Let's get down to the Source Code
  • 13. 13© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Build System Key components Makefile Kconfig Configuring the Makefile Setting up the kernel version (specially for the Desktops) For Cross Compilation, need to setup ARCH CROSS_COMPILE Or, invoke make with these options
  • 14. 14© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Configuration Methods make config make menuconfig make xconfig Others make defconfig make oldconfig make <board_specific>_defconfig Check: Where is the menuconfig target?
  • 15. 15© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Configuration Code Maturity level Options General Setup Loadable Module Support Block Layer Networking Device Drivers File Systems Kernel Hacking Security Options Cryptographic Options Library Routines
  • 16. 16© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Compilation Cleaning Methods make clean – Simple clean make mrproper – Complete sweep clean, incl. Configs Also called Building the Kernel After configuring the kernel, we are all set to build it Build Methods make vmlinux – To build everything configured for a kernel image make modules – To build only configured modules make – To build everything configured (kernel image & modules) make modules_prepare – To only prepare for building modules
  • 17. 17© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Images Kernel Image should be understood by Stage 2 Bootloader Default kernel compilation builds vmlinux vmlinux is understood only by the desktop bootloaders So, for embedded systems, we would typically have to do the following Creating linux.bin using <cross>-objcopy Example: arm-linux-objcopy -O binary vmlinux linux.bin And then, convert it into the bootloader specific image using some bootloader utility. For u-boot, it is done using mkimage Example: mkimage -A arm -O linux -T kernel -C none -a 20008000 -e 20008000 -n “Custom” -d linux.bin uImage.arm
  • 18. 18© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Arguments console root initrd mem resume ...
  • 19. 19© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. What all have we learnt? W's of Kernel Linux Architecture Linux Kernel Startup Linux Kernel Functionality Linux Kernel Configuration Linux Kernel Compilation
  • 20. 20© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Any Queries?