Back to the alloc_init_pte function, line 605 sets the page table entry (i.e. pte) located by addr in the L2 page table. Its main task is to fill in the physical address of the corresponding physical page for the mmu hardware to implement address translation.
Line 604~line 607 loops through filling two hwpte page tables and completes the creation of a 2M physical memory mapping table.
Line 608 will eventually call the following function: static inline void __pmd_populate(pmd_t *pmdp, phys_addr_t pte, pmdval_t prot)
Before executing this function, two L2 page tables have been created. The function is to set the corresponding table entries of the L1 page table to point to the two newly created L2 page tables (hwpte0, hwpte1). As mentioned earlier, since the L1 page table entry of Linux is 8 bytes in size, so:
Line133 points the first 4 bytes to the hwpte0 page table.
Line135 points the last 4 bytes to the hwpte1 page table. So far, the association of L1---〉L2 page table has been established.
Line 137 refreshes the TLB buffer so that the system's CPU can see the changes in the mapping
At this point, the mapping relationship between the virtual address and the physical address specified by the struct map_desc *md structure has been established, so that the hardware MMU can automatically translate the virtual address to the physical address.
In the above process, some details are selectively omitted due to space limitations. If you understand the process, you can read the relevant code in detail. For example, the set_pte_ext function above will call the assembly function to implement the setting of the pte table entry.
Previous article:2440 flash programming problem
Next article:arm stack-(selection of stack starting address)
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Sandia Labs develops battery failure early warning technology to detect battery failures faster
- Ranking of installed capacity of smart driving suppliers from January to September 2024: Rise of independent manufacturers and strong growth of LiDAR market
- Industry first! Xiaopeng announces P7 car chip crowdfunding is completed: upgraded to Snapdragon 8295, fluency doubled
- P22-009_Butterfly E3106 Cord Board Solution
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case