Table of Contents
Linux Architecture" >Linux Architecture
Linux kernel structure" >Linux kernel structure
Home System Tutorial LINUX Detailed explanation of Linux architecture and kernel structure

Detailed explanation of Linux architecture and kernel structure

Feb 11, 2024 am 10:54 AM
linux linux tutorial linux system linux command shell script embeddedlinux Getting started with linux linux learning

Linux Architecture

As shown in the figure below, the Linux architecture can be broadly divided into user space (User Space) and kernel space (Kernel Space).

Detailed explanation of Linux architecture and kernel structure

User space includes C libraries and user applications. Some architecture diagrams also include shells. Of course, shell scripts are also an integral part of the Linux system.

The kernel space includes hardware platform, platform dependent code, kernel and system call interface.

In any modern operating system, there are layers. Why is layering necessary? From a programmer's perspective, separating the Linux underlying and applications allows each to focus on its own area, thereby improving efficiency. From a security perspective, layering is about protecting the kernel. Modern CPUs usually implement different working modes. For example, ARM implements 7 working modes. In different modes, the CPU can execute different instructions or access different registers. If all upper-layer applications can call registers at will, the operating system cannot execute stably. Therefore, a new discipline has emerged in operating systems - "modern operating systems".

In the X86 architecture, 4 different levels of permissions are implemented, namely Ring0 to Ring3. Under Ring0 permissions, privileged instructions can be executed and IO devices can be accessed, while under Ring3 permissions there are many restrictions.

Android is even more "crazy". All APK applications run on the Java virtual machine, and the applications are further away from the bottom layer.

In addition, user space and kernel space are two different states of program execution. We can complete the transfer from user space to kernel space through "system call" and "hardware interrupt".

Linux kernel structure

In this section, we analyze the kernel structure.

As shown in the figure below, it is the Linux kernel structure diagram.

Detailed explanation of Linux architecture and kernel structure

SCI layer (System Call Interface), this layer provides a set of standard system call functions for application user space to access Linux. When analyzing the Linux architecture earlier, we introduced that any modern operating system will not allow upper-layer applications to directly access the lower layer. In Linux, the kernel provides a set of standard interfaces through which upper-layer applications can access. Ground floor.

PM (Procees Management), this part includes specifically creating processes (fork, exec), stopping processes (kill, exit), and controlling communication between them (signal, etc.). Also included is process scheduling, which controls how active processes share the CPU. This part is already done by Linux. When writing the driver, you only need to call the corresponding functions to realize these functions, such as creating processes, process communication, etc.

MM (Memory Management), the main function of memory management is to control the safe shared memory area of ​​multiple processes.

VFS (Virtual File Systems), a virtual file system, hides the specific details of various file systems and provides a unified interface for file operations. In Linux, "everything is a file", and these files are implemented through VFS. Linux provides a large general model that encompasses the set of all file system functions. As shown in the figure below, it is the structure diagram of a virtual file system.

Detailed explanation of Linux architecture and kernel structure

Device Drivers device driver, this part is what needs to be learned and mastered. There is a large amount of code in the Linux kernel in the device driver section, which is used to control specific hardware devices.

Linux drivers are generally divided into network devices, block devices, character devices, and miscellaneous devices. We only need to write character devices. Miscellaneous devices are a type of driver that are not easy to classify. There are many overlaps between miscellaneous devices and character devices. .

Network protocol stack, the Linux kernel provides a wealth of network protocol implementations.

Before learning Linux drivers, you need to understand and master the Linux architecture and Linux kernel structure

The above is the detailed content of Detailed explanation of Linux architecture and kernel structure. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1655
14
PHP Tutorial
1252
29
C# Tutorial
1226
24
Linux Architecture: Unveiling the 5 Basic Components Linux Architecture: Unveiling the 5 Basic Components Apr 20, 2025 am 12:04 AM

The five basic components of the Linux system are: 1. Kernel, 2. System library, 3. System utilities, 4. Graphical user interface, 5. Applications. The kernel manages hardware resources, the system library provides precompiled functions, system utilities are used for system management, the GUI provides visual interaction, and applications use these components to implement functions.

vscode terminal usage tutorial vscode terminal usage tutorial Apr 15, 2025 pm 10:09 PM

vscode built-in terminal is a development tool that allows running commands and scripts within the editor to simplify the development process. How to use vscode terminal: Open the terminal with the shortcut key (Ctrl/Cmd). Enter a command or run the script. Use hotkeys (such as Ctrl L to clear the terminal). Change the working directory (such as the cd command). Advanced features include debug mode, automatic code snippet completion, and interactive command history.

How to check the warehouse address of git How to check the warehouse address of git Apr 17, 2025 pm 01:54 PM

To view the Git repository address, perform the following steps: 1. Open the command line and navigate to the repository directory; 2. Run the "git remote -v" command; 3. View the repository name in the output and its corresponding address.

Where to write code in vscode Where to write code in vscode Apr 15, 2025 pm 09:54 PM

Writing code in Visual Studio Code (VSCode) is simple and easy to use. Just install VSCode, create a project, select a language, create a file, write code, save and run it. The advantages of VSCode include cross-platform, free and open source, powerful features, rich extensions, and lightweight and fast.

How to run java code in notepad How to run java code in notepad Apr 16, 2025 pm 07:39 PM

Although Notepad cannot run Java code directly, it can be achieved by using other tools: using the command line compiler (javac) to generate a bytecode file (filename.class). Use the Java interpreter (java) to interpret bytecode, execute the code, and output the result.

What is the main purpose of Linux? What is the main purpose of Linux? Apr 16, 2025 am 12:19 AM

The main uses of Linux include: 1. Server operating system, 2. Embedded system, 3. Desktop operating system, 4. Development and testing environment. Linux excels in these areas, providing stability, security and efficient development tools.

vscode Previous Next Shortcut Key vscode Previous Next Shortcut Key Apr 15, 2025 pm 10:51 PM

VS Code One-step/Next step shortcut key usage: One-step (backward): Windows/Linux: Ctrl ←; macOS: Cmd ←Next step (forward): Windows/Linux: Ctrl →; macOS: Cmd →

vscode terminal command cannot be used vscode terminal command cannot be used Apr 15, 2025 pm 10:03 PM

Causes and solutions for the VS Code terminal commands not available: The necessary tools are not installed (Windows: WSL; macOS: Xcode command line tools) Path configuration is wrong (add executable files to PATH environment variables) Permission issues (run VS Code as administrator) Firewall or proxy restrictions (check settings, unrestrictions) Terminal settings are incorrect (enable use of external terminals) VS Code installation is corrupt (reinstall or update) Terminal configuration is incompatible (try different terminal types or commands) Specific environment variables are missing (set necessary environment variables)

See all articles