SlideShare a Scribd company logo
5
Most read
8
Most read
12
Most read
© 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

ODP
Linux Internals - Kernel/Core
PPT
U boot porting guide for SoC
PDF
Uboot startup sequence
PPTX
Linux kernel debugging
PDF
Part 02 Linux Kernel Module Programming
PPTX
Linux Kernel Booting Process (1) - For NLKB
ODP
Linux commands
PDF
Introduction to Linux Drivers
Linux Internals - Kernel/Core
U boot porting guide for SoC
Uboot startup sequence
Linux kernel debugging
Part 02 Linux Kernel Module Programming
Linux Kernel Booting Process (1) - For NLKB
Linux commands
Introduction to Linux Drivers

What's hot (20)

PPTX
Linux standard file system
PDF
An Introduction To Linux
PPTX
Linux Initialization Process (2)
PPTX
Linux Boot Process
PPTX
Linux Device Tree
PPTX
Linux device drivers
PDF
Linux kernel architecture
PDF
PDF
Block Drivers
PDF
PDF
Linux scheduler
PDF
Linux systems - Linux Commands and Shell Scripting
PPT
Linux file system
PPT
Linux command ppt
PPT
Kernel module programming
PDF
BeagleBone Black Bootloaders
PDF
BusyBox for Embedded Linux
PPTX
Linux Initialization Process (1)
PDF
U-Boot - An universal bootloader
Linux standard file system
An Introduction To Linux
Linux Initialization Process (2)
Linux Boot Process
Linux Device Tree
Linux device drivers
Linux kernel architecture
Block Drivers
Linux scheduler
Linux systems - Linux Commands and Shell Scripting
Linux file system
Linux command ppt
Kernel module programming
BeagleBone Black Bootloaders
BusyBox for Embedded Linux
Linux Initialization Process (1)
U-Boot - An universal bootloader
Ad

Viewers also liked (20)

PDF
BeagleBoard-xM Bootloaders
PDF
Linux Porting
PDF
File Systems
PDF
File System Modules
PDF
USB Drivers
PDF
References
PDF
Kernel Debugging & Profiling
PDF
Interrupts
PDF
Character Drivers
PDF
BeagleBone Black Booting Process
PDF
PPTX
Arduino Robotics workshop Day1
PPTX
Arduino Robotics workshop day2
PDF
Introduction to BeagleBone Black
PDF
Embedded Applications
PDF
Introduction to BeagleBoard-xM
BeagleBoard-xM Bootloaders
Linux Porting
File Systems
File System Modules
USB Drivers
References
Kernel Debugging & Profiling
Interrupts
Character Drivers
BeagleBone Black Booting Process
Arduino Robotics workshop Day1
Arduino Robotics workshop day2
Introduction to BeagleBone Black
Embedded Applications
Introduction to BeagleBoard-xM
Ad

Similar to Linux Kernel Overview (20)

PDF
Introduction to Linux
PPT
Slim Server Theory
PDF
Introduction to Linux
PDF
Introduction To Linux Kernel Modules
PDF
Linux Memory Management
PPTX
Lecture02_LinuxBasedEmbeddedSystemComponentStack.pptx
PPTX
Lecture02_LinuxBasedEmbeddedSystemComponentStack.pptx
PPTX
Lecture02_LinuxBasedEmbeddedSystemComponentStack.pptx
PDF
Mobile Hacking using Linux Drivers
ODP
LSA2 - 02 Namespaces
PPT
Visão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
PPTX
managing kernal module from egineering sunject operating system
PPT
KEY
the NML project
PDF
System Calls
PPT
Unix nim-presentation
PDF
Operating system Definition Structures
PPTX
Second Slide about Operating System services
PPT
docslide-3df5a529-2ffd-ef23.ppt
Introduction to Linux
Slim Server Theory
Introduction to Linux
Introduction To Linux Kernel Modules
Linux Memory Management
Lecture02_LinuxBasedEmbeddedSystemComponentStack.pptx
Lecture02_LinuxBasedEmbeddedSystemComponentStack.pptx
Lecture02_LinuxBasedEmbeddedSystemComponentStack.pptx
Mobile Hacking using Linux Drivers
LSA2 - 02 Namespaces
Visão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
managing kernal module from egineering sunject operating system
the NML project
System Calls
Unix nim-presentation
Operating system Definition Structures
Second Slide about Operating System services
docslide-3df5a529-2ffd-ef23.ppt

More from Anil Kumar Pugalia (20)

PDF
File System Modules
PDF
Kernel Debugging & Profiling
PDF
PDF
System Calls
PDF
Embedded C
PDF
Embedded Software Design
PDF
Playing with R L C Circuits
PDF
Audio Drivers
PDF
Video Drivers
PDF
Shell Scripting
PDF
Functional Programming with LISP
PDF
Power of vi
PDF
gcc and friends
PDF
"make" system
PDF
Hardware Design for Software Hackers
PDF
RPM Building
PDF
Linux User Space Debugging & Profiling
PDF
Linux Network Management
PDF
File System Modules
Kernel Debugging & Profiling
System Calls
Embedded C
Embedded Software Design
Playing with R L C Circuits
Audio Drivers
Video Drivers
Shell Scripting
Functional Programming with LISP
Power of vi
gcc and friends
"make" system
Hardware Design for Software Hackers
RPM Building
Linux User Space Debugging & Profiling
Linux Network Management

Recently uploaded (20)

PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
KodekX | Application Modernization Development
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Empathic Computing: Creating Shared Understanding
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Unlocking AI with Model Context Protocol (MCP)
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
A Presentation on Artificial Intelligence
KodekX | Application Modernization Development
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
NewMind AI Monthly Chronicles - July 2025
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Empathic Computing: Creating Shared Understanding
Diabetes mellitus diagnosis method based random forest with bat algorithm
“AI and Expert System Decision Support & Business Intelligence Systems”
Building Integrated photovoltaic BIPV_UPV.pdf
Electronic commerce courselecture one. Pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Spectral efficient network and resource selection model in 5G networks
Understanding_Digital_Forensics_Presentation.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Review of recent advances in non-invasive hemoglobin estimation

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?