What Is Kernel Space and Is It Different from the Kernel Stack?

Question
What is kernel space and is it different from the kernel stack?

Answer
"System memory in Linux can be divided into two distinct regions: kernel space and user space. Kernel space is where the kernel (i.e., the core of the operating system) executes (i.e., runs) and provides its services. "

Kernel space is mutually exclusive with user space (according to https://unix.stackexchange.com/questions/87625/what-is-difference-between-user-space-and-kernel-space, http://www.catb.org/jargon/html/U/userland.html, https://www.educative.io/answers/what-is-the-difference-between-the-kernel-and-user-spaces).

"Grossly simplifying, the kernel space is the memory area that is reserved to the kernel while user space is the memory area reserved to a particular user process. The kernel space is accessed protected so that user applications can not access it directly, while user space can be directly accessed from code running in kernel mode." taken from https://linux-kernel-labs.github.io/refs/heads/master/lectures/intro.html

Yes, there is a difference between the two concepts.
"The kernel stack is part of the kernel space. Hence, it is not directly accessible from a user process." (Taken from https://www.baeldung.com/linux/kernel-stack-and-user-space-stack)

See this for more information about a kernel accessing hardware:
https://www.continualintegration.com/miscellaneous-articles/can-the-kernel-access-hardware-directly/

Leave a comment

Your email address will not be published. Required fields are marked *