gpt4 book ai didi

linux - 什么是 "the kernel address space"?

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:03:46 25 4
gpt4 key购买 nike

从 Understanding The Linux Kernel 开始,这里有一些关于内核线程与用户进程(即常规进程)的讨论:

Besides user processes, Unix systems include a few privileged processes called kernel threads with the following characteristics:

• They run in Kernel Mode in the kernel address space.

• They do not interact with users, and thus do not require terminal devices.

• They are usually created during system startup and remain alive until the system is shut down.

...

In Linux, kernel threads differ from regular processes in the following ways:

• Kernel threads run only in Kernel Mode, while regular processes run alternatively in Kernel Mode and in User Mode.

• Because kernel threads run only in Kernel Mode, they use only linear addresses greater than PAGE_OFFSET. Regular processes, on the other hand, use all four gigabytes of linear addresses, in either User Mode or Kernel Mode.

我听说过用户进程的虚拟地址空间,即常规进程,和 a portion of the address space is mapped to the kernel code and data .

我的问题:

  • 我想知道上面引述中的“内核地址空间”是什么意思?
  • 它不是用户进程的虚拟地址空间的一部分吗?
  • 这是否意味着内核有自己的虚拟地址空间,就像用户进程有自己的虚拟地址空间一样?

最佳答案

本书使用术语“内核地址空间”来指代为内核分配的虚拟地址空间的分区。

最近,Linux 和其他操作系统已经实现了 page-table isolation (PTI) 来缓解 Meltdown 安全漏洞。使用 PTI,内核确实有自己的地址空间(如维基百科的图片所示)。但由于这本书很旧,它是在 PTI 还没有发明的时候写的。

所以肯定是指虚拟地址空间的内核分区,其中也包含用户分区。

关于linux - 什么是 "the kernel address space"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52340014/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com