Skip to content

Memory management

1. Virtual address- kernel space- user space## 2. Physical address- ZONE_DMA- ZONE_NORMAL- ZONE_HIGHMEN## 3. Process and memory### (1). Code segment- Executable file operation instructions- Prevent illegal modification during runtime- read only### (2). Data segment- Store initialized global variables (statically allocated variables and global variables) in the executable file### (3). BSS section- Uninitialized global variables in the program### (4). Heap

  • Dynamically allocated memory segment in the program- Can be expanded or reduced- Malloc/free### (5). StackStack
  • Local variables temporarily created by the program- variables defined in the function- Parameters when calling the function## 4. Kernel space
  • direct mapping area- High-end memory linear address space- Dynamic memory mapping area- Permanent memory mapping area- Fixed mapping area The user space occupied by the process is divided into 5 different memory areas according to the principle of "address spaces with consistent access attributes are stored together" (access attribute: rwx)Including kernel image, physical page table, driver