One: First, understand two concepts: physical memory and virtual memory
Physical memory: commonly referred to as RAM (random memory), has a storage unit register that stores the intermediate results of instructions executed by a computing unit. Physical memory is real, e.g., memory sticks
Virtual memory: A logical piece of memory that is virtualized using disk space. The disk used as virtual memory is called swap space. Virtual memory ensures that multiple threads can share the same piece of physical memory when executing simultaneously. But it's only shared spatially, not logically, and the mutual brackets are not directly accessible.
2： What is Kernel？ What is User Space？
- The kernel is the memory, or system space, that the operating system needs to run.
User space is a portion of space provided for use by user threads.
Kernel space is used to store system process data; user space is used to store user process data. If not divided, it will result in data confusion and affect the proper functioning of the system. Separate storage ensures that the operating system and user processes do not affect each other, ensuring system stability and also facilitating management. More importantly by isolating user data from system data, it is possible to control access to data in various parts. This guarantees that user processes cannot modify system processes and prevents user processes from maliciously modifying system processes and affecting the use of system processes.