System call System_call Process

Source: Internet
Author: User

Original works reproduced please specify the source + "Linux kernel analysis" MOOC course http://mooc.study.163.com/course/USTC-1000029000

Author: Zangjie Riviera

The process of Linux system calls:

Entry_32.s

1.enter System_call

2.push EAX saves the value of EAX because this value is related to system calls

3.save_all, save the scene.

4. Compare system call numbers EAX and Nr_systemcall, and if this is a legitimate system call, execute the call symbol table Syscall_table

5. According to EAX to find the system call number corresponding to the system call function, with kernel functions for processing, such as Sys_time,sys_read.

6. After the kernel function returns, it is not urgent to switch back to the user state, but to check whether the process scheduling is needed at this time, if necessary, jump process scheduling function.

7. If no scheduling is required, the user-state process is returned.

Original works reproduced please specify the source + "Linux kernel analysis" MOOC course http://mooc.study.163.com/course/USTC-1000029000

Author: Zangjie Riviera

The process of Linux system calls:

Entry_32.s

1.enter System_call

2.push EAX saves the value of EAX because this value is related to system calls

3.save_all, save the scene.

4. Compare system call numbers EAX and Nr_systemcall, and if this is a legitimate system call, execute the call symbol table Syscall_table

5. According to EAX to find the system call number corresponding to the system call function, with kernel functions for processing, such as Sys_time,sys_read.

6. After the kernel function returns, it is not urgent to switch back to the user state, but to check whether the process scheduling is needed at this time, if necessary, jump process scheduling function.

7. If no scheduling is required, the user-state process is returned.

Summary: System call is a special interrupt, do not need external hardware and other signals to enter the kernel state, into the interrupt service program. That is, the System_call, in the process context when the user state, after the kernel state calls the interrupt service program, into the interrupt handler, at this time in the interrupt context, You need to check for process scheduling before returning to the user state, because there may be more programs that need to be processed (a higher-priority program or a kernel-enforced preemption) needs to be handled.

System call System_call Process

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.