SlideShare una empresa de Scribd logo
1 de 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?

Más contenido relacionado

La actualidad más candente

Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequenceHoucheng Lin
 
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
 
Bootloaders (U-Boot)
Bootloaders (U-Boot) Bootloaders (U-Boot)
Bootloaders (U-Boot) Omkar Rane
 
Building Embedded Linux Systems Introduction
Building Embedded Linux Systems IntroductionBuilding Embedded Linux Systems Introduction
Building Embedded Linux Systems IntroductionSherif Mousa
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_BootingRashila Rr
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New HardwareRuggedBoardGroup
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)RuggedBoardGroup
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/CoreShay Cohen
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013Wave Digitech
 
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardKernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardAnne Nicolas
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal BootloaderSatpal Parmar
 

La actualidad más candente (20)

Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 
Linux device drivers
Linux device drivers Linux device drivers
Linux device drivers
 
Bootloaders (U-Boot)
Bootloaders (U-Boot) Bootloaders (U-Boot)
Bootloaders (U-Boot)
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
 
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
 
Building Embedded Linux Systems Introduction
Building Embedded Linux Systems IntroductionBuilding Embedded Linux Systems Introduction
Building Embedded Linux Systems Introduction
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_Booting
 
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
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardKernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal Bootloader
 
Platform Drivers
Platform DriversPlatform Drivers
Platform Drivers
 

Destacado (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
 
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
 
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
 

Similar a Linux Kernel Overview and Configuration

Introduction To Linux Kernel Modules
Introduction To Linux Kernel ModulesIntroduction To Linux Kernel Modules
Introduction To Linux Kernel Modulesdibyajyotig
 
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversAnil Kumar Pugalia
 
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 MainframeAnderson Bassani
 
the NML project
the NML projectthe NML project
the NML projectLei Yang
 
Unix nim-presentation
Unix nim-presentationUnix nim-presentation
Unix nim-presentationRajeev Ghosh
 
Operating system Definition Structures
Operating  system Definition  StructuresOperating  system Definition  Structures
Operating system Definition Structuresanair23
 
docslide-3df5a529-2ffd-ef23.ppt
docslide-3df5a529-2ffd-ef23.pptdocslide-3df5a529-2ffd-ef23.ppt
docslide-3df5a529-2ffd-ef23.pptPrasannaDeSilva7
 
Practical Introduction To Linux
Practical Introduction To LinuxPractical Introduction To Linux
Practical Introduction To LinuxZeeshan 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 KuteTushar B Kute
 

Similar a Linux Kernel Overview and Configuration (20)

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
 
Ite pc v40_chapter5
Ite pc v40_chapter5Ite pc v40_chapter5
Ite pc v40_chapter5
 

Más de 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
 

Último

Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Último (20)

Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

Linux Kernel Overview and Configuration

  • 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?