简体   繁体   English

内核的物理内存映射在所有虚拟地址空间之间是否相同?

[英]Is the kernel's physical memory mapping the same between all virtual address spaces?

On boot, I understand the the kernel is loaded into main memory.在启动时,我了解内核已加载到主内存中。 When we spawn processes, a portion of the virtual address space is reserved for the kernel.当我们生成进程时,一部分虚拟地址空间是为内核保留的。 If every processes' virtual address space contains a mapping to the kernel, and the virtual address space for the kernel in each process is always the same: Does this mean every process/virtual address space maps to the same parts of main memory where the kernel resides?如果每个进程的虚拟地址空间都包含到内核的映射,并且每个进程中内核的虚拟地址空间始终相同:这是否意味着每个进程/虚拟地址空间都映射到内核所在的主内存的相同部分居住? This also means the system call interface is available to all processes, and that initiates the "switch" from user space to kernel space?这也意味着系统调用接口对所有进程都可用,并且启动了从用户空间到内核空间的“切换”? And once we're in kernel space, the process has permissions to touch the protected parts of main memory where the kernel is loaded?一旦我们进入内核空间,该进程是否有权访问加载内核的主内存的受保护部分?

It wouldn't make sense to load the kernel multiple times in main memory as it would be expensive, but shared data structures would be terribly difficult to coordinate.在主内存中多次加载内核是没有意义的,因为它会很昂贵,但是共享数据结构将非常难以协调。

kernel space is constantly present and maps the same physical memory in all processes.内核空间始终存在,并在所有进程中映射相同的物理内存。 Check these similar discussions:检查这些类似的讨论:

Linux Kernel logical address for multiple processes 多个进程的Linux内核逻辑地址

Why is kernel mapped to the same address space as processes? 为什么内核映射到与进程相同的地址空间?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM