简体   繁体   中英

What is the difference between kernel logicla address space , kernel virtual address space and user virtual address space

Let me put my understanding.

  • Suppose we have a 32-bit memory address space for a system. So a process can access any memory in the 4GB range

  • If the RAM in the system we have of 4GB, kernel divides it into 1:3 . 1GB for kernel , and rest 3GB for the user space process.

  • A user space process will get the system memory access within that 3GB memory only and which address it gets is determined by the page table.

  • Kernel logical address is that 1GB ( approx ~896MB) memory which is being reserved only for the kernel. Is this correct?

  • kernel virtual address is the memory left ie 104MB + 3GB that also can be assigned to userspace. Is this correct?

  • user virtual address is the address generated by the user space process and its corresponding memory would be assigned from the 3GB reserved for the user space process by the kernel.

Let me know if my above understanding is correct? If not can you please explain in detail the difference between kernel logical address space , kernel virtual address space and user virtual address space.

your understanding is a mixture of right and wrong, I'll try to point to some of them:

  1. in 32 bit machines, we're not always limited by 4GB addressable RAM, check this question for more detail: link
  2. the memory is an abstraction for the user space programs, they see it aa continuous big chunk of memory, but the kernel manages this abstraction with some hardware support named MMU, to map the used virtual space in the user space program into an actual physical address or even some bloc in hard drive if swapping is activated.
  3. the kernel can actually access to the physical memory, in order to manage the abstraction mentioned above, it can also use this abstraction, this depends on the designer of the kernel.

  4. as for the difference between the virtual and logical addressing, check this answer: link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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