Linux Kernel Analysis-System Call implementation code analysis

Source: Internet
Author: User
Linux Kernel Analysis-System Call implementation code analysis-Linux general technology-Linux programming and kernel information. The following is a detailed description. The startup has been read for a long time. Now, to write the notes, you can roughly read them again after the startup. There are several major modules: startup and initialization, interrupt signal, process and scheduling, and memory management, file systems, networks, drivers, modules, etc. I mainly start with these. Since the startup part involves a lot of compilation knowledge related to the x86 system before start_kernel, it takes a lot of time, so I skipped it, first grasp the general context of the entire system, and then do it twice, three analyses. I will analyze the network part from the 4.4BSD-Lite code.

System call:

First, let's talk about system calls. It's strange that all the read-core data has not put forward the system calls separately. I think it is more important. A key hub for communication between users and the system kernel. Take a closer look at its mechanism, prepare for three days, and have some books and materials at hand to help me understand it.

Concept: (clarify the basic concept) system calls occur in the user process and request the kernel to provide services through some special functions (such as open). In this case, the user process suspends and the kernel verifies the user request, click "try" and report the result to the user process. Then, restart the user process. These mechanisms are available in general programming books. I will discuss these mechanisms through the implementation of source code.

Specific implementation code: arch/i386/kernel/entry. S (kernel version 2.2.14) from entry. the first line of S is system_call, and the code lines 171-248 are pasted out. The analysis is in the form of a comment: ENTRY (system_call) \ All System Call ENTRY points, the system_call parameter is the number of system calls you want to activate pushl % eax # Save orig_eax. This value is the number of system calls you want SAVE_ALL. The SAVE_ALL macro is defined as follows:
QUOTE:
Related Article

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.