How to do dynamic tracking in Linux users and kernel space

Updated on technology 2024-04-13
6 answers
  1. Anonymous users2024-02-07

    If you will take the exam, you can debug it directly and see the process page table. But I don't know what I'm doing in **, I haven't seen it. When vmalloc allocates address space, the page table is only updated to the main kernel page table.

    Therefore, the kernel accessing this vmalloc valid address may cause a missing page exception, and then update the kernel part of the page table through this lazy mode.

  2. Anonymous users2024-02-06

    As a Linux developer, you should first be clear about the difference between kernel space and user space. There has been a lot of information on this topic, which we briefly describe here:

    In modern computer architectures, storage management often includes protection mechanisms. The purpose of the protection is to prevent one task in the system from accessing the storage area that belongs to another or to the operating system. For example, in the Intelx86 system, a protection mechanism of privilege level is provided to restrict access to the storage area through the difference of privilege level.

    Based on this architecture, the Linux operating system divides itself: a part of the core software runs at a higher privilege level independent of ordinary applications, (Linux uses privilege level 3 of the Intel system to run the kernel.) They reside on protected memory space and have all the access to hardware devices, which Linux refers to as kernel space.

  3. Anonymous users2024-02-05

    Simply understood: kernel space is used by the kernel, and user space is used by applications; Unless the kernel is compiled to consider kernel space, the rest of the situation can be handled as userspace.

  4. Anonymous users2024-02-04

    Regarding kernel space and user space, it is said that Linux drivers generally work in kernel space, but they can also work in user space. Here's a closer look at what kernel space is, what user space is, and how to judge them.

    Linux simplifies the segmentation mechanism so that the virtual address is always the same as the linear address, so the virtual address space of Linux is also 0 The kernel divides the 4G byte space into two parts. The highest 1g byte (from the virtual address 0xc0000000 to the 0xffffffff), for the kernel to use, is called"Kernel space".The lower 3 gigabytes (from the virtual address 0x00000000 to 0xbfffffff) are used by individual processes, which is called"userspace).

    Because each process can enter the kernel through a system call, the Linux kernel is shared by all processes within the system. Thus, from the perspective of specific processes, each process can have 4 gigabytes of virtual space.

    Linux uses a two-tier protection mechanism: level 0 for the kernel and level 3 for user programs. Each process has its own private user space (0 3g), which is invisible to other processes in the system.

    The maximum 1GB byte of virtual kernel space is shared by all processes and kernels.

    The kernel space is the kernel and data, while the user space of the process is the user program and the data. It doesn't matter if it's kernel space or user space, it's all in virtual space.

  5. Anonymous users2024-02-03

    If you're talking about kernel modules, you can use the call usermodehelper function. Specifically, you can take a look at this letter Sakura to count the royal songs.

  6. Anonymous users2024-02-02

    If you use alloc page() to get the page corresponding to the high-end memory, how to find a linear rental space for it?

    The kernel dedicates a linear space for this, from pkmap base to fixaddr start, for mapping high-end memory. On the kernel, this address range is between 4g-8m and 4g-4m. This space is called "Kernel Permanent Mapping Space" or "Persistent Kernel Mapping Space".

    This space uses the same page directory table as the others, which is a swapper pg dir for the kernel and a cr3 register for a normal process. Normally, this space is 4m in size, so only one page table is needed, and the kernel looks for this file page table by going to pkmap page table. Mindfulness can be used to map a page to this space through kmap().

    Since this space is 4m in size, up to 1024 pages can be mapped at the same time. Therefore, for pages that are not in use, they can be released from this space when they should be released (i.e., unmapped), and the linear address corresponding to a page can be released from this space through kunmap().

Related questions
4 answers2024-04-13

tar jxvf and then enter the directory that has just been extracted, and execute the following command. >>>More

11 answers2024-04-13

In the Linux environment, apache is the start of the httpd service, and it is very simple to view the apache logs, just use the following command: >>>More

6 answers2024-04-13

1.**Packages, compiled and installed (.)configure,make,make install). I believe that the masters are installed like this. >>>More

3 answers2024-04-13

RAID is also hard and soft? Yes. RAID does have a distinction between software and hardware, the two are relative, software (piece) RAID refers to the RAID that does not use the hardware RAID card or the motherboard integrated RAID function to achieve RAID, is to achieve this purpose at the operating system level; Hardware (piece) RAID refers to the implementation of RAID through RAID cards or integrated RAID functions on the motherboard, which is achieved at the lower level of the operating system, and the operating system is almost unaware of this situation. >>>More

12 answers2024-04-13

Brother sent so much, send some practical things, some things are well done, he didn't have such a coincidence >>>More