I learned a lot of knowledge today while studying MMU. I have summarized it as follows, firstly to deepen my impression and secondly to write it down in the hope that I can exchange and learn with you.
1. What is MMU?
Answer: MMU is a memory management unit. If MMU is turned on, it will convert the virtual address sent by the CPU into a physical address, and then perform corresponding read and write operations on the actual physical address. Of course, it also has other functions, including memory permission checking, cache, etc.
2. What is a virtual address? Why does a virtual address appear?
Answer: A virtual address is the address that the CPU "sees". All of its address-related operations use virtual addresses. So why does a virtual address appear? I think it may be for this reason: In the past, when there was no operating system, there was only one program running on the CPU, which occupied all the memory space (similar to the current bare board program). As long as the memory space required by the program is smaller than the actual physical memory, the CPU can directly manipulate the physical memory with the physical address. But later, with the emergence of multi-user and multi-program mechanisms, the memory space required by all programs is larger than the actual physical memory, so virtual memory appeared. In theory, it allows each program to have the same size of memory space (in theory, the maximum can be the actual physical memory space, and the specific principle will not be repeated here). Virtual memory corresponds to virtual addresses. The virtual address space of each process can be the same (you can apply for a variable in a C language and print out its address, and run the program twice at the same time, and you will find that the addresses of the two variables are the same), and then the virtual address of each process is converted to the actual physical address space through the function of MMU.
3. How is the address mapping (virtual address -> physical address) function of MMU implemented?
Answer: In fact, it is very simple in general. Generally speaking, it adopts a mechanism similar to a mapping table (professionally called a page table). The mapping of virtual address to physical address. In simple terms, the virtual address issued by the CPU is converted into a physical address by the MMU by querying this mapping table. In the ARM system, there are page table types such as segment (first-level page table), large page, small page, and tiny page (second-level page table).
4. What do the running address and loading address mean, and what is the difference?
Answer: In ARM, when the program is burned into FLASH, the loading address is used. It is burned to a certain address in FLASH. When the program is running, the address where the program is located is the running address, also called the link address. When burning the ARM bare board program, if the link address is not specified when linking, the loading address of the program is the link address. When the link address of a certain segment is specified, when running to this segment, this segment must be at the specified link address, otherwise the program may crash (in fact, if the specified segment does not involve position-related instructions, it should not matter, because position-related instructions use absolute addresses, while position-independent instructions use relative addresses. The absolute address is related to the link address, and the relative address has nothing to do with the link).
Previous article:ARM learning GPIO to realize water light
Next article:ARM learning interrupt architecture
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- I made a board and the rectifier bridge was broken. I would like some advice.
- Development of single-phase traction transformer for AT power supply mode
- How to wear out a hard drive?
- When using Keil to compile, address space overflow may occur when a function segment is removed
- 【Recruitment】Ability, Dream, and FUTURE
- Source code for reading and writing RC522 RFID module with MSP430F149
- I am looking for a manufacturer that produces resistors. Used for temperature compensation
- [Qinheng RISC-V core CH582] 8-CH582 realizes temperature and humidity data collection, display, upload to mobile phone, and message function
- Happy Sharing: List of National IC Design Companies
- Chengdu is recruiting embedded software engineers for automotive MCU