Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the modules of the linux kernel

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail what modules there are in the linux kernel. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

I. process scheduling module

Linux takes the process as the basic unit of system resource allocation, and adopts the process advanced algorithm of dynamic priority to ensure the rationality of each process using the processor. The process scheduling module mainly manages and controls the processors used by the process.

[process creation]:

When programming in the Linux environment, the fork () / vfork () function is generally used (fork is to create a child process and copy the memory data of the parent process to the child process Vfork creates a child process and uses it with the parent's memory data share) to create a new process. Of course, that is a function in user space, which calls the clone () system call in the kernel, and the clone () function continues to call do_fork () to complete the process creation.

Fork () / vfork () / _ clone--- > clone ()-> do_fork ()-> copy_process ()

[process revocation]:

After the process terminates, the kernel needs to be notified so that the kernel can release the resources owned by the process, including memory, open files, and other resources, such as semaphores. The general way to terminate a process is to call the exit () library function, which releases the resources allocated by the C library, executes each function registered by the programmer, and ends the system call that reclaims the process from the system.

[process switching]:

Process switching is also known as task switching and context switching. It is the behavior that, in order to control the execution of a process, the kernel suspends the process currently running on the CPU and resumes the execution of a process that was previously suspended.

In essence, each process switch consists of two parts:

Switch the page global catalog to install a new address space; switch the kernel state stack and hardware context, because the hardware context provides all the information the kernel needs to execute the new process, including the CPU register, mainly by the switch_to () function.

[process scheduling]:

In modern Linux, scheduling algorithms can select processes to run within a fixed time (regardless of the number of runnable processes). First of all, we must know that processes can be divided into real-time processes and ordinary processes. Each LInux process is always scheduled according to the following scheduling types: first-in, first-out real-time processes, time slice rotation real-time processes, and ordinary time-sharing processes. Scheduling algorithms vary greatly depending on whether the process is an ordinary process or a real-time process.

2. Inter-process communication module

Inter-process communication is mainly used to control the synchronization, data sharing and exchange between different processes in user space. Because different user processes have different process space, the communication between processes should be realized with the help of kernel transfer. In general, when a process waits for a hardware operation to complete, it is suspended. When the hardware operation is completed, the process is resumed, and the process is coordinated by the communication mechanism between processes.

The inter-process communication module ensures that Linux supports a variety of inter-process communication mechanisms, including pipes, named pipes, message queues, semaphores and shared memory.

Memory management module

The memory management module of Linux adopts advanced virtual storage mechanism to realize the storage management of multi-processes. It provides very reliable storage protection measures, gives different permissions to the process, and users can not directly access the programs and data of the system, which ensures the security of the system. At the same time, each user process is assigned an independent virtual address space.

IV. File system module

The file system module of Linux adopts advanced virtual file system (VFS) technology, shields the differences of various file systems, provides a unified interface for dealing with different file systems, and supports more than 90 different physical file systems. At the same time, Linux treats all kinds of hardware devices as a special file, and uses the method of managing files to manage devices, which is very convenient and effective.

5. Network interface module

Linux has the most powerful network function. The network interface module realizes the network communication between computers through the socket (Socket) mechanism, and uses the network hierarchical model to provide support for a variety of network protocols and network hardware devices.

The network interface provides the implementation of various network standards and the support of all kinds of network hardware. Network interface is generally divided into network protocol and network driver. The network protocol part is responsible for implementing every possible network transport protocol. The network device driver is mainly responsible for communicating with hardware devices, and every possible network hardware device has a corresponding device driver.

On the linux kernel which modules are shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report