Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7714103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:02:31+00:00 2026-06-01T02:02:31+00:00

I came up with this question because I don’t understand how address translation is

  • 0

I came up with this question because I don’t understand how address translation is carried out in kernel area.

From what I understand, to translate any address above 0xC0000000, we just need to minus this address with PAGE_OFFSET (except the kernel initializing process, where we need a page table for 8MB range). But this does not make sense where CPU executes an instruction that requires address at, say 0xF0000020, while the system only have a 256MB RAM.

For the above reason, I think the kernel indeed has a page table which allows the MMU to translate virtual address above 0xC0000000 to physical. Thus, in what situation we can directly minus the PAGE_OFFSET and in what situation we need the kernel page table?

I may get wrong at the beginning, so please correct.


EDIT

From << Understanding the Linux Virtual Memory Manager >>, where it says kernel page table exists. Now, more confused…

3.6 Kernel Page Tables

When the system first starts, paging is not enabled because page tables do not
magically initialize themselves. Each architecture implements this differently so
only the x86 case will be discussed. The page table initialization is divided into two
phases. The bootstrap phase sets up page tables for just 8MiB so that the paging
unit can be enabled. The second phase initializes the rest of the page tables. We
discuss both of these phases in the following sections.

3.6.1 Bootstrapping

…

3.6.2 Finalizing

The function responsible for finalizing the page tables is called paging_init(). The
call graph for this function on the x86 can be seen on Figure 3.4.
enter image description here

The function first calls pagetable_init() to initialize the page tables necessary
to reference all physical memory in ZONE_DMA and ZONE_NORMAL. Remember that
high memory in ZONE_HIGHMEM cannot be directly referenced and that mappings
are set up for it temporarily. For each pgd t used by the kernel, the boot memory
allocator (see Chapter 5) is called to allocate a page for the PGD, and the PSE
bit will be set if available to use 4MiB TLB entries instead of 4KiB. If the PSE
bit is not supported, a page for PTEs will be allocated for each pmd t. If the CPU
supports the PGE flag, it also will be set so that the page table entry will be global
and visible to all processes.

Next, pagetable_init() calls fixrange_init() to set up the fixed address
space mappings at the end of the virtual address space starting at FIXADDR_START.
These mappings are used for purposes such as the local Advanced Programmable
Interrupt Controller (APIC) and the atomic kmappings between FIX_KMAP_BEGIN
and FIX_KMAP_END required by kmap_atomic(). Finally, the function calls
fixrang_init() to initialize the page table entries required for normal high memory
mappings with kmap().

After pagetable_init() returns, the page tables for kernel space are now fully
initialized, so the static PGD (swapper_pg_dir) is loaded into the CR3 register so
that the static table is now being used by the paging unit.

The next task of the paging_init() is responsible for calling kmap_init() to
initialize each of the PTEs with the PAGE_KERNEL protection flags. The final task is
to call zone_sizes_init(), which initializes all the zone structures used.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T02:02:32+00:00Added an answer on June 1, 2026 at 2:02 am

    Although linear mapping may seem special to human, it (usually) isn’t special in terms of MMU configuration.

    So as you said, to translate the virtual address from 3G to 3G+900MB, we can directly minus these addresses with PAGE_OFFSET. Does that mean the kernel does not need any page tables?

    It still needs those tables to explain that specific (linear) mapping to MMU. Although there are some special cases like MIPS R3000.

    But this does not make sense where CPU executes an instruction that requires address at, say 0xF0000020

    I’d ask whether it makes sense to execute instruction at that address in the first place. What I mean is that on system with 256MBs of RAM you won’t simply encounter such request (at least assuming code is not buggy).

    The point that is confusing for you is IMO: who is responsible for doing address translations? The answer is (again, usually) MMU, implemented in hardware. The page tables are therefore the way to say MMU how it should do such translations – doing that is not kernel responsibility. The kernel just needs to configure MMU.

    How the address translation(virt->phy) is performed when CPU requires an address above 0xC0000000?

    Just as for the addresses below. This reading may be helpful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question came about because the cells gem specifies template directories using File.join('app','cells'). That
What is the difference between above two? This question came to my mind because
I came across this question on an interview questions thread. Here is the question:
I came across this question after searching for a ODBC or JDBC. To my
I came across this question: say given two weights 1 and 3, u can
I came across this question on transcender: What should you apply to a field
I came across this question on a website. As mentioned there, it was asked
Today I came across this question: you have a code static int counter =
I am preparing for my interview and came across this question: Consider that i
This question came into my mind while generating sample data for a SO-answer. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.