Linux: The implementation flowchart of socket System calling in the linux kernel, socketlinux
Implementation of socket System calling in Linux kernel:
Generate a system call in Linux and add a new function to the Linux kernel.
To add a new sys call in the kernel, follow these steps:
A. add your own sys call code and modify the makefile;
B. Modify the header file and assign your own system call number;
C. The system call is implemented through the interrupt and query table. Therefore, you need to add related items in the system call table, which requires modifying the relevant Assembly source files;
D. Re-compile the kernel and write the test program to test the newly added sys call;
Notes:
1. The files/locations to be modified in the preceding steps vary with different processor architectures;
2. For the test code at the application layer, the corresponding _ syscallN macro can be used before 2.6.20;
However, after version 2.6.20, these macros have been removed from the kernel. You need to use the syscall function at the application layer.
To test.
You can add EXPORT_SYMBOL/EXPORT_SYMBOL_GPL to your sys call implementation file.
You can use another module or other kernel code to export your global variables or functions.
These variables and functions.
//////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////// ///
JulianTec is the Hangzhou market.
The only organization established by senior R & D engineers. Therefore:
In terms of professionalism and reality, juantec (Hangzhou)
It is your best guide for learning embedded Linux R & D under the arm architecture!
What are the relationships between linux kernels and kernel functions, operating systems, and system calls?
System functions are linux functions. Different from system functions such as windows, linux kernel is a part of the operating system. The operating system also includes shell and file systems, system Call is the operation system to call functions and other things.