SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Downloaden Sie, um offline zu lesen
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.

Weitere ähnliche Inhalte

Was ist angesagt?

Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
Houcheng Lin
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
mcganesh
 
Embedded Operating System - Linux
Embedded Operating System - LinuxEmbedded Operating System - Linux
Embedded Operating System - Linux
Emertxe Information Technologies Pvt Ltd
 
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
 
Kernel_Crash_Dump_Analysis
Kernel_Crash_Dump_AnalysisKernel_Crash_Dump_Analysis
Kernel_Crash_Dump_Analysis
Buland Singh
 

Was ist angesagt? (20)

Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Linux introduction
Linux introductionLinux introduction
Linux introduction
 
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 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
 
Embedded Operating System - Linux
Embedded Operating System - LinuxEmbedded Operating System - Linux
Embedded Operating System - Linux
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
Linux Locking Mechanisms
Linux Locking MechanismsLinux Locking Mechanisms
Linux Locking Mechanisms
 
Kernel_Crash_Dump_Analysis
Kernel_Crash_Dump_AnalysisKernel_Crash_Dump_Analysis
Kernel_Crash_Dump_Analysis
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 
Linux System Programming - File I/O
Linux System Programming - File I/O Linux System Programming - File I/O
Linux System Programming - File I/O
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
A practical guide to buildroot
A practical guide to buildrootA practical guide to buildroot
A practical guide to buildroot
 
Linux-Internals-and-Networking
Linux-Internals-and-NetworkingLinux-Internals-and-Networking
Linux-Internals-and-Networking
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 

Ähnlich wie Architecture Of The Linux Kernel

Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)
Vivian Vhaves
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
mcganesh
 
Linux internal
Linux internalLinux internal
Linux internal
mcganesh
 

Ähnlich wie 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
 
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
 
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
 
Lec 10-linux-review
Lec 10-linux-reviewLec 10-linux-review
Lec 10-linux-review
 
Arch linux and whole security concepts in linux explained
Arch linux and whole security concepts in linux explained Arch linux and whole security concepts in linux explained
Arch linux and whole security concepts in linux explained
 

Mehr von Dominique Cimafranca

Welcome Address - CS Cluster Orientation
Welcome Address - CS Cluster OrientationWelcome Address - CS Cluster Orientation
Welcome Address - CS Cluster Orientation
Dominique Cimafranca
 
Why you can't write filipino science fiction
Why you can't write filipino science fictionWhy you can't write filipino science fiction
Why you can't write filipino science fiction
Dominique Cimafranca
 

Mehr von Dominique Cimafranca (18)

Welcome Address - CS Cluster Orientation
Welcome Address - CS Cluster OrientationWelcome Address - CS Cluster Orientation
Welcome Address - CS Cluster Orientation
 
Story a meditation
Story a meditationStory a meditation
Story a meditation
 
Video Games as Culture and Experience
Video Games as Culture and ExperienceVideo Games as Culture and Experience
Video Games as Culture and Experience
 
Privacy and how the Internet works
Privacy and how the Internet works Privacy and how the Internet works
Privacy and how the Internet works
 
Why you can't write filipino science fiction
Why you can't write filipino science fictionWhy you can't write filipino science fiction
Why you can't write filipino science fiction
 
What is MVC?
What is MVC?What is MVC?
What is MVC?
 
Thesis proposal checklist
Thesis proposal checklistThesis proposal checklist
Thesis proposal checklist
 
FOSS and social development
FOSS and social developmentFOSS and social development
FOSS and social development
 
Metadata 101
Metadata 101Metadata 101
Metadata 101
 
Creative nonfiction
Creative nonfictionCreative nonfiction
Creative nonfiction
 
Speculative Fiction
Speculative FictionSpeculative Fiction
Speculative Fiction
 
Online Literature
Online LiteratureOnline Literature
Online Literature
 
Writing Short Fiction
Writing Short FictionWriting Short Fiction
Writing Short Fiction
 
Teaching Open Source In The University
Teaching Open Source In The UniversityTeaching Open Source In The University
Teaching Open Source In The University
 
Poetry
PoetryPoetry
Poetry
 
Understanding The Boot Process
Understanding The Boot ProcessUnderstanding The Boot Process
Understanding The Boot Process
 
Ubuntu For Intranet Services
Ubuntu For Intranet ServicesUbuntu For Intranet Services
Ubuntu For Intranet Services
 
Open Source In Education
Open Source In EducationOpen Source In Education
Open Source In Education
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
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
panagenda
 

Kürzlich hochgeladen (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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
 
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?
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
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...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
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
 
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...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 

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.