Read ldd3, memory ing and DMA-PAGE_SHIFT, page frame number.

Source: Internet
Author: User

1. Address types processed by Linux

1. User Virtual Address:

This is the user spaceProgramCommon address. Each process has its own virtual address space.

2. physical address

The physical address is used between the processor and the system memory.

3. Bus address

The bus address is used in the peripheral bus and memory.

4. kernel logic address

The Logical Address of the kernel constitutes the regular address space of the kernel. It maps some or all of the system memory one-to-one.

In most architectures, the logic address of the kernel is different from the physical address, only because there is a fixed offset between them.

What kmalloc allocates is the logical address __get_free_pages?

5. kernel virtual address.

It differs from the kernel logic address in that the kernel virtual address does not correspond to the physical address one by one.

The kernel virtual address space is continuous, but the physical address mapped to it can be discrete. The logic address of the kernel is continuous, and the physical address mapped by other operations is also continuous.

Vmalloc. kmap returns the virtual address of the kernel.

All kernel logical addresses are kernel virtual addresses, but not all kernel virtual addresses are kernel logical addresses.

2. Page

Physical addresses are divided into discrete units. Each unit is called a page. Page size, expressed by the macro page_size

3. page_shift: page frame number

The kernel address, whether virtual or physical, consists of two parts. Generally, N-bit is the page number, and m-bit is the offset in the page.

When we discard the low m offset in the address, we move the n-bit page number to the right. The result is called the page frame number.

It is a common operation to move a bit to convert between the number of page frames and the address. The macro page_shift tells us how many places to shift right to get the page frame number.

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.