Home » Linux » Which address space is occupied by the kernel in 64 bit Linux?

Which address space is occupied by the kernel in 64 bit Linux?

Posted by: admin January 30, 2018 Leave a comment

Questions:

What is the address space of the kernel for 64 bit Linux, that is, what is the address range of the code, stack, heap and data segments used by it.

Answers:

On a 64-bit Linux all 64-bit addresses with the highest order bit set to 1 are reserved for the kernel. In other words, the top half of the virtual address space.

For full details see http://en.wikipedia.org/wiki/X86-64#Virtual_address_space_details

Questions:
Answers:

PAGE_OFFSET and ULLONG_MAX are constants with values that are equal to the start and end addresses of the kernel memory. You can use them directly in your kernel C module:

#define START_MEM   PAGE_OFFSET
#define END_MEM     ULLONG_MAX