Architecture Of The Linux Kernel
-
Upload
dominique-cimafranca -
Category
Technology
-
view
30.500 -
download
3
description
Transcript of Architecture Of The Linux Kernel
![Page 1: Architecture Of The Linux Kernel](https://reader035.fdocuments.net/reader035/viewer/2022081813/545cecf8b0af9fa92c8b4be8/html5/thumbnails/1.jpg)
Architecture of the Linux Kernel
by Dominique Gerald M Cimafranca [email protected]
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.
![Page 2: Architecture Of The Linux Kernel](https://reader035.fdocuments.net/reader035/viewer/2022081813/545cecf8b0af9fa92c8b4be8/html5/thumbnails/2.jpg)
Fundamental Architecture
Hardware Platform
User Applications
GNU C Library (glibc)
System Call Interface
Kernel
Architecture Dependent Kernel Code
User Space
Kernel Space
![Page 3: Architecture Of The Linux Kernel](https://reader035.fdocuments.net/reader035/viewer/2022081813/545cecf8b0af9fa92c8b4be8/html5/thumbnails/3.jpg)
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)
![Page 4: Architecture Of The Linux Kernel](https://reader035.fdocuments.net/reader035/viewer/2022081813/545cecf8b0af9fa92c8b4be8/html5/thumbnails/4.jpg)
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
![Page 5: Architecture Of The Linux Kernel](https://reader035.fdocuments.net/reader035/viewer/2022081813/545cecf8b0af9fa92c8b4be8/html5/thumbnails/5.jpg)
Kernel Subsystems
System Call Interface
Process Management Virtual File System
Memory Management Network Stack
Arch Device Drivers
![Page 6: Architecture Of The Linux Kernel](https://reader035.fdocuments.net/reader035/viewer/2022081813/545cecf8b0af9fa92c8b4be8/html5/thumbnails/6.jpg)
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
![Page 7: Architecture Of The Linux Kernel](https://reader035.fdocuments.net/reader035/viewer/2022081813/545cecf8b0af9fa92c8b4be8/html5/thumbnails/7.jpg)
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
![Page 8: Architecture Of The Linux Kernel](https://reader035.fdocuments.net/reader035/viewer/2022081813/545cecf8b0af9fa92c8b4be8/html5/thumbnails/8.jpg)
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
![Page 9: Architecture Of The Linux Kernel](https://reader035.fdocuments.net/reader035/viewer/2022081813/545cecf8b0af9fa92c8b4be8/html5/thumbnails/9.jpg)
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
![Page 10: Architecture Of The Linux Kernel](https://reader035.fdocuments.net/reader035/viewer/2022081813/545cecf8b0af9fa92c8b4be8/html5/thumbnails/10.jpg)
Virtual File System
Virtual File System
ext3 FAT32 /proc...
Buffer Cache
Device Drivers
Physical Devices
![Page 11: Architecture Of The Linux Kernel](https://reader035.fdocuments.net/reader035/viewer/2022081813/545cecf8b0af9fa92c8b4be8/html5/thumbnails/11.jpg)
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
![Page 12: Architecture Of The Linux Kernel](https://reader035.fdocuments.net/reader035/viewer/2022081813/545cecf8b0af9fa92c8b4be8/html5/thumbnails/12.jpg)
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)
![Page 13: Architecture Of The Linux Kernel](https://reader035.fdocuments.net/reader035/viewer/2022081813/545cecf8b0af9fa92c8b4be8/html5/thumbnails/13.jpg)
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
![Page 14: Architecture Of The Linux Kernel](https://reader035.fdocuments.net/reader035/viewer/2022081813/545cecf8b0af9fa92c8b4be8/html5/thumbnails/14.jpg)
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
![Page 15: Architecture Of The Linux Kernel](https://reader035.fdocuments.net/reader035/viewer/2022081813/545cecf8b0af9fa92c8b4be8/html5/thumbnails/15.jpg)
Questions?
![Page 16: Architecture Of The Linux Kernel](https://reader035.fdocuments.net/reader035/viewer/2022081813/545cecf8b0af9fa92c8b4be8/html5/thumbnails/16.jpg)
References
● Anatomy of the Linux Kernel, M. Tim Jones, IBM Developerworks (http://www.ibm.com/developerworks/linux/library/l-linux-kernel/)
![Page 17: Architecture Of The Linux Kernel](https://reader035.fdocuments.net/reader035/viewer/2022081813/545cecf8b0af9fa92c8b4be8/html5/thumbnails/17.jpg)
Architecture of the Linux Kernel
by Dominique Gerald M Cimafranca [email protected]
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.