When I bring a system call in user mode, how was the call processed in the OS?
Does it invite some executable binary or some standard library?
If so, how should the call be completed? Starting with version 2.5, linux kernel introduced a new system call entry system on Pentium II + processor - - "text" itemprop = "
.
Due to performance issues on Pentium IV processors with the current software interrupt method, the optional system call entry system is available on the SYSENTER / SYSEXIT instructions available on the penis II + processor Was implemented by using this article. The discussion is limited to the x86 architecture and all source code entries are based on the Linux kernel 2.6.15.6.
- What are system calls?
One way of requesting services from the kernel is to provide user call processes to what types of services are managed by operating systems such as storage, memory, network, process management, etc. If a user process files wants to read, he "will open and call read 'system. Are usually system calls called by direct processes C library provides an interface to all system calls.
- What's in the system call?
A kernel code snippet is run on the request of a user process. This code runs in Ring 0 (with current privilege level -CPL-0), which is the highest level of privilege in the x86 architecture. All user processes run in ring 3 (CPL3).
Therefore, in order to implement the system call mechanism, what we need
1) One way to call ring 3.
2) Code to make some kernel requests.
- A good old way to do this
Until recently, Linux implemented the system call on all x86 platforms using the software call interruption. To execute the system call, the user process will copy the desired system call number to% eax and execute 'int x x 80'. This will generate interrupt 0x80 and an interrupt service routine. For 0x80, this routine is an "all system calling handling" routine. This routine will be executed in Ring 0. This routine, as defined in the file /usr/src/linux/arch/i386/kernel/entry.S, will save the current state and will call the appropriate system call handler depending on the value in%. Eax.
- New bright way to do this
It was found that this software interrupt method was very slow on the Pentium IV processor. In order to solve this issue, Linus applied the alternative system call mechanism to take advantage of SYSENTER / SYSEXIT instructions provided by all Pentium II + processors. Before proceeding with this new way of doing this, we make ourselves more familiar with these instructions.
- New bright way to do this
Comments
Post a Comment