A popular explanation of the Windows Kernel Self-mapping scheme

Source: Internet
Author: User

  On an operating system course to listen to the teacher said such an interesting thing, Windows self-mapping scheme actually reached the 4K page directory of the linear address "hidden" in the 4M page table effect, feel very strange, and then think about how to calculate. The light will still be unsatisfied, and I feel that there are two problems for me that are vague:

    • Why is it possible to say that 0xc0300000 is a viable page directory at the beginning of linear address?
    • Under the condition of 0xc0000000 as the linear address of the page table, must the starting point of the linear address of the page directory be 0xc0300000?

In order to solve these two problems, I looked at a lot of blogs, but most of the blog or article on the principle of a full explanation, but there is no example of this will appear to be very empty, so the following to discuss with you about the problem of the popular point of explanation, if there are errors in the place to see.

why q1:0xc0300000 is feasible

First we have the following assertion: Knowing the linear address of a 4M space in a page table, you can determine the physical address of the page directory that is the item in the page catalog item.

The first thing to emphasize is the physical address of the page table stored in the page catalog entry (PDE). First to explain this "raving". We can directly know the physical address only the physical address of the page directory (in the CR3 Register), in the memory of the page directory entry in the physical address of each page table, so we access the page table only by indirect way to access its physical address. Which way, in fact, is through our virtual address high 10 bits as the index, the value in the CR3 register is the base address to find the page table, thus accessing its physical address. Assuming that the virtual address of the page directory is not known, but we want to access the physical address of a page table through the virtual address, we access the page directory entry is always the No. 768 item, because the page table of 4M linear address (here starting from 0xc0000000) is determined, the first 10 bits of the value is always 1100 0000 00. We want to access the physical address of the different page table, but every time we find the same physical address from the same page directory entry in the same location, we have to ask, we obviously want to access the physical address of the different page table, but every time we fetch is the same page directory index number, why?

A popular explanation of the Windows Kernel Self-mapping scheme

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.