Linux: The implementation flowchart of socket System calling in the linux kernel, socketlinux

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.