Fourth week of Linux kernel design--clawed system calls three layers of skin

Source: Internet
Author: User

Linux kernel Design Week fourth--clawed system call three layer leather by Su Zhengshen Original works reproduced please specify the source "Linux kernel Analysis" MOOC course One, Knowledge Point collation 1. User-State kernel state and interrupt Handler

We generally use system calls in general through library functions

    • User-State and kernel-State distinction:

      "The CPU has different execution levels, and at high execution level, the code can execute privileged instructions, access any physical address, and at a low level of execution, there will be a certain limit." (for system security and stability purposes) The Intel X86 CPU has four different execution levels 0-3;linux uses only the 0 and 3 levels to represent the kernel state and the user state. 】

      A significant distinction: the lowest two bits of the CS register indicate the privilege level of the current code
      In Linux, the address space is a significant sign:

      The address space above 0xc0000000 can only be accessed in the kernel State,
      The 0XC00000000--0XBFFFFFFF address space can be accessed in both states.

Interrupt Occurrence Process:

    1. Interrupt processing is the primary way to enter the kernel state from the user state, and the system call is only a special interrupt.

    2. The first thing that happens after an outage is to save the scene:

    3. The interrupt/int instruction stores the value of some registers on the stack (user-state stack top address, current state word, then CS:EIP value)

    4. The first thing to do before the break ends is to resume the scene.
      Kernel code to complete interrupt service.

2. Overview of system calls and three-layer skins for system calls:

System invocation: Provides a set of interfaces for interacting with user-state processes and hardware devices.

Fourth week of Linux kernel design--clawed system calls three layers of skin

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: 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.