In-Depth Analysis of the Core Mechanism and Engineering Practice of Linux mmap

In-Depth Analysis of the Core Mechanism and Engineering Practice of Linux mmap

In the collaborative design between the file system and the kernel, mmap is a core mechanism that combines elegance and complexity. It is far more than just “mapping files to memory”; it involves the intricate cooperation of virtual memory, file systems, page cache, and even hardware MMU. Today, we will penetrate the abstraction, delve into … Read more

Sharing Knowledge on Embedded Memory Management

Sharing Knowledge on Embedded Memory Management

Any program requires memory allocation to store the resource information of the process, and C programs are no exception. The areas where variables, constants, functions, and code are stored in a C program differ, and each area has its own characteristics. Learners of C, especially those studying embedded systems, must thoroughly understand these concepts! The … Read more

Understanding Pointers in C Language

Understanding Pointers in C Language

Pointers are the essence of the C language. Understanding memory can help better comprehend and learn about pointers. Before learning about pointers, it is advisable to refer to the Von Neumann architecture and the simple example of the Von Neumann architecture, as well as the basic understanding of operating systems. When you run a program, … Read more

Understanding the vmstat Command in Linux with Examples

Understanding the vmstat Command in Linux with Examples

vmstat is a Linux system monitoring tool used to view the status of virtual memory, processes, CPU, IO, and other system metrics in real-time. Its full name is “virtual memory statistics.”Syntax: vmstat [options] [interval] [count], where the default output shows average statistics since system startup. Adding an interval (in seconds) refreshes the output in real-time, … Read more

Linux Performance Tuning: Memory Management

Memory management is one of the core functions of an operating system, primarily used to store applications, instructions, caches, and more. Processes, Virtual Memory, and Physical Memory Physical memory is relatively easy to understand; it refers to the amount of memory in a computer, such as 8GB or 16GB. Physical memory is also known as … Read more

Understanding SWAP Partitions in Linux Systems

Recently, after adjusting my hard disk partitions, I found that my Ubuntu often froze, with the mouse pointer not responding promptly. After using free, I discovered that there was no SWAP information. It turned out that the partition modification caused the SWAP partition to become ineffective (my 2GB DDR struggled while downloading the Android source … Read more

Is MMU Required for Running Embedded Linux?

Is MMU Required for Running Embedded Linux?

Scan to FollowLearn Embedded Together, learn and grow together Why is MMU Needed? We know that applications cannot access memory arbitrarily. Allowing applications to directly access physical memory would be very dangerous, as all contents of the computer’s memory would be completely exposed. This is where the MMU comes in. The MMU, or Memory Management … Read more

28 Questions About Learning Armv8/Armv9 MMU

28 Questions About Learning Armv8/Armv9 MMU

01. How many MMUs are there in a large system? 02. How many Translation regimes are there in an ARM Core? 03. What are the differences among EL1&0 Translation regime Stage 2, EL2 Translation regime Stage 1, and EL2&0 Translation regime Stage 1? 04. What is special about the TTBR1EL2 register, and who uses this … Read more

Introduction to ARMV8-A MMU – Part 2

Introduction to ARMV8-A MMU - Part 2

Continuing from the previous article on ARMV8-A MMU – Part 1. IPS[34:32] (Intermediate Physical Address Size) controls the size of the IPA address space. When IPS=000, it indicates a 32-bit address space; when IPS=101, it indicates a 48-bit address space. The meanings of other values can be referenced in the ARMv8 documentation. After setting the … Read more

Introduction to MMU in ARMV8-A – Part 3

Introduction to MMU in ARMV8-A - Part 3

Continuing from the previous article on Introduction to MMU in ARMV8-A – Part 2. This article will continue from the last section and explain the multi-level page tables of MMU. The previous section discussed an example of a single-level page table, while this section will discuss an example of a two-level page table. Below is … Read more