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 modules does linux have?

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "what module does linux have". In daily operation, I believe many people have doubts about what module linux has. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the question of "what module does linux have?" Next, please follow the editor to study!

Linux has five modules: (1) process scheduling module, which is mainly used to manage and control the processors used for processes; (2) inter-process communication module, which is mainly used to control the synchronization, data sharing and exchange between different processes in user space; (3) memory management module, which adopts advanced virtual storage mechanism to realize the storage management of multi-processes; (4) file system module.

The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

The Linux kernel consists of five sub-modules: process scheduling module, inter-process communication module, memory management module, file system module and network interface module.

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]:

   generally uses the fork () / vfork () function when programming in the Linux environment (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 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 called 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 stack and hardware context, because the hardware context provides all the information the kernel needs to execute the new process, including the CPU register, which is mainly done by the switch_to () function.

[process scheduling]:

In    's modern Linux, the scheduling algorithm 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.

   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 features. 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 various 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.

At this point, the study of "what modules does linux have" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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