Linux Memory Initialization (assembly section) __linux

Source: Internet
Author: User

There were a few blogs detailing Xen's memory initialization, and it really felt like this was a pretty complicated piece of content. These two days to see the Linux kernel boot memory initialization, is also looking at the fog, want to try to read the next write, in the process of writing a blog slowly thinking, and finally can share their thoughts to others.

This series is mainly divided into two parts, assembly section and C language section.

This blog post is mainly about the assembly section.

Note: These two posts are all about 64-bit systems. Kernel Decompression Process

This process is not detailed, the entire Linux kernel as a compressed mirror provided, before the implementation of the kernel code, first need to bootloader it a decompression, this part is interested to see this blog. what is the original page table?

After the decompression is finished, a parse is performed on the elf format, then the kernel is loaded and the startup_64 is finally entered in the Arch/x86/kernel/head_64.s.

Startup_64 mainly completes the paging feature enabled, and finally jumps into the C code x86_64_start_kernel. Before we start parsing the code, let's take a look at what it looks like to initialize the page table in the data segment of the kernel.

1 2 3 4 5 6 7 8 9 10 11 12 13-14 15 16 17 18 19 20 21 22 23 The 
 __initdata next_page (EARLY_LEVEL4_PGT). Fill 511,8,0. Quad Level3_k ERNEL_PGT-__start_kernel_map + _page_table next_page (early_dynamic_pgts). Fill 512*early_dynamic_page_tables,8,0. Data Next_page (INIT_LEVEL4_PGT). Fill 512,8,0 next_page (level3_kernel_pgt). Fill l3_start_kernel,8,0/* (2^48- 024*1024*1024)-((2^39) *511))/(2^30) = 510/. Quad LEVEL2_KERNEL_PGT-__start_kernel_map + _kernpg_table. Quad Level2 _FIXMAP_PGT-__start_kernel_map + _page_table next_page (LEVEL2_KERNEL_PGT) PMDs (0< 

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.