SlideShare ist ein Scribd-Unternehmen logo
1 von 20
© 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?

Weitere ähnliche Inhalte

Was ist angesagt?

Embedded Operating System - Linux
Embedded Operating System - LinuxEmbedded Operating System - Linux
Embedded Operating System - Linux
Emertxe Information Technologies Pvt Ltd
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
Houcheng Lin
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
Macpaul Lin
 
Embedded Linux from Scratch to Yocto
Embedded Linux from Scratch to YoctoEmbedded Linux from Scratch to Yocto
Embedded Linux from Scratch to Yocto
Sherif Mousa
 

Was ist angesagt? (20)

Embedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernelEmbedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernel
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
 
Embedded linux network device driver development
Embedded linux network device driver developmentEmbedded linux network device driver development
Embedded linux network device driver development
 
Embedded Operating System - Linux
Embedded Operating System - LinuxEmbedded Operating System - Linux
Embedded Operating System - Linux
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Block Drivers
Block DriversBlock Drivers
Block Drivers
 
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
 
Linux-Internals-and-Networking
Linux-Internals-and-NetworkingLinux-Internals-and-Networking
Linux-Internals-and-Networking
 
Linux Porting
Linux PortingLinux Porting
Linux Porting
 
linux device driver
linux device driverlinux device driver
linux device driver
 
Yocto Project introduction
Yocto Project introductionYocto Project introduction
Yocto Project introduction
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
 
I2C Drivers
I2C DriversI2C Drivers
I2C Drivers
 
Browsing Linux Kernel Source
Browsing Linux Kernel SourceBrowsing Linux Kernel Source
Browsing Linux Kernel Source
 
Linux file system
Linux file systemLinux file system
Linux file system
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
Process Scheduler and Balancer in Linux Kernel
Process Scheduler and Balancer in Linux KernelProcess Scheduler and Balancer in Linux Kernel
Process Scheduler and Balancer in Linux Kernel
 
Embedded Linux from Scratch to Yocto
Embedded Linux from Scratch to YoctoEmbedded Linux from Scratch to Yocto
Embedded Linux from Scratch to Yocto
 

Andere mochten auch

Andere mochten auch (20)

BeagleBoard-xM Bootloaders
BeagleBoard-xM BootloadersBeagleBoard-xM Bootloaders
BeagleBoard-xM Bootloaders
 
File Systems
File SystemsFile Systems
File Systems
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
 
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
 
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
 
Toolchain
ToolchainToolchain
Toolchain
 
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
 
Embedded Applications
Embedded ApplicationsEmbedded Applications
Embedded Applications
 
Introduction to BeagleBoard-xM
Introduction to BeagleBoard-xMIntroduction to BeagleBoard-xM
Introduction to BeagleBoard-xM
 

Ähnlich wie Linux Kernel Overview

Mobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
Anil Kumar Pugalia
 
the NML project
the NML projectthe NML project
the NML project
Lei Yang
 

Ähnlich wie 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
 

Mehr von Anil Kumar Pugalia

Functional Programming with LISP
Functional Programming with LISPFunctional Programming with LISP
Functional Programming with LISP
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
 

Mehr von 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
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

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?