SlideShare a Scribd company logo
1 of 17
Download to read offline
Architecture of the Linux Kernel


                 by Dominique Gerald M Cimafranca
                       dominique.cimafranca@gmail.com




This work is licensed under the Creative Commons Attribution-Share Alike 3.0 Philippines License. To view a copy of this
license, visit http://creativecommons.org/licenses/by-sa/3.0/ph/ or send a letter to Creative Commons, 171 Second Street,
Suite 300, San Francisco, California, 94105, USA.
Fundamental Architecture

             User Applications
                                          User Space

                GNU C Library (glibc)



           System Call Interface



                  Kernel

                                          Kernel Space

     Architecture Dependent Kernel Code



             Hardware Platform
User Space Components
●   User applications
●   glibc
    ●   Provides the system call interface that connects to
        the kernel
    ●   Provides the mechanism to transition between user-
        space application and kernel
●   Each user space process occupies its own
    virtual address space (vs the kernel which runs
    on the single address space)
Kernel Space Components
●   System Call Interface
    ●   Provides the basic functions such as read() and
        write()
●   Kernel
    ●   Architecture-independent kernel code
    ●   Common to all processor architectures supported by
        Linux
●   Architecture-Dependent Code
    ●   Processor- and platform-specific code
    ●   Also known as Board Support Package
Kernel Subsystems

               System Call Interface




Process Management                Virtual File System




Memory Management                      Network Stack




   Arch                         Device Drivers
System Call Interface
●   Provides the means to perform function calls
    from user space into the kernel.
●   This interface can be architecture dependent,
    even within the same processor family.
●   Can be found in
    ●   ./linux/kernel
    ●   ./linux/arch
Process Management
●   Focused on the execution of processes
●   Each has an individual virtualization of the
    processor (thread code, data, stack, and
    registers)
●   Kernel provides API through SCI to start, stop,
    and communicate with processes
●   Processes are managed by a scheduler
Scheduler
●   Kernel implements a scheduling algorithm
    ●   Operates in constant time, regardless of threads
    ●   O(1), meaning, same time to schedule one thread
        or many threads
●   Can be found in
    ●   ./linux/kernel
    ●   ./linux/arch
Memory Management
●   Memory is managed in pages
    ●   Typically 4KB per page for most architectures
    ●   Can be adjusted
●   Support for hardware mechanisms for physical
    and virtual mappings, e.g. MMU on Pentium
●   Keeps tracks of which pages are full, partially
    used, or empty
●   Or if physical memory runs out, swap to disk
●   Can be found in ./linux/mm
Virtual File System
        Virtual File System



ext3       ...         FAT32   /proc



       Buffer Cache




          Device Drivers



         Physical Devices
Virtual File System
●   Presents a common API abstraction of
    functions such as open, close, read, and write
●   Translates to abstractions specific to a file
    system
●   Support for over 50 different file systems
●   Can be found in ./linux/fs
Buffer Cache
●   Caching layer that optimizes access to the
    physical devices by keeping data around for a
    short time
●   Provides a common set of functions to the file
    system layer (independent of any particular file
    system)
Network Stack
●   Follows a layered architecture modeled after
    the TCP/IP protocols
●   TCP layer communicates with SCI via sockets
●   Sockets provide a standard API to the
    networking subsystem
    ●   Manage connections
    ●   Move data between endpoints
●   Can be found in ./linux/net
Device Drivers and Architecture-
           Dependent Code
●   Most of the Linux kernel source code consists
    of device drivers
    ●   Can be found in ./linux/drivers
●   While Linux kernel is mostly architecture
    ●   Can be found in ./linux/arch
Questions?
References
●   Anatomy of the Linux Kernel, M. Tim Jones, IBM Developerworks
    (http://www.ibm.com/developerworks/linux/library/l-linux-kernel/)
Architecture of the Linux Kernel


                 by Dominique Gerald M Cimafranca
                       dominique.cimafranca@gmail.com




This work is licensed under the Creative Commons Attribution-Share Alike 3.0 Philippines License. To view a copy of this
license, visit http://creativecommons.org/licenses/by-sa/3.0/ph/ or send a letter to Creative Commons, 171 Second Street,
Suite 300, San Francisco, California, 94105, USA.

More Related Content

What's hot (20)

Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
 
Linux Kernel Image
Linux Kernel ImageLinux Kernel Image
Linux Kernel Image
 
Linux Internals - Interview essentials - 1.0
Linux Internals - Interview essentials - 1.0Linux Internals - Interview essentials - 1.0
Linux Internals - Interview essentials - 1.0
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Tour
 
Virtualization Support in ARMv8+
Virtualization Support in ARMv8+Virtualization Support in ARMv8+
Virtualization Support in ARMv8+
 
Linux introduction
Linux introductionLinux introduction
Linux introduction
 
Introduction to Modern U-Boot
Introduction to Modern U-BootIntroduction to Modern U-Boot
Introduction to Modern U-Boot
 
Review of QNX
Review of QNXReview of QNX
Review of QNX
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Linux
LinuxLinux
Linux
 
Memory management in linux
Memory management in linuxMemory management in linux
Memory management in linux
 
Grub2 Booting Process
Grub2 Booting ProcessGrub2 Booting Process
Grub2 Booting Process
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Ipc in linux
Ipc in linuxIpc in linux
Ipc in linux
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
 
Linux device drivers
Linux device drivers Linux device drivers
Linux device drivers
 
Introduction to Linux basic
Introduction to Linux basicIntroduction to Linux basic
Introduction to Linux basic
 

Similar to Architecture Of The Linux Kernel

Similar to Architecture Of The Linux Kernel (20)

Linux@assignment ppt
Linux@assignment pptLinux@assignment ppt
Linux@assignment ppt
 
Walking around linux kernel
Walking around linux kernelWalking around linux kernel
Walking around linux kernel
 
Linux-Internals-and-Networking
Linux-Internals-and-NetworkingLinux-Internals-and-Networking
Linux-Internals-and-Networking
 
Ubuntu OS Presentation
Ubuntu OS PresentationUbuntu OS Presentation
Ubuntu OS Presentation
 
Visual comparison of Unix-like systems & Virtualisation
Visual comparison of Unix-like systems & VirtualisationVisual comparison of Unix-like systems & Virtualisation
Visual comparison of Unix-like systems & Virtualisation
 
Libra Library OS
Libra Library OSLibra Library OS
Libra Library OS
 
linux kernel overview 2013
linux kernel overview 2013linux kernel overview 2013
linux kernel overview 2013
 
introduction.pdf
introduction.pdfintroduction.pdf
introduction.pdf
 
Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)
 
Linux for embedded_systems
Linux for embedded_systemsLinux for embedded_systems
Linux for embedded_systems
 
淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道 淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道
 
Realizing Linux Containers (LXC)
Realizing Linux Containers (LXC)Realizing Linux Containers (LXC)
Realizing Linux Containers (LXC)
 
The Linux System
The Linux SystemThe Linux System
The Linux System
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Studies
StudiesStudies
Studies
 
Os concepts
Os conceptsOs concepts
Os concepts
 
Building Embedded Linux Full Tutorial for ARM
Building Embedded Linux Full Tutorial for ARMBuilding Embedded Linux Full Tutorial for ARM
Building Embedded Linux Full Tutorial for ARM
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Linux internal
Linux internalLinux internal
Linux internal
 

Recently uploaded

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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)wesley chun
 
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...apidays
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
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 Scriptwesley chun
 
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...Martijn de Jong
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
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 DiscoveryTrustArc
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 

Recently uploaded (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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)
 
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...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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: 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...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Architecture Of The Linux Kernel

  • 1. Architecture of the Linux Kernel by Dominique Gerald M Cimafranca dominique.cimafranca@gmail.com This work is licensed under the Creative Commons Attribution-Share Alike 3.0 Philippines License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ph/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
  • 2. Fundamental Architecture User Applications User Space GNU C Library (glibc) System Call Interface Kernel Kernel Space Architecture Dependent Kernel Code Hardware Platform
  • 3. User Space Components ● User applications ● glibc ● Provides the system call interface that connects to the kernel ● Provides the mechanism to transition between user- space application and kernel ● Each user space process occupies its own virtual address space (vs the kernel which runs on the single address space)
  • 4. Kernel Space Components ● System Call Interface ● Provides the basic functions such as read() and write() ● Kernel ● Architecture-independent kernel code ● Common to all processor architectures supported by Linux ● Architecture-Dependent Code ● Processor- and platform-specific code ● Also known as Board Support Package
  • 5. Kernel Subsystems System Call Interface Process Management Virtual File System Memory Management Network Stack Arch Device Drivers
  • 6. System Call Interface ● Provides the means to perform function calls from user space into the kernel. ● This interface can be architecture dependent, even within the same processor family. ● Can be found in ● ./linux/kernel ● ./linux/arch
  • 7. Process Management ● Focused on the execution of processes ● Each has an individual virtualization of the processor (thread code, data, stack, and registers) ● Kernel provides API through SCI to start, stop, and communicate with processes ● Processes are managed by a scheduler
  • 8. Scheduler ● Kernel implements a scheduling algorithm ● Operates in constant time, regardless of threads ● O(1), meaning, same time to schedule one thread or many threads ● Can be found in ● ./linux/kernel ● ./linux/arch
  • 9. Memory Management ● Memory is managed in pages ● Typically 4KB per page for most architectures ● Can be adjusted ● Support for hardware mechanisms for physical and virtual mappings, e.g. MMU on Pentium ● Keeps tracks of which pages are full, partially used, or empty ● Or if physical memory runs out, swap to disk ● Can be found in ./linux/mm
  • 10. Virtual File System Virtual File System ext3 ... FAT32 /proc Buffer Cache Device Drivers Physical Devices
  • 11. Virtual File System ● Presents a common API abstraction of functions such as open, close, read, and write ● Translates to abstractions specific to a file system ● Support for over 50 different file systems ● Can be found in ./linux/fs
  • 12. Buffer Cache ● Caching layer that optimizes access to the physical devices by keeping data around for a short time ● Provides a common set of functions to the file system layer (independent of any particular file system)
  • 13. Network Stack ● Follows a layered architecture modeled after the TCP/IP protocols ● TCP layer communicates with SCI via sockets ● Sockets provide a standard API to the networking subsystem ● Manage connections ● Move data between endpoints ● Can be found in ./linux/net
  • 14. Device Drivers and Architecture- Dependent Code ● Most of the Linux kernel source code consists of device drivers ● Can be found in ./linux/drivers ● While Linux kernel is mostly architecture ● Can be found in ./linux/arch
  • 16. References ● Anatomy of the Linux Kernel, M. Tim Jones, IBM Developerworks (http://www.ibm.com/developerworks/linux/library/l-linux-kernel/)
  • 17. Architecture of the Linux Kernel by Dominique Gerald M Cimafranca dominique.cimafranca@gmail.com This work is licensed under the Creative Commons Attribution-Share Alike 3.0 Philippines License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ph/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.